string CasesTem = ConfigurationManager.AppSettings["DKMerchantTem"].ToString(); //其他成功案例模版存放位置 #region 创建招商静态页面 /// <summary> ///创建贷款静态页面 /// </summary> public int StaticHtml(int loansInfoID) { Tz888.BLL.loansInfoTab loansinfotabbll = new loansInfoTab(); Tz888.BLL.LoansInfo loansinfobll = new LoansInfo(); Tz888.BLL.loanscontactsTab loanscontactstabbll = new loanscontactsTab(); Tz888.Model.LoansInfoTab loansinfotab = loansinfotabbll.GetLoansInfoTabByLoansInfoId(loansInfoID); Tz888.Model.LoansInfo loansinfo = loansinfobll.GetLoansInfoByLoansInfoId(loansInfoID); Tz888.Model.LoanscontactsTab loanscontactstab = loanscontactstabbll.GetLoanscontactsTabByLoansInfoId(loansInfoID); try { string proviceID = loansinfo.ProvinceID.ToString().Trim(); string TempFileName = CasesTem.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 #region 替换模版 string TempSoure = Tem; TempSoure = TempSoure.Replace("$title$", loansinfotab.LoansTitle.ToString().Trim()); string ProvinceID = loansinfo.ProvinceID.ToString().Trim(); string provincename = loansinfobll.GetProvinceNameByProvinceId(ProvinceID).Trim(); if (provincename.Trim() == "") { provincename = "中国"; } string deadlineriqi = ""; if (loansinfo.Deadline == 3) { deadlineriqi = "3个月"; } if (loansinfo.Deadline == 6) { deadlineriqi = "半年"; } if (loansinfo.Deadline == 12) { deadlineriqi = "1年"; } if (loansinfo.Deadline == 24) { deadlineriqi = "2年"; } if (loansinfo.Deadline == 36) { deadlineriqi = "3年"; } if (loansinfo.Deadline == 60) { deadlineriqi = "5年"; } string systime = ""; if (loansinfo.ValidityID == 3) { systime = "3个月"; } if (loansinfo.ValidityID == 6) { systime = "半年"; } if (loansinfo.ValidityID == 12) { systime = "1年"; } if (loansinfo.ValidityID == 24) { systime = "2年"; } if (loansinfo.ValidityID == 36) { systime = "3年"; } if (loansinfo.ValidityID == 60) { systime = "5年"; } string danbao = ""; if (loansinfo.Guarantee == 0) { danbao = "担保"; } if (loansinfo.Guarantee == 1) { danbao = "抵押"; } if (loansinfo.Guarantee == 2) { danbao = "信用"; } string titlesystemname = sethtml(); string hai = ""; if (loansinfo.Reimbursement == 0) { hai = "月"; } if (loansinfo.Reimbursement == 1) { hai = "季"; } if (loansinfo.Reimbursement == 2) { hai = "年"; } string xiangxi = sethtmls(loansinfo.ProvinceID.ToString().Trim()); TempSoure = TempSoure.Replace("$infoID$", loansInfoID.ToString().Trim()); TempSoure = TempSoure.Replace("$loansTitle$", loansinfotab.LoansTitle.ToString().Trim()); TempSoure = TempSoure.Replace("$Are$", provincename); TempSoure = TempSoure.Replace("$money$", loansinfo.Amount.ToString().Trim()); TempSoure = TempSoure.Replace("$borrowmoneyqixian$", deadlineriqi.ToString().Trim()); TempSoure = TempSoure.Replace("$danbaotype$", danbao.ToString().Trim()); TempSoure = TempSoure.Replace("$publishdate$", loansinfotab.Loansdate.ToString().Trim().Substring(0, 9)); TempSoure = TempSoure.Replace("$systime$", systime.ToString().Trim()); TempSoure = TempSoure.Replace("$Content$", loansinfo.BorrowingUse.ToString().Trim()); TempSoure = TempSoure.Replace("$Titlesytem$", titlesystemname.ToString().Trim()); TempSoure = TempSoure.Replace("$DisplayTitle$", loansinfo.Title.ToString().Trim()); TempSoure = TempSoure.Replace("$KeyWord$", loansinfo.Keywords.ToString().Trim()); TempSoure = TempSoure.Replace("$description$", loansinfo.Description.ToString().Trim()); TempSoure = TempSoure.Replace("$haifangshi$", hai.ToString().Trim()); TempSoure = TempSoure.Replace("$XianXi$", xiangxi); #endregion #region string inPathTo = "/loans"; string htmlFile = loansinfotab.Url.ToString().Trim(); string[] html = htmlFile.Split('/'); string[] nn = html[2].Split('_'); string cc = nn[0].Substring(nn[0].Length - 8); string wenjian = MerchantTmpPathTo + html[1].Replace("loans", ""); if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = wenjian + inPathTo + cc + "_" + loansInfoID + ".shtml"; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } #endregion }
public int InsertLoansInfoTab(Tz888.Model.LoansInfoTab loansinfotab, Tz888.Model.LoansInfo loansinfo, Tz888.Model.LoanscontactsTab loanscontactstab) { return(dal.InsertLoansInfoTab(loansinfotab, loansinfo, loanscontactstab)); }
public int UpdateloanscontactsTab(Tz888.Model.LoanscontactsTab loansinfo, int LoansInfoId) { return(dal.UpdateloanscontactsTab(loansinfo, LoansInfoId)); }