Esempio n. 1
0
        public FileResult CommonExportWordIn(string id)
        {
            var mql2 = TF_PersonnelFile_Transmitting_InSet.SelectAll().Where(TF_PersonnelFile_Transmitting_InSet.Id.Equal(id));
            TF_PersonnelFile_Transmitting_In Rmodel = tfpftBiz.GetEntity(mql2);

            Dictionary <string, string> dir = new Dictionary <string, string>();

            dir.Add("Series", Rmodel.Series);
//            dir.Add("Nos", Rmodel.Nos);
            dir.Add("Series2", Rmodel.Series);
//            dir.Add("Nos2", Rmodel.Nos);


            var mql3     = TF_PersonnelFile_Transmitting_In_ItemSet.SelectAll().Where(TF_PersonnelFile_Transmitting_In_ItemSet.OwnerId.Equal(id));
            var listItem = OPBiz.GetDictionaryList(mql3);

            string filename     = Guid.NewGuid().ToString() + ".docx";
            string loadfilename = Server.MapPath("~/tempword/干部人事档案材料转递单.docx");

            WordHelper.ExportWord(listItem, dir, Server.MapPath("~/temp/" + filename), loadfilename, 2);
            //            var ff = Exporter.Instance(Server.MapPath("~/temp/" + filename)).Download();
            return(File(Server.MapPath("~/temp/" + filename), "application/ms-word", string.Format("{0}.docx", "干部人事档案材料转递单")));
        }