Ejemplo n.º 1
0
        /// <summary>
        /// 创建县公司文档
        /// </summary>
        public override void createword(string wordpath)
        {
            try
            {
                lstFM = FDXXtbl_country.GetInfo(CompanyID);
                FM    = FDXXtbl_country.GetTotalInfo(CompanyID);
                lstPM = FDXXtbl_country.Parcels(lstFM);
                lstBM = FDXXtbl_country.Buildings(lstFM);
                //WordPath = wordpath;
                using (DocX document = DocX.Create(wordpath))
                {
                    //document.ApplyTemplate(@"F:\study\国网江苏\svnRealEstate\RealEstate.Web\国网江苏省电力公司\word.dotx");//应用模板

                    setdoc(document);                  //设置文档属性

                    Addcover(document);                //添加封面

                    Addtoc(document);                  //添加目录

                    Addintro(document, title_country); //添加概述

                    Addloc(document);                  //添加位置分布图

                    Addfdxx(document);                 //添加房地信息统计

                    Addparcels(document);              //添加宗地描述

                    document.Save();

                    if (docCompilationListener != null)
                    {
                        docCompilationListener.DocCompleted(new DocCompilationArg(
                                                                CompanyID, wordpath, DocCompilationStatus.Success));
                    }
                }
            }
            catch (System.Exception ex)
            {
                LogHelper.WriteLog(typeof(CreateCountryCompany), ex);
                if (docCompilationListener != null)
                {
                    docCompilationListener.DocCompleted(new DocCompilationArg(
                                                            CompanyID, wordpath, DocCompilationStatus.Fail, ex.Message));
                }
                throw new Exception("生成失败:" + ex.Message);
            }
        }
Ejemplo n.º 2
0
        /// <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();
        }