/// <summary> /// 添加宗地描述模块(作为市公司的下级) /// </summary> /// <param name="document"></param> /// <param name="childcountryID"></param> public void Addparcels(DocX document, Companymodel childcountry, NumoftitleHelper title) { foreach (Parcelmodel pm in lstPM) { parcelHelper phelper = new parcelHelper(pm, (int)childcountry.ID);//添加各个地块的信息 if (childcountry.property == "培训单位" || childcountry.property == "直属单位") { phelper.insertInfo(document, lstFM, lstPM, false, true, title); } else { phelper.insertInfo(document, lstFM, lstPM, true, false, title); } } }
/// <summary> /// 创建县公司文档(作为市公司的下级) /// </summary> /// <param name="document"></param> /// <param name="childcountryName"></param> /// <param name="childcountryID"></param> public void createword(DocX document, Companymodel childcountry, NumoftitleHelper title) { lstFM = FDXXtbl_country.GetInfo((int)childcountry.ID); FM = FDXXtbl_country.GetTotalInfo((int)childcountry.ID); lstPM = FDXXtbl_country.Parcels(lstFM); lstBM = FDXXtbl_country.Buildings(lstFM); if (!childcountry.name.Contains("本部")) { Addintro(document, childcountry, title); //不是市公司本部,则添加概述 } Addloc(document, childcountry, title); //添加位置分布图 Addfdxx(document, childcountry, title); //添加房地信息统计 Addparcels(document, childcountry, title); //添加宗地描述 document.Save(); }
/// <summary> /// 添加概述模块(作为市公司的下级) /// </summary> /// <param name="document"></param> /// <param name="childcountryID"></param> /// <param name="ischild"></param> public void Addintro(DocX document, Companymodel childcountry, NumoftitleHelper title) { try { Paragraph h1; string s = txt.txtHelper.readtxt(PathManager.getSingleton().GetIntrotxtPath((int)childcountry.ID, false)); if (s == "") { return; //概述文件缺少,就不添加概述 } if (childcountry.property == "直属单位" || childcountry.property == "培训单位") { title.Less3Zero(); h1 = document.InsertParagraph(title.num3title() + "概述"); h1.StyleName = "Heading3"; using (FontFamily fontfamily = new FontFamily("宋体")) { h1.Color(Color.Black).FontSize(14).Font(fontfamily); } } else { title.Less2Zero(); h1 = document.InsertParagraph(title.num2title() + "概述"); h1.StyleName = "Heading2"; using (FontFamily fontfamily = new FontFamily("宋体")) { h1.Color(Color.Black).FontSize(16).Font(fontfamily); } } Paragraph p = document.InsertParagraph(s); using (FontFamily fontfamily = new FontFamily("宋体")) { p.Font(fontfamily).FontSize(14); } Picture p1 = picture.picHelper.getPic(document, PathManager.getSingleton().GetIntropicPath((int)childcountry.ID, false), 330, 650); Paragraph pic = document.InsertParagraph(); pic.AppendPicture(p1).Alignment = Alignment.center; } catch (System.Exception ex) { LogHelper.WriteLog(typeof(CreateCountryCompany), ex); } }
/// <summary> /// 添加位置分布图模块(作为市公司的下级) /// </summary> /// <param name="document"></param> /// <param name="childcountryID"></param> public void Addloc(DocX document, Companymodel childcountry, NumoftitleHelper title) { try { Paragraph h2; Picture p1 = picture.picHelper.getPic(document, PathManager.getSingleton().GetLocpicPath((int)childcountry.ID, false), 384, 864); if (p1 == null) { return; //如果图片文件不存在,则跳过这个模块 } if (childcountry.property == "直属单位" || childcountry.property == "培训单位") { title.Less3Zero(); h2 = document.InsertParagraph(title.num3title() + "位置分布图"); h2.StyleName = "Heading3"; using (FontFamily fontfamily = new FontFamily("宋体")) { h2.Color(Color.Black).FontSize(14).Font(fontfamily); } } else { title_country.Less2Zero(); h2 = document.InsertParagraph(title.num2title() + "位置分布图"); h2.StyleName = "Heading2"; using (FontFamily fontfamily = new FontFamily("宋体")) { h2.Color(Color.Black).FontSize(16).Font(fontfamily); } } Table t = tableHelper.locpicTable(document, p1); t.Alignment = Alignment.center; t.AutoFit = AutoFit.Contents; Paragraph pic = document.InsertParagraph(); pic.InsertTableAfterSelf(t).Alignment = Alignment.center; } catch (System.Exception ex) { LogHelper.WriteLog(typeof(CreateCountryCompany), ex); } }
/// <summary> /// 添加房地信息统计模块(作为市公司的下级) /// </summary> /// <param name="document"></param> /// <param name="childcountryName"></param> /// <param name="childcountryID"></param> public void Addfdxx(DocX document, Companymodel childcountry, NumoftitleHelper title) { try { Paragraph h3; if (childcountry.property == "直属单位" || childcountry.property == "培训单位") { title.Less3Zero(); h3 = document.InsertParagraph(title.num3title() + "房地信息统计"); h3.StyleName = "Heading3"; using (FontFamily fontfamily = new FontFamily("宋体")) { h3.Color(Color.Black).FontSize(14).Font(fontfamily); } } else { title.Less2Zero(); h3 = document.InsertParagraph(title.num2title() + "房地信息统计"); h3.StyleName = "Heading2"; using (FontFamily fontfamily = new FontFamily("宋体")) { h3.Color(Color.Black).FontSize(16).Font(fontfamily); } } //文字描述 var p = document.InsertParagraph(); p.Append(childcountry.name + "市公司现有各类用房"); p.AppendBookmark((int)childcountry.ID + "各类用房栋数"); p.Append("栋,占地总面积"); p.AppendBookmark((int)childcountry.ID + "占地总面积"); p.Append("平方米,总建筑面积"); p.AppendBookmark((int)childcountry.ID + "总建筑面积"); p.Append("平方米。其中"); p.AppendBookmark((int)childcountry.ID + "各类用房面积"); p.Append(";建成投运10年内的房屋面积为"); p.AppendBookmark((int)childcountry.ID + "十年内房屋面积"); p.Append("平方米,建成投运10-20年的房屋面积为"); p.AppendBookmark((int)childcountry.ID + "十到二十年内房屋面积"); p.Append("平方米,建成投运20-30年的房屋面积为"); p.AppendBookmark((int)childcountry.ID + "二十到三十年内房屋面积"); p.Append("平方米,建成投运30年以上的房屋面积为"); p.AppendBookmark((int)childcountry.ID + "三十年以上房屋面积"); p.Append("平方米。"); finishBM(document, (int)childcountry.ID);//完成书签内容 //表格描述 var tbltitle = document.InsertParagraph("房地信息汇总表"); tbltitle.FontSize(14).Alignment = Alignment.center; Table t = tableHelper.Template_country(document); t = tableHelper.inserttable_country(t, lstFM, FM); t = tableHelper.combineCells(t, lstPM, lstBM); t.Alignment = Alignment.center; t.AutoFit = AutoFit.Contents; document.InsertTable(t); } catch (System.Exception ex) { LogHelper.WriteLog(typeof(CreateCountryCompany), ex); } }