public void WriteLRInsureContSheet() { try { string path = @"C:\Users\Administrator\Desktop\template\template\yyyymm\output"; ExcelTemplate excelTemplate = new ExcelTemplate(); IExcel excelApp = new ExcelCore.ExcelCore(); excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LRProduct + ".xlsx", ExcelTemplateName.LRProduct); excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LRInsureCont + ".xlsx", ExcelTemplateName.LRInsureCont); excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LRAccount + ".xlsx", ExcelTemplateName.LRAccount); excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LJInvoiceRelation + ".xlsx", ExcelTemplateName.LJInvoiceRelation); excelTemplate.CreateTemplate(excelApp, path + @"\TEMP_" + ExcelTemplateName.LJInvoice + ".xlsx", ExcelTemplateName.LJInvoice); LRInsureCont lRInsureCont = new LRInsureCont(); ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness(); string TEMP_LMLiabilityInfoExcelPath = @"C:\Users\Administrator\Desktop\template\template\inputPath2"; contractInfoBusiness.GetInformationDataFromExcel(TEMP_LMLiabilityInfoExcelPath, @"C:\Users\Administrator\Desktop\template\template\yyyymm"); lRInsureCont.WriteLRInsureContSheet(contractInfoBusiness, path + @"\TEMP_" + ExcelTemplateName.LRInsureCont + ".xlsx", "20170131"); LRAccount lRAccount = new LRAccount(); lRAccount.WriteLRAccountSheet(contractInfoBusiness, path + @"\TEMP_" + ExcelTemplateName.LRAccount + ".xlsx", "201701"); } catch (Exception ex) { throw; } }
public void WriteLRInsureContSheetTest() { try { LRInsureCont lRInsureCont = new LRInsureCont(); ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness(); string outPutFilePath = @"C:\Users\Administrator\Desktop\v20180309.xlsx"; string TEMP_LMLiabilityInfoExcelPath = @"C:\Users\Administrator\Desktop\template\template\inputPath2"; contractInfoBusiness.GetInformationDataFromExcel(TEMP_LMLiabilityInfoExcelPath, @"C:\Users\Administrator\Desktop\template\template\yyyymm"); ExcelTemplate excelTemplate = new ExcelTemplate(); // excelTemplate.CreateTemplate(outPutFilePath); lRInsureCont.WriteLRInsureContSheet(contractInfoBusiness, outPutFilePath, "20170131"); LRAccount lRAccount = new LRAccount(); lRAccount.WriteLRAccountSheet(contractInfoBusiness, outPutFilePath, "201701"); } catch (Exception ex) { throw; } }
private void TestCommand() { if (!CheckExcelPath()) { return; } Task.Factory.StartNew(() => { CommFuns.KillExcelProcess(); ContractInfoBusiness contractInfoBusiness = new ContractInfoBusiness(); LRProduct lrProduct = new LRProduct(); LRInsureCont lRInsureCont = new LRInsureCont(); LRAccount LRAccount = new LRAccount(); string lastDateOfMonth = string.Empty; SetConfigInformationFilePath(); try { string[] lstInputStruct = this.InputFolderPath.Trim('\\').Split('\\'); if (lstInputStruct.Length > 1) { bool isValid; string rootInputPathFolderName = lstInputStruct[lstInputStruct.Length - 1]; lastDateOfMonth = this.GetCurrentMonthLastDay(rootInputPathFolderName, out isValid); if (!isValid) { ProcessLogProxy.Error("The input path is illegal. The last folder format must be yyyymm or yyyymmdd!"); return; } } else { ProcessLogProxy.Error("The input path is illegal. The last folder format must be yyyymm or yyyymmdd!"); return; } // get data source from ContractInfo contractInfoBusiness.GetInformationDataFromExcel(ReferenceFolder, InputFolderPath); //得到表二的数据 lRInsureCont.GetLRInsureContData(contractInfoBusiness); //1.16.1 input data to LRProduct sheet 再保产品信息表 if (LRProductChecked) { lrProduct.InputDataToLRProductSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth); } //1.16.2 LRInsureCont 生成再保合同信息表 if (LRInsureContChecked) { lRInsureCont.WriteLRInsureContSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth); } //1.16.3 LRAccount 再保账单信息表 if (LRAccountChecked) { LRAccount.WriteLRAccountSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth); } //1.16.4 LRCont 再保首续期险种明细表 if (LRContChecked) { LRCont lRCont = new LRCont(); lRCont.WriteLRContSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth); } //1.16.5 LREdor 再保保全变更信息表 if (LREdorChecked) { LREdor lREdor = new LREdor(); lREdor.WriteLREdorSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth); } //1.16.6 LRClaim 再保理赔信息表 if (LRClaimChecked) { LRClaim lRClaim = new LRClaim(); lRClaim.WriteLRClaimSheet(contractInfoBusiness, OutputFolderPath, lastDateOfMonth); } ProcessLogProxy.SuccessMessage("Success"); } catch (Exception ex) { ProcessLogProxy.Error(ex.Message); } finally { CommFuns.KillExcelProcess(); } }); }