Пример #1
0
        public string GenerateBidDocument(gpTenderProjectWebDO gptp, gpTemplateWebDO gpt)
        {
            string path = Path.Combine(AppDirectory.Temp_Dir(gptp.gpId), "招标文件.docx");

            IGpTemplateNodeService gpTemplateNodeService = new GpTemplateNodeService();

            gpTemplateNodeWebDO[] gptns = gpTemplateNodeService.FindListByGtId(gpt.gtId);

            using (DocX document = DocX.Create(path))
            {
                //标题
                document.InsertParagraph("《招标文件》").FontSize(18d).Bold().SpacingAfter(50d).Alignment = Alignment.center;

                //项目名称
                document.InsertParagraph(string.Format("项目名称:{0}", gptp.gtpName)).FontSize(15d).Bold().SpacingAfter(30d).Alignment = Alignment.left;

                //标段名称
                document.InsertParagraph(string.Format("标段名称:{0}", gptp.gsName)).FontSize(15d).Bold().SpacingAfter(30d).Alignment = Alignment.left;

                //段落
                this.GenerateDocumentContent(gptns, document, 0, 1);

                document.Save();
            }

            return(path);
        }
Пример #2
0
        public string GenerateBidTemplateDocument(gpTemplateWebDO gpt)
        {
            string path = string.Format("{0}\\{1}.docx", AppDirectory.Temp(), gpt.gtName);

            IGpTemplateNodeService gpTemplateNodeService = new GpTemplateNodeService();

            gpTemplateNodeWebDO[] gptns = gpTemplateNodeService.FindListByGtId(gpt.gtId);

            using (DocX document = DocX.Create(path))
            {
                //标题
                document.InsertParagraph("招标模板").FontSize(18d).Bold().SpacingAfter(50d).Alignment = Alignment.center;

                //段落
                this.GenerateDocumentContent(gptns, document, 0, 1);

                document.Save();
            }

            return(path);
        }