protected void btnStatic_Click(object sender, EventArgs e) { Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel(); string[] values = Request.Form.GetValues("cbxSelect"); if (values == null || values.Length < 1) { Tz888.Common.MessageBox.Show(this.Page, "请选择要静态化的资源!"); return; } StringBuilder sb = new StringBuilder(); foreach (string str in values) { page = page.objGetMerchantInfoByInfoID(Convert.ToInt32(str.Trim()));//根ID获取信息 if (page.AuditingStatus != 1) { sb.Append("编号:" + str.Trim() + " 所对应的状态为:" + Verify(page.AuditingStatus) + " ,生成静态化页面失败\\n"); } else { int num = page.ModifyHtmlFile(Convert.ToInt32(str.Trim())); if (num != 0) { string Idstuny = page.SelectLndus(page.Are); //根据区域查询信息 string IsVip = Mercahrstatic.SelIsVip(); //查询为重大商机的信息 int sum = page.StaticHtml(Convert.ToInt32(str.Trim()), page.Title, page.PublishT, page.AreaName, page.Content, page.IndustryCarveOutID, page.MerchantNameTotal, page.ValidateID, Idstuny, IsVip, page.Keword, page.DisplayTitles, page.Descript, page.Merchanreturns); if (sum != 1) { Tz888.Common.MessageBox.Show(this.Page, "生成静态页面失败"); } else { Tz888.Common.MessageBox.Show(this.Page, "生成静态页面成功"); } } else { Tz888.Common.MessageBox.Show(this.Page, "生成静态页面失败"); } } } if (sb.ToString() != "") { Tz888.Common.MessageBox.Show(this.Page, sb.ToString()); } }
/// <summary> ///创建招商静态页面 /// </summary> /// <param name="NewsID">编号</param> /// <param name="title">标题</param> /// <param name="publishT">时间</param> /// <param name="Content">详细内容</param> public int StaticHtml(int infoID, string title, string publishT, string AreaName, string Content, string IndustryCarveOutID, string MerchantNameTotal, string validateID, string Idstuny, string IsVip, string KeyWord, string DisplayTitle, string Descript, string pic) { string Money = ""; Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.Model.Info.MerchantSetModel model = bll.GetIntegrityModel(Convert.ToInt64(infoID)); string Type = model.MerchantInfoModel.CapitalCurrency.ToString().Trim(); if (Type == "CNY") { Type = "人民币"; } if (Type == "HKD") { Type = "港币"; } if (Type == "USD") { Type = "美元"; } if (model.MainInfoModel.MainPointCount.ToString().Trim() == "0") { Money = "该资源为免费资源"; } else { Money = model.MainInfoModel.MainPointCount.ToString().Trim() + "元"; } #region 图片属性 string Pic1 = ""; string Pic1_c = ""; string Pic1_s = ""; string Pic1_r = ""; string Pic2 = ""; string Pic2_c = ""; string Pic2_s = ""; string Pic2_r = ""; string Pic3 = ""; string Pic3_c = ""; string Pic3_s = ""; string Pic3_r = ""; string Pic4 = ""; string Pic4_c = ""; string Pic4_s = ""; string Pic4_r = ""; string Pic5 = ""; string Pic5_c = ""; string Pic5_s = ""; string Pic5_r = ""; string Pic6 = ""; string Pic6_c = ""; string Pic6_s = ""; string Pic6_r = ""; string p1 = ""; string p2 = ""; string p3 = ""; string p4 = ""; string p5 = ""; string p6 = ""; #endregion #region 图片封装 ArrayList arrListPic = new ArrayList(); ArrayList arrListDoc = new ArrayList(); if (model.InfoResourceModels != null) { foreach (Tz888.Model.Info.InfoResourceModel objModelResource in model.InfoResourceModels) { //ResourceType 0:其他文档 1:图片 2:视频 if (objModelResource.ResourceType.ToString().Trim() == "1") { string[] arTempPic = new string[2]; arTempPic[0] = objModelResource.ResourceAddr.Trim(); arTempPic[1] = objModelResource.ResourceName.Trim(); arrListPic.Add(arTempPic); } if (objModelResource.ResourceType.ToString().Trim() == "0") { string[] arTempDoc = new string[2]; arTempDoc[0] = objModelResource.ResourceAddr.Trim(); arTempDoc[1] = objModelResource.ResourceName.Trim(); arrListDoc.Add(arTempDoc); } } } if (arrListPic.Count > 0) { string[] sPicTemp = (string[])arrListPic[0]; Pic1 = sPicTemp[0]; Pic1_c = sPicTemp[1]; //Pic1_s = Common.GetMiniPic(Pic1); Pic1_s = Pic1; Pic1_r = "<li id=\"tab_tophome_1\" class=\"on\"><a href=" + MerchantPicPath.Trim() + Pic1_s.Trim() + " target=\"_blank\" onmousemove=\"startIndex=1;setTab('tophome',1,1,'out','on');\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});\"><img src=" + MerchantPicPath.Trim() + Pic1_s.Trim() + " class=\"tab_img\" alt=\"4\"/></a></li>"; p1 = "<div id=\"con_tophome_1\" ><a href=" + MerchantPicPath.Trim() + Pic1_s.Trim() + " target=\"_blank\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});\"><img src=" + MerchantPicPath.Trim() + Pic1_s.Trim() + " alt=\"3\" /></a></div>"; //Pic1_r = "<li><a href=\"" + MerchantPicPath.Trim() + Pic1_s.Trim() + "\" target=\"_blank\"><img src=\"http://www.topfo.com/V4/img/chakan.jpg\"></a></li>"; } if (arrListPic.Count > 1) { string[] sPicTemp = (string[])arrListPic[1]; Pic2 = sPicTemp[0]; Pic2_c = sPicTemp[1]; //Pic2_s = Common.GetMiniPic(Pic2); Pic2_s = Pic2; Pic2_r = "<li id=\"tab_tophome_2\" class=\"out\"><a href=" + MerchantPicPath.Trim() + Pic2_s.Trim() + " target=\"_blank\" onmousemove=\"startIndex=2;setTab('tophome',2,2,'out','on');\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});\"><img src=" + MerchantPicPath.Trim() + Pic2_s.Trim() + " class=\"tab_img\" alt=\"4\"/></a></li>"; p2 = "<div id=\"con_tophome_2\" class=\"hidecontent\" ><a href=" + MerchantPicPath.Trim() + Pic2_s.Trim() + " target=\"_blank\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});\"><img src=" + MerchantPicPath.Trim() + Pic2_s.Trim() + " alt=\"3\" /></a></div>"; } if (arrListPic.Count > 2) { string[] sPicTemp = (string[])arrListPic[2]; Pic3 = sPicTemp[0]; Pic3_c = sPicTemp[1]; //Pic3_s = Common.GetMiniPic(Pic3); Pic3_s = Pic3; Pic3_r = "<li id=\"tab_tophome_3\" class=\"out\"><a href=" + MerchantPicPath.Trim() + Pic3_s.Trim() + " target=\"_blank\" onmousemove=\"startIndex=6;setTab('tophome',3,3,'out','on');\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});\"><img src=" + MerchantPicPath.Trim() + Pic3_s.Trim() + " class=\"tab_img\" alt=\"4\"/></a></li>"; p3 = "<div id=\"con_tophome_3\" class=\"hidecontent\"><a href=" + MerchantPicPath.Trim() + Pic3_s.Trim() + " target=\"_blank\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});\"><img src=" + MerchantPicPath.Trim() + Pic3_s.Trim() + " alt=\"3\" /></a></div>"; //Pic3_r = "<li><a href=\"" + MerchantPicPath.Trim() + Pic3_s.Trim() + "\" target=\"_blank\"><img src=\"http://www.topfo.com/V4/img/chakan.jpg\"></a></li>"; } if (arrListPic.Count > 3) { string[] sPicTemp = (string[])arrListPic[3]; Pic4 = sPicTemp[0]; Pic4_c = sPicTemp[1]; //Pic4_s = Common.GetMiniPic(Pic4); Pic4_s = Pic4; Pic4_r = "<li id=\"tab_tophome_4\" class=\"out\"><a href=" + MerchantPicPath.Trim() + Pic4_s.Trim() + " target=\"_blank\" onmousemove=\"startIndex=4;setTab('tophome',4,4,'out','on');\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});\"><img src=" + MerchantPicPath.Trim() + Pic4_s.Trim() + " class=\"tab_img\" alt=\"4\"/></a></li>"; p4 = "<div id=\"con_tophome_4\" class=\"hidecontent\"><a href=" + MerchantPicPath.Trim() + Pic4_s.Trim() + " target=\"_blank\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});\"><img src=" + MerchantPicPath.Trim() + Pic4_s.Trim() + " alt=\"3\" /></a></div>"; //Pic4_r = "<li><a href=\"" + MerchantPicPath.Trim() + Pic4_s.Trim() + "\" target=\"_blank\"><img src=\"http://www.topfo.com/V4/img/chakan.jpg\"></a></li>"; } if (arrListPic.Count > 4) { string[] sPicTemp = (string[])arrListPic[4]; Pic5 = sPicTemp[0]; Pic5_c = sPicTemp[1]; //Pic5_s = Common.GetMiniPic(Pic5); Pic5_s = Pic5; Pic5_r = "<li id=\"tab_tophome_5\" class=\"out\"><a href=" + MerchantPicPath.Trim() + Pic5_s.Trim() + " target=\"_blank\" onmousemove=\"startIndex=5;setTab('tophome',5,5,'out','on');\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});\"><img src=" + MerchantPicPath.Trim() + Pic5_s.Trim() + " class=\"tab_img\" alt=\"4\"/></a></li>"; p5 = "<div id=\"con_tophome_5\" class=\"hidecontent\"><a href=" + MerchantPicPath.Trim() + Pic5_s.Trim() + " target=\"_blank\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});\"><img src=" + MerchantPicPath.Trim() + Pic5_s.Trim() + " alt=\"3\" /></a></div>"; //Pic5_r = "<li><a href=\"" + MerchantPicPath.Trim() + Pic5_s.Trim() + "\" target=\"_blank\"><img src=\"http://www.topfo.com/V4/img/chakan.jpg\"></a></li>"; } if (arrListPic.Count > 5) { string[] sPicTemp = (string[])arrListPic[5]; Pic6 = sPicTemp[0]; Pic6_c = sPicTemp[1]; //Pic6_s = Common.GetMiniPic(Pic6); Pic6_s = Pic6; Pic6_r = "<li id=\"tab_tophome_6\" class=\"out\"><a href=" + MerchantPicPath.Trim() + Pic6_s.Trim() + " target=\"_blank\" onmousemove=\"startIndex=6;setTab('tophome',6,6,'out','on');\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.SOSO_2'});\"><img src=" + MerchantPicPath.Trim() + Pic6_s.Trim() + " class=\"tab_img\" alt=\"4\"/></a></li>"; p6 = "<div id=\"con_tophome_5\" class=\"hidecontent\"><a href=" + MerchantPicPath.Trim() + Pic6_s.Trim() + " target=\"_blank\" onclick=\"javascript:pgvSendClick({hottag:'KF.SERVICE.INDEX.STUDY_1'});\"><img src=" + MerchantPicPath.Trim() + Pic6_s.Trim() + " alt=\"3\" /></a></div>"; //Pic6_r = "<li><a href=\"" + MerchantPicPath.Trim() + Pic6_s.Trim() + "\" target=\"_blank\"><img src=\"http://www.topfo.com/V4/img/chakan.jpg\"></a></li>"; } #endregion if (pic == "0") { pic = "面谈"; } else { pic = pic + "%"; } try { string TempFileName = Merchant.ToString(); string Tem = Compage.Reader(TempFileName); //读取模板内容 #region 替换模版 string TempSoure = Tem; TempSoure = TempSoure.Replace("$infoID$", Convert.ToString(infoID)); TempSoure = TempSoure.Replace("$title$", title); //标题 TempSoure = TempSoure.Replace("$publishT$", publishT); //时间 TempSoure = TempSoure.Replace("$AreaName$", AreaName); //区域 TempSoure = TempSoure.Replace("$Content$", Content); //内容 TempSoure = TempSoure.Replace("$IndustryCarveOutID$", IndustryCarveOutID); //行业 TempSoure = TempSoure.Replace("$MerchantNameTotal$", MerchantNameTotal + "万元" + Type); //总投资金额 TempSoure = TempSoure.Replace("$validateID$", validateID); //有效期 TempSoure = TempSoure.Replace("$XianXi$", Idstuny); //详细信息 TempSoure = TempSoure.Replace("$Merchant$", IsVip); //设置重大投资 TempSoure = TempSoure.Replace("$KeyWord$", KeyWord); //网页关键字 TempSoure = TempSoure.Replace("$Descript$", Descript); //网页描述 TempSoure = TempSoure.Replace("$DisplayTitle$", DisplayTitle); //网页标题 TempSoure = TempSoure.Replace("$pic$", pic); //关键字 TempSoure = TempSoure.Replace("#@TmpFeild-Pic1#", Pic1_r); TempSoure = TempSoure.Replace("#@TmpFeild-Pic2#", Pic2_r); TempSoure = TempSoure.Replace("#@TmpFeild-Pic3#", Pic3_r); TempSoure = TempSoure.Replace("#@TmpFeild-Pic4#", Pic4_r); TempSoure = TempSoure.Replace("#@TmpFeild-Pic5#", Pic5_r); TempSoure = TempSoure.Replace("#@TmpFeild-Pic6#", Pic6_r); TempSoure = TempSoure.Replace("#@p1@#", p1); TempSoure = TempSoure.Replace("#@p2@#", p2); TempSoure = TempSoure.Replace("#@p3@#", p3); TempSoure = TempSoure.Replace("#@p4@#", p4); TempSoure = TempSoure.Replace("#@p5@#", p5); TempSoure = TempSoure.Replace("#@p6@#", p6); TempSoure = TempSoure.Replace("$Money$", Money); if (arrListPic.Count == 0) { string tupian = "display:none"; TempSoure = TempSoure.Replace("$tupian$", tupian); } else { string tupian = "display:block"; TempSoure = TempSoure.Replace("$tupian$", tupian); } #endregion #region string inPathTo = "/Merchant"; string sql1 = "select a.HtmlFile from MainInfoTab as a inner join MerchantInfoTab as b on a.InfoID=b.InfoID where a.InfoID=" + infoID + ""; string htmlFile = Tz888.DBUtility.DbHelperSQL.GetSingle(sql1).ToString(); string[] html = htmlFile.Split('/'); string[] nn = html[2].Split('_'); string cc = nn[0].Substring(nn[0].Length - 8); string wenjian = MerchantTmpPathTo + html[1].Replace("Merchant", ""); if (Directory.Exists(wenjian) == false) { Directory.CreateDirectory(wenjian); } string htmlpaths = wenjian + inPathTo + cc + "_" + infoID + ".shtml"; Compage.Writer(htmlpaths, TempSoure); return(1); } catch (Exception e) { return(0); } #endregion }
/// <summary> /// 通过InfoID获取一个Merchant的信息实体 /// </summary> /// <returns></returns> public PageStatic objGetMerchantInfoByInfoID(long InfoID) { PageStatic page = new PageStatic(); Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.Model.Info.MerchantSetModel model = bll.GetIntegrityModel(Convert.ToInt64(InfoID)); page.Title = model.MainInfoModel.Title.ToString().Trim(); page.PublishT = model.MainInfoModel.publishT.ToShortDateString(); page.Hit = Convert.ToString(model.MainInfoModel.Hit); page.Content = model.MerchantInfoModel.ZoneAbout; page._auditingStatus = Convert.ToInt32(model.MainInfoModel.AuditingStatus); page.AreaName = ""; if (model.MerchantInfoModel != null) { if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountryName)) { page.AreaName = model.MerchantInfoModel.CountryName.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.ProvinceName)) { page.AreaName += " " + model.MerchantInfoModel.ProvinceName.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CityName)) { page.AreaName += " " + model.MerchantInfoModel.CityName.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountyName)) { page.AreaName += " " + model.MerchantInfoModel.CountyName.Trim(); } } //所属于行业 page.IndustryCarveOutID = " "; page.Are = model.MerchantInfoModel.ProvinceID.Trim(); foreach (string sTempIndustry in model.MerchantInfoModel.IndustryBName) { page.IndustryCarveOutID = page.IndustryCarveOutID + sTempIndustry.Trim() + " "; } page.MerchantNameTotal = model.MerchantInfoModel.CapitalTotal.ToString().Trim();//总金额 if (model.MainInfoModel.ValidateTerm.ToString().Trim() != null) { string ValidateTerm = ""; switch (model.MainInfoModel.ValidateTerm.ToString().Trim()) { case "3": ValidateTerm = "3个月"; break; case "6": ValidateTerm = "6个月"; break; case "36": ValidateTerm = "3年"; break; case "60": ValidateTerm = "5年"; break; case "12": ValidateTerm = "1年"; break; case "14": ValidateTerm = "2年"; break; case "24": ValidateTerm = "2年"; break; } page.ValidateID = ValidateTerm; } else { page.ValidateID = "暂无"; } page.Keword = model.MainInfoModel.KeyWord; page.Descript = model.MainInfoModel.Descript; page.DisplayTitles = model.MainInfoModel.DisplayTitle; page.merchanreturns = Convert.ToString(model.MerchantInfoModel.Merchanreturns); return(page); }
//public string InfoContactByID(string InfoID, string LoginName) public string GetContactDetail(string InfoID) { string LoginName = ""; #region 资源是否购买的提示信息 string WhetherCharges_button = ""; //按钮提示 string WhetherCharges_Clew = ""; //提示信息 int FixPriceID = 0; string infoTypeName = ""; decimal MainPointCount = 0; string userState = "Charge"; // Charge购买 / Login登陆 / View查看 string payDomain = System.Configuration.ConfigurationManager.AppSettings["payDomain"]; string buyUrl = payDomain + "/order_item.aspx?InfoID=" + InfoID; //资源购买的路径 Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); DataTable dt = dal.GetList("MainInfoTab", "InfoID,FixPriceID,MainPointCount,InfoType", "InfoID", 1, 1, 0, 1, "InfoID=" + Convert.ToInt64(InfoID)); if (dt != null && dt.Rows.Count > 0) { FixPriceID = Convert.ToInt32(dt.Rows[0]["FixPriceID"].ToString().Trim()); MainPointCount = Convert.ToDecimal(dt.Rows[0]["MainPointCount"].ToString().Trim()); infoTypeName = dt.Rows[0]["InfoType"].ToString().Trim(); } //if (User.Identity.Name != null && LoginName.Trim() == User.Identity.Name.Trim())//已登陆 //{ if (MainPointCount > 0 && FixPriceID > 1) //是否免费信息 { bool bIsBuy = false; //这是一条收费信息 Tz888.BLL.Info.CapitalInfoBLL ciBll = new Tz888.BLL.Info.CapitalInfoBLL(); bIsBuy = ciBll.bIsBuyInfoOfUser(LoginName, InfoID); if (bIsBuy) { userState = "View"; } else { userState = "Charge"; } } else { userState = "View"; } //} switch (userState) { case "Login": //提示登陆 //WhetherCharges_button = "<a href=\"http://member.topfo.com\"><img src=\"/CommonV3/img/res3_btn14.gif\" alt=\"请先登陆\"></a>"; //WhetherCharges_Clew = "<span class=\"tit f_tit3\">以下为该资源的项目核心资料,你需要登陆才能查看!</span><span class=\"btn\">" + // "<a href=\"http://member.topfo.com\"><img src=\"/CommonV3/img/res3_btn14.gif\" alt=\"点击登陆\" /></a></span>" + // "<div class=\"clear\"></div>"; //break; case "View": //提示查看 WhetherCharges_button = "<a href=\"#88\" onclick=\"javascript:GetContactDetail(" + InfoID + ");\" ><img src=\"/CommonV3/img/res3_btn13.gif\" alt=\"请点击查看\"></a>"; WhetherCharges_Clew = "<span class=\"tit f_tit3\">以下为项目核心资料,你需要购买才能查看!</span><span class=\"btn\">" + "<a href=\"#88\" onclick=\"javascript:GetContactDetail(" + InfoID + ");\"><img src=\"/CommonV3/img/res3_btn13.gif\" alt=\"点击查看\" /></a></span>" + "<div class=\"clear\"></div>"; break; case "Charge": //提示购买 WhetherCharges_button = "<a href=\"" + buyUrl + "\"><img src=\"/CommonV3/img/res3_btn7.gif\" alt=\"请点击购买\"></a>"; WhetherCharges_Clew = "<span class=\"tit f_tit3\">以下为项目核心资料,你需要购买才能查看!</span><span class=\"btn\">" + "<a href=\"" + buyUrl + "\"><img src=\"/CommonV3/img/res3_btn7.gif\" alt=\"点击购买\" /></a></span>" + "<div class=\"clear\"></div>"; break; } #endregion StringBuilder sbContact = new StringBuilder(); string cacheName = "Cache_Info_" + InfoID; if (userState.Trim() == "View") { if (HttpContext.Current.Cache[cacheName] != null && HttpContext.Current.Cache[cacheName].ToString() != "") { sbContact.Append(HttpContext.Current.Cache[cacheName].ToString()); } else { Tz888.Model.Info.InfoContactModel model = new Tz888.Model.Info.InfoContactModel(); Tz888.BLL.Info.InfoContact dal_IC = new Tz888.BLL.Info.InfoContact(); model = dal_IC.GetModel(Convert.ToInt64(InfoID)); sbContact.Append("<a name='#88' id='##88'> </a>"); sbContact.Append("项目建设单位: " + model.OrganizationName.Trim() + "<br />"); sbContact.Append("联系人: " + model.Name.Trim() + "<br />"); sbContact.Append("职位: " + model.Career.Trim() + "<br />"); sbContact.Append("固定电话: " + model.TelStateCode + "-" + model.TelNum.Trim() + "<br />"); sbContact.Append("手机: " + model.Mobile.Trim() + "<br />"); sbContact.Append("电子邮箱: " + model.Email + "<br />"); sbContact.Append("项目单位详细地址: " + model.Address + "<br />"); sbContact.Append("项目单位网址: " + model.WebSite); sbContact.Append("|"); string fujianStr = ""; //7,附件列表 fujianStr = getInfoResourceById(Convert.ToInt64(InfoID)); sbContact.Append(fujianStr.Trim()); sbContact.Append("|"); switch (infoTypeName.ToLower()) { case "merchant": Tz888.IDAL.Info.IMarchantInfo dal1 = Tz888.DALFactory.DataAccess.CreateInfo_MarchantInfo(); Tz888.Model.Info.MerchantSetModel TheInfo1 = new Tz888.Model.Info.MerchantSetModel(); TheInfo1 = dal1.GetIntegrityModel(Convert.ToInt64(InfoID)); sbContact.Append(TheInfo1.MerchantInfoModel.ProjectStatus); //项目现状及规划 sbContact.Append("|"); sbContact.Append(TheInfo1.MerchantInfoModel.marketAbout); //项目优势及市场分析 sbContact.Append("|"); sbContact.Append(TheInfo1.MerchantInfoModel.Benefit); //经济效益分析 break; case "project": Tz888.IDAL.Info.IProjectInfo dal2 = Tz888.DALFactory.DataAccess.CreateInfo_ProjectInfo(); Tz888.Model.Info.ProjectSetModel TheInfo2 = dal2.GetIntegrityModel(Convert.ToInt64(InfoID)); sbContact.Append(TheInfo2.ProjectInfoModel.nDwlyysy.ToString()); //单位年营业收入 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.nDwljly.ToString()); //单位年净利润 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.nDwzzc.ToString()); //单位总资产 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.nDwzfz.ToString()); //单位总负债 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.ProjectAbout.ToString()); //产品概述 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.marketAbout.ToString()); //市场前景 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.competitioAbout.ToString()); //竞争分析 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.BussinessModeAbout.ToString()); //商业模式 sbContact.Append("|"); sbContact.Append(TheInfo2.ProjectInfoModel.ManageTeamAbout.ToString()); //管理团队 break; case "capital": Tz888.IDAL.Info.IInfoContact dal3 = Tz888.DALFactory.DataAccess.CreateInfo_InfoContact(); Tz888.Model.Info.InfoContactModel TheInfo3 = dal3.GetModel(Convert.ToInt64(InfoID)); sbContact.Append(TheInfo3.OrgIntro.ToString()); //投资方简介 break; default: break; } HttpContext.Current.Cache[cacheName] = sbContact.ToString(); } } return(sbContact.ToString().Trim()); }
public bool Update(Tz888.Model.Info.MerchantSetModel model) { SqlParameter[] parameters = { //主表信息 new SqlParameter("@InfoID", SqlDbType.BigInt, 8), new SqlParameter("@Title", SqlDbType.VarChar, 100), new SqlParameter("@publishT", SqlDbType.DateTime), new SqlParameter("@LoginName", SqlDbType.Char, 10), //4 new SqlParameter("@KeyWord", SqlDbType.VarChar, 50), new SqlParameter("@Descript", SqlDbType.VarChar, 100), new SqlParameter("@DisplayTitle", SqlDbType.VarChar, 50), new SqlParameter("@FrontDisplayTime", SqlDbType.SmallDateTime), new SqlParameter("@ValidateStartTime", SqlDbType.SmallDateTime), new SqlParameter("@ValidateTerm", SqlDbType.Int, 4), new SqlParameter("@TemplateID", SqlDbType.Char, 10), new SqlParameter("@HtmlFile", SqlDbType.VarChar, 100), //8 //招商信息 new SqlParameter("@MerchantTypeID", SqlDbType.Char, 10), new SqlParameter("@IndustryClassList", SqlDbType.VarChar, 150), new SqlParameter("@CapitalCurrency", SqlDbType.Char, 10), new SqlParameter("@CapitalTotal", SqlDbType.Float, 8), new SqlParameter("@MerchantCurrency", SqlDbType.Char, 10), new SqlParameter("@MerchantTotal", SqlDbType.Char, 10), new SqlParameter("@CooperationDemandType", SqlDbType.VarChar, 30), new SqlParameter("@CountryCode", SqlDbType.Char, 10), new SqlParameter("@ProvinceID", SqlDbType.Char, 10), new SqlParameter("@CityID", SqlDbType.Char, 10), new SqlParameter("@CountyID", SqlDbType.Char, 10), new SqlParameter("@ZoneAbout", SqlDbType.VarChar, -1), new SqlParameter("@ZoneAboutBrief", SqlDbType.VarChar, -1), new SqlParameter("@ReceiveOrganization", SqlDbType.VarChar, 100), new SqlParameter("@MerchantOrganization", SqlDbType.Int, 4), //15 //联系信息 new SqlParameter("@Organization", SqlDbType.VarChar, 100), new SqlParameter("@LinkMan", SqlDbType.VarChar, 20), new SqlParameter("@TelCountryCode", SqlDbType.Char, 6), new SqlParameter("@TelStateCode", SqlDbType.Char, 8), new SqlParameter("@TelNum", SqlDbType.VarChar, 100), new SqlParameter("@FaxCountryCode", SqlDbType.Char, 6), new SqlParameter("@FaxStateCode", SqlDbType.Char, 8), new SqlParameter("@FaxNum", SqlDbType.VarChar, 100), new SqlParameter("@Mobile", SqlDbType.VarChar, 30), new SqlParameter("@Address", SqlDbType.VarChar, 100), new SqlParameter("@PostCode", SqlDbType.VarChar, 10), new SqlParameter("@Email", SqlDbType.VarChar, 50), new SqlParameter("@WebSite", SqlDbType.VarChar, 200), //13 //短信息表 new SqlParameter("@ShortInfoControlID", SqlDbType.Char, 20), new SqlParameter("@ShortTitle", SqlDbType.VarChar, 100), new SqlParameter("@ShortContent", SqlDbType.VarChar, 100), new SqlParameter("@strRemark", SqlDbType.VarChar, 50), //2010-06-11新增的 new SqlParameter("@PriceByUser", SqlDbType.Int, 4), //这里是2010-06-11 添加政府招商的参数 有5个参数 new SqlParameter("@EconomicIndicators", SqlDbType.NVarChar, 100), new SqlParameter("@InvestmentEnvironment", SqlDbType.NVarChar, 100), new SqlParameter("@ProjectStatus", SqlDbType.NVarChar, 100), new SqlParameter("@Market", SqlDbType.NVarChar, 100), new SqlParameter("@Benefit", SqlDbType.NVarChar, 100), //10 new SqlParameter("@InformationIntegrity", SqlDbType.Int, 8), new SqlParameter("@Position", SqlDbType.VarChar, 50), new SqlParameter("@Merchanreturns", SqlDbType.Int, 8), }; parameters[0].Value = model.MainInfoModel.InfoID; parameters[1].Value = model.MainInfoModel.Title; parameters[2].Value = model.MainInfoModel.publishT; parameters[3].Value = model.MainInfoModel.LoginName; parameters[4].Value = model.MainInfoModel.KeyWord; parameters[5].Value = model.MainInfoModel.Descript; parameters[6].Value = model.MainInfoModel.DisplayTitle; parameters[7].Value = model.MainInfoModel.FrontDisplayTime; parameters[8].Value = model.MainInfoModel.ValidateStartTime; parameters[9].Value = model.MainInfoModel.ValidateTerm; parameters[10].Value = model.MainInfoModel.TemplateID; parameters[11].Value = model.MainInfoModel.HtmlFile; parameters[12].Value = model.MerchantInfoModel.MerchantTypeID; parameters[13].Value = model.MerchantInfoModel.IndustryClassList; parameters[14].Value = model.MerchantInfoModel.CapitalCurrency; parameters[15].Value = model.MerchantInfoModel.CapitalTotal; parameters[16].Value = model.MerchantInfoModel.MerchantCurrency; parameters[17].Value = model.MerchantInfoModel.MerchantTotal; parameters[18].Value = model.MerchantInfoModel.CooperationDemandType; parameters[19].Value = model.MerchantInfoModel.CountryCode; parameters[20].Value = model.MerchantInfoModel.ProvinceID; parameters[21].Value = model.MerchantInfoModel.CityID; parameters[22].Value = model.MerchantInfoModel.CountyID; parameters[23].Value = model.MerchantInfoModel.ZoneAbout; parameters[24].Value = model.MerchantInfoModel.ZoneAboutBrief; parameters[25].Value = model.MerchantInfoModel.ReceiveOrganization; parameters[26].Value = model.MerchantInfoModel.MerchantOrganization; parameters[27].Value = model.InfoContactModel.OrganizationName; parameters[28].Value = model.InfoContactModel.Name; parameters[29].Value = model.InfoContactModel.TelCountryCode; parameters[30].Value = model.InfoContactModel.TelStateCode; parameters[31].Value = model.InfoContactModel.TelNum; parameters[32].Value = model.InfoContactModel.FaxCountryCode; parameters[33].Value = model.InfoContactModel.FaxStateCode; parameters[34].Value = model.InfoContactModel.FaxNum; parameters[35].Value = model.InfoContactModel.Mobile; parameters[36].Value = model.InfoContactModel.Address; parameters[37].Value = model.InfoContactModel.PostCode; parameters[38].Value = model.InfoContactModel.Email; parameters[39].Value = model.InfoContactModel.WebSite; parameters[40].Value = model.ShortInfoModel.ShortInfoControlID; parameters[41].Value = model.ShortInfoModel.ShortTitle; parameters[42].Value = model.ShortInfoModel.ShortContent; parameters[43].Value = model.ShortInfoModel.Remark; //2010-06-11以下是根据需求添加的 parameters[44].Value = 1; parameters[45].Value = model.MerchantInfoModel.EconomicIndicators; parameters[46].Value = model.MerchantInfoModel.InvestmentEnvironment; parameters[47].Value = model.MerchantInfoModel.ProjectStatus; parameters[48].Value = model.MerchantInfoModel.Market; parameters[49].Value = model.MerchantInfoModel.Benefit; //添加信息完整度 parameters[50].Value = model.MerchantInfoModel.InformationIntegrity; //2010-06-11以下是招商联系人职位 parameters[51].Value = model.InfoContactModel.Position; parameters[52].Value = model.MerchantInfoModel.Merchanreturns; //End bool ReturnValue = false; long infoID = model.MainInfoModel.InfoID; using (SqlConnection sqlConn = DbHelperSQL.GetSqlConnection()) { sqlConn.Open(); SqlTransaction sqlTran = sqlConn.BeginTransaction(); try { int rowsAffected; //修改招商信息 DbHelperSQL.RunProcedure(sqlConn, sqlTran, "MerchantInfoTab_Update", parameters, out rowsAffected); //为招商信息更新联系人信息 Tz888.SQLServerDAL.Info.InfoContactManDAL obj2 = new InfoContactManDAL(); obj2.DeleteByInfoID(sqlConn, sqlTran, infoID); //if (model.InfoContactManModels != null) //{ // foreach (Tz888.Model.Info.InfoContactManModel tmpModel in model.InfoContactManModels) // { // tmpModel.InfoID = infoID; // obj2.InsertContactMan(sqlConn, sqlTran, tmpModel); // } //} //为招商信息添加多个资源 Tz888.SQLServerDAL.Info.InfoResourceDAL obj3 = new InfoResourceDAL(); obj3.DeleteByInfoID(sqlConn, sqlTran, infoID); if (model.InfoResourceModels != null) { foreach (Tz888.Model.Info.InfoResourceModel tmpModel in model.InfoResourceModels) { tmpModel.InfoID = infoID; obj3.InsertInfoResource(sqlConn, sqlTran, tmpModel); } } sqlTran.Commit(); ReturnValue = true; } catch { sqlTran.Rollback(); ReturnValue = false; } finally { sqlConn.Close(); } } return(ReturnValue); }
protected void btnSend_Click(object sender, EventArgs e) { Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel(); model.InfoContactModel = this.MerchantInfoAddressInfo1.InfoContact; model.InfoContactManModels = this.MerchantInfoAddressInfo1.InfoContactMans; #region 招商信息实体 model.MerchantInfoModel.MerchantTypeID = this.rblMerchantType.SelectedValue; model.MerchantInfoModel.CountryCode = this.ZoneSelectControl1.CountryID; model.MerchantInfoModel.ProvinceID = this.ZoneSelectControl1.ProvinceID; model.MerchantInfoModel.CityID = this.ZoneSelectControl1.CityID; model.MerchantInfoModel.CountyID = this.ZoneSelectControl1.CountyID; model.MerchantInfoModel.IndustryClassList = this.SelectIndustryControl1.IndustryString; model.MerchantInfoModel.CapitalCurrency = this.ddlCapitalCurrency.SelectedValue; try { model.MerchantInfoModel.CapitalTotal = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim()); } catch { model.MerchantInfoModel.CapitalTotal = 0; } model.MerchantInfoModel.MerchantCurrency = this.ddlMerchantCurrency.SelectedValue; model.MerchantInfoModel.MerchantTotal = this.ddlMerchantTotal.SelectedValue; model.MerchantInfoModel.ZoneAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtZoneAbout.Value.ToString()); model.MerchantInfoModel.ZoneAboutBrief = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtZoneAboutBrf.Value.Trim()); try { model.MerchantInfoModel.ReceiveOrganization = this.MerchantInfoAddressInfo1.Undertaker.Trim(); } catch {} model.MerchantInfoModel.CooperationDemandType = ""; for (int i = 0; cblCooperationDemandType.Items.Count > i; i++) { if (cblCooperationDemandType.Items[i].Selected) { model.MerchantInfoModel.CooperationDemandType += cblCooperationDemandType.Items[i].Value + ","; } } #endregion model.MainInfoModel.InfoID = Convert.ToInt64(this.ViewState["InfoID"]); if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim())) { model.MainInfoModel.Title = this.txtMerchantTopic.Text.Trim(); } model.MainInfoModel.publishT = Convert.ToDateTime(this.ViewState["PublishT"]); model.MainInfoModel.LoginName = ViewState["UserName"].ToString(); model.MainInfoModel.ApproveTime = DateTime.Now; model.MainInfoModel.ApproveBy = Session["loginName"].ToString(); string keyword = ""; if (!string.IsNullOrEmpty(this.txtKeyword1.Text.Trim())) { keyword += this.txtKeyword1.Text.Trim() + ","; } if (!string.IsNullOrEmpty(this.txtKeyword2.Text.Trim())) { keyword += this.txtKeyword2.Text.Trim() + ","; } if (!string.IsNullOrEmpty(this.txtKeyword3.Text.Trim())) { keyword += this.txtKeyword3.Text.Trim() + ","; } model.MainInfoModel.KeyWord = keyword; model.MainInfoModel.Descript = this.txtDescript.Text.Trim(); model.MainInfoModel.DisplayTitle = this.txtDisplayTitle.Text.Trim(); model.MainInfoModel.FrontDisplayTime = Convert.ToDateTime(ViewState["FrontDisplayTime"]); model.MainInfoModel.ValidateStartTime = Convert.ToDateTime(ViewState["ValidateStartTime"]); model.MainInfoModel.ValidateTerm = Convert.ToInt32(this.ddlValiditeTerm.SelectedValue.Trim()); model.MainInfoModel.TemplateID = "001"; model.MainInfoModel.HtmlFile = ViewState["HtmlFile"].ToString(); model.ShortInfoModel.ShortInfoControlID = Convert.ToString(ViewState["ShortInfoControlID"]); model.ShortInfoModel.ShortTitle = this.txtShortTitle.Text.Trim(); model.ShortInfoModel.ShortContent = this.txtShortContent.Text.Trim(); model.ShortInfoModel.Remark = ""; byte AuditingOrigin = Convert.ToByte(ViewState["AuditingStatus"]); byte AuditingStatus = 0; if (this.rdAudit.Checked) { AuditingStatus = 0; } if (this.rdPass.Checked) { AuditingStatus = 1; } if (this.rdNopass.Checked) { AuditingStatus = 2; } model.MainInfoModel.AuditingStatus = AuditingStatus; List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, ImageUploadControl1.InfoList); if (infoResourceModels != null) { model.InfoResourceModels.AddRange(infoResourceModels); } string actionMsg = ""; string InfoCode = ViewState["InfoCode"].ToString(); string strHtmlFile = ViewState["HtmlFile"].ToString(); bool IsSuccess; long InfoID = Convert.ToInt64(ViewState["InfoID"]); bool HasDone = false; bool AllHasDone; Tz888.BLL.Info.MarchantInfoBLL merchantBll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL(); AllHasDone = merchantBll.Update(model); #region 定价 HasDone = mainBll.HasFixPrice(InfoID, "1", Session["loginName"].ToString()); if (!HasDone) { AllHasDone = false;//修改失败 } #endregion #region 审核 string AuditingRemark = ""; Tz888.Model.Info.InfoAuditModel auditModel = new Tz888.Model.Info.InfoAuditModel(); switch (AuditingOrigin) { case 0: switch (AuditingStatus) { case 0: break; case 1: AuditingRemark = "未审核->审核通过"; #region 写入操作记录 //需要生成文件 strHtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName(theInfoType, InfoCode, InfoID); //更改审核状态,同时记录操作 HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName, AuditingRemark, strHtmlFile, "", 0, 0); if (!HasDone) { AllHasDone = false; } #endregion #region 写入信息审核记录 auditModel = new Tz888.Model.Info.InfoAuditModel(); auditModel.InfoID = model.MainInfoModel.InfoID; auditModel.InfoTypeID = theInfoType; auditModel.LoginName = model.MainInfoModel.LoginName; auditModel.PostDate = System.DateTime.Now; auditModel.Title = model.MainInfoModel.Title; auditModel.FeedbackStatus = 0; //0,可修改|1,即将删除 auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingDate = System.DateTime.Now; auditModel.AuditingBy = Session["LoginName"].ToString(); auditModel.AuditingRemark = AuditingRemark; auditModel.Memo = ""; HasDone = mainBll.InfoAuditNote(auditModel); #endregion #region 生成静态化文件 Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic(); IsSuccess = staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg); //if (!IsSuccess) // AllHasDone = false; #endregion break; case 2: AuditingRemark = "未审核->审核未通过"; #region 写入操作记录 HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName, AuditingRemark, "", "", 0, 0); if (!HasDone) { AllHasDone = false; } #endregion #region 写入信息审核记录 auditModel = new Tz888.Model.Info.InfoAuditModel(); auditModel.InfoID = model.MainInfoModel.InfoID; auditModel.InfoTypeID = theInfoType; auditModel.LoginName = model.MainInfoModel.LoginName; auditModel.PostDate = System.DateTime.Now; auditModel.Title = model.MainInfoModel.Title; auditModel.FeedbackStatus = Convert.ToInt32(this.rblFeedbackStatus.SelectedValue.Trim()); auditModel.FeedBackNote = this.tbAuditingRemark.Text.Trim(); auditModel.AuditStatus = AuditingStatus; auditModel.AuditingDate = System.DateTime.Now; auditModel.AuditingBy = Session["LoginName"].ToString(); auditModel.AuditingRemark = AuditingRemark; auditModel.Memo = ""; HasDone = mainBll.InfoAuditNote(auditModel); if (!HasDone) { AllHasDone = false; } #endregion break; default: break; } break; case 1: switch (AuditingStatus) { case 0: AuditingRemark = "审核通过->未审核"; #region 写入操作记录 //更改审核状态,同时记录操作 HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName, AuditingRemark, "", "", 0, 0); if (!HasDone) { AllHasDone = false; } #endregion #region 写入信息审核记录 auditModel = new Tz888.Model.Info.InfoAuditModel(); auditModel.InfoID = model.MainInfoModel.InfoID; auditModel.InfoTypeID = theInfoType; auditModel.LoginName = model.MainInfoModel.LoginName; auditModel.PostDate = System.DateTime.Now; auditModel.Title = model.MainInfoModel.Title; auditModel.FeedbackStatus = 0; auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingDate = System.DateTime.Now; auditModel.AuditingBy = Session["LoginName"].ToString(); auditModel.AuditingRemark = AuditingRemark; auditModel.Memo = ""; HasDone = mainBll.InfoAuditNote(auditModel); if (!HasDone) { AllHasDone = false; } #endregion #region 除已生成的文件 //删除静态化文件 #endregion break; case 1: #region 生成静态化文件 Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic(); IsSuccess = staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg); //if (!IsSuccess) // AllHasDone = false; #endregion break; case 2: AuditingRemark = "审核通过->审核未通过"; #region 写入操作记录 //更改审核状态,同时记录操作 HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName, AuditingRemark, "", "", 0, 0); if (!HasDone) { AllHasDone = false; } #endregion #region 写入信息审核记录 auditModel = new Tz888.Model.Info.InfoAuditModel(); auditModel.InfoID = model.MainInfoModel.InfoID; auditModel.InfoTypeID = theInfoType; auditModel.LoginName = model.MainInfoModel.LoginName; auditModel.PostDate = System.DateTime.Now; auditModel.Title = model.MainInfoModel.Title; auditModel.FeedbackStatus = Convert.ToInt32(this.rblFeedbackStatus.SelectedValue.Trim()); auditModel.FeedBackNote = this.tbAuditingRemark.Text.Trim(); auditModel.AuditStatus = AuditingStatus; auditModel.AuditingDate = System.DateTime.Now; auditModel.AuditingBy = Session["LoginName"].ToString(); auditModel.AuditingRemark = AuditingRemark; auditModel.Memo = ""; HasDone = mainBll.InfoAuditNote(auditModel); if (!HasDone) { AllHasDone = false; } #endregion #region 除已生成的文件 //删除静态化文件 #endregion break; default: break; } break; case 2: switch (AuditingOrigin) { case 0: AuditingRemark = "审核未通过->未审核"; #region 写入操作记录 HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName, AuditingRemark, "", "", 0, 0); if (!HasDone) { AllHasDone = false; } #endregion #region 写入信息审核记录 auditModel = new Tz888.Model.Info.InfoAuditModel(); auditModel.InfoID = model.MainInfoModel.InfoID; auditModel.InfoTypeID = theInfoType; auditModel.LoginName = model.MainInfoModel.LoginName; auditModel.PostDate = System.DateTime.Now; auditModel.Title = model.MainInfoModel.Title; auditModel.FeedbackStatus = 0; auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingDate = System.DateTime.Now; auditModel.AuditingBy = Session["LoginName"].ToString(); auditModel.AuditingRemark = AuditingRemark; auditModel.Memo = ""; HasDone = mainBll.InfoAuditNote(auditModel); if (!HasDone) { AllHasDone = false; } #endregion break; case 1: AuditingRemark = "审核未通过->审核通过"; #region 写入操作记录 strHtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName(theInfoType, InfoCode, InfoID); HasDone = mainBll.HasAuditing(InfoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName, AuditingRemark, strHtmlFile, "", 0, 0); if (!HasDone) { AllHasDone = false; } #endregion #region 写入信息审核记录 auditModel = new Tz888.Model.Info.InfoAuditModel(); auditModel.InfoID = model.MainInfoModel.InfoID; auditModel.InfoTypeID = theInfoType; auditModel.LoginName = model.MainInfoModel.LoginName; auditModel.PostDate = System.DateTime.Now; auditModel.Title = model.MainInfoModel.Title; auditModel.FeedbackStatus = 0; auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingDate = System.DateTime.Now; auditModel.AuditingBy = Session["LoginName"].ToString(); auditModel.AuditingRemark = AuditingRemark; auditModel.Memo = ""; HasDone = mainBll.InfoAuditNote(auditModel); if (!HasDone) { AllHasDone = false; } #endregion #region 生成静态化文件 Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic(); IsSuccess = staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg); //if (!IsSuccess) // AllHasDone = false; #endregion break; case 2: break; default: break; } break; default: break; } #endregion #region 邮件通知 #endregion if (AllHasDone) { string theUrlReferrer = ViewState["strPrePage"].ToString(); Response.Redirect("ModifyStatus.aspx?InfoID=" + InfoID.ToString() + "&Type=" + theInfoType + "&PrePage=" + theUrlReferrer + "&msg=" + actionMsg); } else { Response.Write("<script>alert('变更失败!');history.back(-1);</script>"); } }
private void LoadInfo(long InfoID) { Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.Model.Info.MerchantSetModel model = bll.GetIntegrityModel(InfoID); try { this.rblMerchantType.SelectedValue = model.MerchantInfoModel.MerchantTypeID.Trim(); } catch { } this.txtMerchantTopic.Text = model.MainInfoModel.Title; if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountryCode)) { this.ZoneSelectControl1.CountryID = model.MerchantInfoModel.CountryCode.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.ProvinceID)) { this.ZoneSelectControl1.ProvinceID = model.MerchantInfoModel.ProvinceID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CityID)) { this.ZoneSelectControl1.CityID = model.MerchantInfoModel.CityID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountyID)) { this.ZoneSelectControl1.CountyID = model.MerchantInfoModel.CountyID.Trim(); } this.SelectIndustryControl1.IndustryString = model.MerchantInfoModel.IndustryClassList.Trim(); string CooperationDemandType = model.MerchantInfoModel.CooperationDemandType.Trim(); string CooperationDemandTypeItems; for (int i = 0; i < cblCooperationDemandType.Items.Count; i++) { CooperationDemandTypeItems = cblCooperationDemandType.Items[i].Value; //CooperationDemandTypeItems += ","; if (CooperationDemandType.IndexOf(CooperationDemandTypeItems) != -1) { cblCooperationDemandType.Items[i].Selected = true; } } this.ddlCapitalCurrency.SelectedValue = model.MerchantInfoModel.CapitalCurrency; decimal CapitalTotal = Convert.ToDecimal(model.MerchantInfoModel.CapitalTotal); if (CapitalTotal > 0) { this.txtCapitalTotal.Text = CapitalTotal.ToString(); } this.ddlMerchantCurrency.SelectedValue = model.MerchantInfoModel.MerchantCurrency; this.ddlMerchantTotal.SelectedValue = model.MerchantInfoModel.MerchantTotal; this.txtZoneAbout.Value = Tz888.Common.Utility.PageValidate.HtmlToTxt(model.MerchantInfoModel.ZoneAbout.Trim()); this.txtZoneAboutBrf.Value = Tz888.Common.Utility.PageValidate.HtmlToTxt(model.MerchantInfoModel.ZoneAboutBrief.Trim()); if (!string.IsNullOrEmpty(model.MainInfoModel.KeyWord.Trim())) { string[] keys = model.MainInfoModel.KeyWord.Trim().Split(','); for (int i = 0; i < keys.Length; i++) { string key = keys[i].ToString().Trim(); switch (i) { case 0: this.txtKeyword1.Text = key; break; case 1: this.txtKeyword2.Text = key; break; case 2: this.txtKeyword3.Text = key; break; default: break; } } } this.ddlValiditeTerm.SelectedValue = model.MainInfoModel.ValidateTerm.ToString(); this.ImageUploadControl1.InfoList = model.InfoResourceModels; this.MerchantInfoAddressInfo1.InfoContact = model.InfoContactModel; this.MerchantInfoAddressInfo1.InfoContactMans = model.InfoContactManModels; this.MerchantInfoAddressInfo1.Undertaker = model.MerchantInfoModel.ReceiveOrganization.Trim(); this.txtDescript.Text = model.MainInfoModel.Descript; this.txtDisplayTitle.Text = model.MainInfoModel.DisplayTitle; this.txtShortTitle.Text = model.ShortInfoModel.ShortTitle; this.txtShortContent.Text = model.ShortInfoModel.ShortContent; ViewState["ShortInfoControlID"] = model.ShortInfoModel.ShortInfoControlID; this.tbHits.Text = model.MainInfoModel.Hit.ToString(); if (model.MainInfoModel.AuditingStatus == 0) { this.rdAudit.Checked = true; } if (model.MainInfoModel.AuditingStatus == 1) { this.rdPass.Checked = true; } if (model.MainInfoModel.AuditingStatus == 2) { this.rdNopass.Checked = true; } if (Request.UrlReferrer != null) { ViewState["strPrePage"] = Request.UrlReferrer.ToString(); } else { ViewState["strPrePage"] = ""; } ViewState["UserName"] = model.MainInfoModel.LoginName; ViewState["InfoID"] = model.MainInfoModel.InfoID; ViewState["InfoCode"] = model.MainInfoModel.InfoCode; ViewState["PublishT"] = model.MainInfoModel.publishT; ViewState["FrontDisplayTime"] = model.MainInfoModel.FrontDisplayTime; ViewState["ValidateStartTime"] = model.MainInfoModel.ValidateStartTime; ViewState["AuditingStatus"] = model.MainInfoModel.AuditingStatus; ViewState["HtmlFile"] = model.MainInfoModel.HtmlFile; ViewState["ShortInfoControlID"] = model.ShortInfoModel.ShortInfoControlID; Tz888.Common.MessageBox.ResponseScript(this.Page, "ConAudit(" + model.MainInfoModel.AuditingStatus + ")"); }
/// <summary> /// 修改事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpdate_Click(object sender, EventArgs e) { Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel(); //model.InfoContactModel = this.MerchantInfoAddressInfo1.InfoContact; //用户控件 //model.InfoContactManModels = this.MerchantInfoAddressInfo1.InfoContactMans; #region 招商信息实体 // model.InfoContactModel.Position=this model.MerchantInfoModel.MerchantTypeID = "";// this.rblMerchantType.SelectedValue; model.MerchantInfoModel.CountryCode = this.ZoneSelectControl1.CountryID; model.MerchantInfoModel.ProvinceID = this.ZoneSelectControl1.ProvinceID; model.MerchantInfoModel.CityID = this.ZoneSelectControl1.CityID; model.MerchantInfoModel.CountyID = this.ZoneSelectControl1.CountyID; model.MerchantInfoModel.IndustryClassList = this.SelectIndustryControl1.IndustryString; model.MerchantInfoModel.CapitalCurrency = this.ddlCapitalCurrency.SelectedValue; model.MerchantInfoModel.CapitalTotal = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim()); model.MerchantInfoModel.MerchantCurrency = ""; //this.ddlMerchantCurrency.SelectedValue; model.MerchantInfoModel.MerchantTotal = ""; //this.ddlMerchantTotal.SelectedValue; //项目现状及规划 model.MerchantInfoModel.ProjectStatus = "";// txtProjectStatus.Text; //项目优势及市场分析 model.MerchantInfoModel.Market = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //地方经济指标描述 model.MerchantInfoModel.EconomicIndicators = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //投资环境描述 model.MerchantInfoModel.InvestmentEnvironment = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //经济效益分析 model.MerchantInfoModel.Benefit = Tz888.Common.Utility.PageValidate.TxtToHtml(""); model.MerchantInfoModel.ZoneAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtZoneAbout.Value.ToString())); if (ViewState["ZoneAboutBrief"] != null) { model.MerchantInfoModel.ZoneAboutBrief = ViewState["ZoneAboutBrief"].ToString(); } //if (!string.IsNullOrEmpty(model.MerchantInfoModel.ReceiveOrganization)) // this.MerchantInfoAddressInfo1.Undertaker = model.MerchantInfoModel.ReceiveOrganization.Trim(); //else //this.MerchantInfoAddressInfo1.Undertaker = ""; ViewState["ZoneAboutBrief"] = model.MerchantInfoModel.ZoneAboutBrief; model.MerchantInfoModel.CooperationDemandType = ""; //for (int i = 0; cblCooperationDemandType.Items.Count > i; i++) //{ // if (cblCooperationDemandType.Items[i].Selected) // { // model.MerchantInfoModel.CooperationDemandType += cblCooperationDemandType.Items[i].Value + ","; // } //} #endregion model.MainInfoModel.InfoID = Convert.ToInt64(this.ViewState["InfoID"]); if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim())) { model.MainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); } model.MainInfoModel.publishT = Convert.ToDateTime(this.ViewState["PublishT"]); model.MainInfoModel.LoginName = ""; //用户名称 string keyword = ""; //if (!string.IsNullOrEmpty(this.txtKeyword1.Text.Trim())) // keyword += this.txtKeyword1.Text.Trim() + ","; //if (!string.IsNullOrEmpty(this.txtKeyword2.Text.Trim())) // keyword += this.txtKeyword2.Text.Trim() + ","; //if (!string.IsNullOrEmpty(this.txtKeyword3.Text.Trim())) // keyword += this.txtKeyword3.Text.Trim() + ","; model.MainInfoModel.KeyWord = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(keyword); model.MainInfoModel.Descript = ""; model.MainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); model.MainInfoModel.FrontDisplayTime = System.DateTime.Now; model.MainInfoModel.ValidateStartTime = System.DateTime.Now; //model.MainInfoModel.ValidateTerm = Convert.ToInt32(this.ddlValiditeTerm.SelectedValue.Trim()); //项目有效期限 model.MainInfoModel.ValidateTerm = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim()); model.MainInfoModel.TemplateID = "001"; model.MainInfoModel.HtmlFile = ViewState["HtmlFile"].ToString(); model.ShortInfoModel.ShortInfoControlID = Convert.ToString(ViewState["ShortInfoControlID"]); if (ViewState["ShortTitle"] != null) { model.ShortInfoModel.ShortTitle = ViewState["ShortTitle"].ToString(); } if (ViewState["ShortContent"] != null) { model.ShortInfoModel.ShortContent = ViewState["ShortContent"].ToString(); } model.ShortInfoModel.Remark = ""; model.InfoContactModel.Address = txtAddress.Text.ToString().Trim(); model.InfoContactModel.Email = txtEmail.Text.ToString().Trim(); model.InfoContactModel.Mobile = txtMobile.Text.ToString().Trim(); model.InfoContactModel.OrganizationName = txtCompanyName.Text.ToString().Trim(); model.InfoContactModel.Name = txtName.Text.ToString().Trim(); model.InfoContactModel.TelCountryCode = txtTelCountry.Text.ToString().Trim(); model.InfoContactModel.TelStateCode = txtTelZoneCode.Text.ToString().Trim(); model.InfoContactModel.TelNum = txtTelNumber.Text.ToString().Trim(); List <Tz888.Model.Info.InfoResourceModel> infoResourceModels; infoResourceModels = FilesUploadControl1.InfoList; //List<Tz888.Model.Info.InfoResourceModel> infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, FilesUploadControl1.InfoList); if (infoResourceModels != null) { model.InfoResourceModels.AddRange(infoResourceModels); } Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); if (bll.Update(model)) { bool isTof = Page.User.IsInRole("GT1002"); if (isTof) { if (string.IsNullOrEmpty(model.MainInfoModel.HtmlFile.Trim())) { model.MainInfoModel.HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Merchant", model.MainInfoModel.InfoCode, model.MainInfoModel.InfoID); } Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL(); mainBll.HasHtmlFile(model.MainInfoModel.InfoID, model.MainInfoModel.HtmlFile); string actionMsg = ""; Tz888.BLL.PageStatic.MerchantPageStatic staticobj = new Tz888.BLL.PageStatic.MerchantPageStatic(); staticobj.CreateStaticPageMerchant(model.MainInfoModel.InfoID.ToString(), ref actionMsg); } Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息成功!", "./ResourceManage_Audit.aspx"); } else { Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息失败!", "./ResourceManage_Audit.aspx"); } }
private void LoadInfo(long InfoID) { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); DataTable dt = dal.GetList("dicttab", "*", "idictvalue", 10, 1, 0, 0, " cdicttype='xmyxqxx' "); this.rdlValiditeTerm.DataTextField = "cdictname"; this.rdlValiditeTerm.DataValueField = "idictvalue"; this.rdlValiditeTerm.DataSource = dt; this.rdlValiditeTerm.DataBind(); //2010-07-28 以上绑定项目有效期限 Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.Model.Info.MerchantSetModel model = bll.GetIntegrityModel(InfoID); //this.rblMerchantType.SelectedValue = "2"; //model.MerchantInfoModel.MerchantTypeID.Trim(); this.txtMerchantTopic.Text = model.MainInfoModel.Title; if (model.MerchantInfoModel != null) { if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountryCode.Trim())) { this.ZoneSelectControl1.CountryID = model.MerchantInfoModel.CountryCode.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.ProvinceID.Trim())) { this.ZoneSelectControl1.ProvinceID = model.MerchantInfoModel.ProvinceID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CityID.Trim())) { this.ZoneSelectControl1.CityID = model.MerchantInfoModel.CityID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountyID.Trim())) { this.ZoneSelectControl1.CountyID = model.MerchantInfoModel.CountyID.Trim(); } this.SelectIndustryControl1.IndustryString = model.MerchantInfoModel.IndustryClassList.Trim(); string CooperationDemandType = model.MerchantInfoModel.CooperationDemandType.Trim(); #region 2010-06-11 新增字段的读取 ////项目现状及规划 //txtProjectStatus.Text = model.MerchantInfoModel.ProjectStatus; ////项目优势及市场分析 //txtMarket.Text = model.MerchantInfoModel.Market; ////地方经济指标描述 //txtEconomicIndicators.Text = model.MerchantInfoModel.EconomicIndicators; //////投资环境描述 //txtInvestmentEnvironment.Text = model.MerchantInfoModel.InvestmentEnvironment; ////经济效益分析 //txtBenefit.Text = model.MerchantInfoModel.Benefit; this.ddlCapitalCurrency.SelectedValue = model.MerchantInfoModel.CapitalCurrency; this.txtCapitalTotal.Text = Convert.ToString(model.MerchantInfoModel.CapitalTotal); //this.ddlMerchantCurrency.SelectedValue = model.MerchantInfoModel.MerchantCurrency; //this.ddlMerchantTotal.SelectedValue = model.MerchantInfoModel.MerchantTotal; this.txtZoneAbout.Value = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(Tz888.Common.Utility.PageValidate.HtmlToTxt(model.MerchantInfoModel.ZoneAbout.Trim())); //if (!string.IsNullOrEmpty(model.MerchantInfoModel.ReceiveOrganization)) // this.MerchantInfoAddressInfo1.Undertaker = model.MerchantInfoModel.ReceiveOrganization.Trim(); //else // this.MerchantInfoAddressInfo1.Undertaker = ""; txtAddress.Text = model.InfoContactModel.Address; txtEmail.Text = model.InfoContactModel.Email; txtMobile.Text = model.InfoContactModel.Mobile; txtCompanyName.Text = model.InfoContactModel.OrganizationName; txtName.Text = model.InfoContactModel.Name; txtTelCountry.Text = model.InfoContactModel.TelCountryCode; txtTelZoneCode.Text = model.InfoContactModel.TelStateCode; txtTelNumber.Text = model.InfoContactModel.TelNum; ViewState["ZoneAboutBrief"] = model.MerchantInfoModel.ZoneAboutBrief; } string[] cooType = model.MerchantInfoModel.CooperationDemandType.ToString().Split(new char[] { ',' }); //for (int i = 0; i < cooType.Length; i++)//3,4,5,6,7,8, //{ // switch (cooType[i]) // { // case"3": // cblCooperationDemandType.Items[0].Selected = true; // break; // case"4": // cblCooperationDemandType.Items[1].Selected = true; // break; // case"5": // cblCooperationDemandType.Items[2].Selected = true; // break; // case"6": // cblCooperationDemandType.Items[3].Selected = true; // break; // case "7": // cblCooperationDemandType.Items[4].Selected = true; // break; // case "8": // cblCooperationDemandType.Items[5].Selected = true; // break; // default: // break; // } //} //string CooperationDemandTypeItems; //for (int i = 0; i < cblCooperationDemandType.Items.Count; i++) //{ // CooperationDemandTypeItems = cblCooperationDemandType.Items[i].Value; // //CooperationDemandTypeItems += ","; // if (CooperationDemandTypeItems.IndexOf(CooperationDemandTypeItems) != -1) // cblCooperationDemandType.Items[i].Selected = true; //} #endregion //if (!string.IsNullOrEmpty(model.MainInfoModel.KeyWord.Trim())) //{ // string[] keys = model.MainInfoModel.KeyWord.Trim().Split(','); // for (int i = 0; i < keys.Length; i++) // { // string key = keys[i].ToString().Trim(); // switch (i) // { // case 0: // this.txtKeyword1.Text = key; // break; // case 1: // this.txtKeyword2.Text = key; // break; // case 2: // this.txtKeyword3.Text = key; // break; // default: // break; // } // } //} // this.ddlValiditeTerm.SelectedValue = model.MainInfoModel.ValidateTerm.ToString(); //07-28项目有效期限 this.rdlValiditeTerm.SelectedValue = model.MainInfoModel.ValidateTerm.ToString(); this.FilesUploadControl1.InfoList = model.InfoResourceModels; this.FilesUploadControl1.InfoType = "Merchant"; //this.MerchantInfoAddressInfo1.InfoContact = model.InfoContactModel; //控件 //this.MerchantInfoAddressInfo1.infoContact = model.InfoContactManModels; if (Request.UrlReferrer != null) { ViewState["strPrePage"] = Request.UrlReferrer.ToString(); } else { ViewState["strPrePage"] = ""; } ViewState["InfoID"] = model.MainInfoModel.InfoID; ViewState["PublishT"] = model.MainInfoModel.publishT; ViewState["AuditingStatus"] = model.MainInfoModel.AuditingStatus; ViewState["HtmlFile"] = model.MainInfoModel.HtmlFile; if (model.ShortInfoModel != null) { ViewState["ShortTitle"] = model.ShortInfoModel.ShortTitle; ViewState["ShortContent"] = model.ShortInfoModel.ShortContent; ViewState["ShortInfoControlID"] = model.ShortInfoModel.ShortInfoControlID; } }
private void LoadInfo(long InfoID) { Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.Model.Info.MerchantSetModel model = bll.GetIntegrityModel(InfoID); this.rblMerchantType.SelectedValue = "2"; //model.MerchantInfoModel.MerchantTypeID.Trim(); this.txtMerchantTopic.Text = model.MainInfoModel.Title; if (model.MerchantInfoModel != null) { if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountryCode.Trim())) { this.ZoneSelectControl1.CountryID = model.MerchantInfoModel.CountryCode.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.ProvinceID.Trim())) { this.ZoneSelectControl1.ProvinceID = model.MerchantInfoModel.ProvinceID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CityID.Trim())) { this.ZoneSelectControl1.CityID = model.MerchantInfoModel.CityID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountyID.Trim())) { this.ZoneSelectControl1.CountyID = model.MerchantInfoModel.CountyID.Trim(); } this.SelectIndustryControl1.IndustryString = model.MerchantInfoModel.IndustryClassList.Trim(); string CooperationDemandType = model.MerchantInfoModel.CooperationDemandType.Trim(); #region 2010-06-11 新增字段的读取 //项目现状及规划 txtProjectStatus.Text = model.MerchantInfoModel.ProjectStatus; //项目优势及市场分析 txtMarket.Text = model.MerchantInfoModel.Market; //地方经济指标描述 txtEconomicIndicators.Text = model.MerchantInfoModel.EconomicIndicators; ////投资环境描述 txtInvestmentEnvironment.Text = model.MerchantInfoModel.InvestmentEnvironment; //经济效益分析 txtBenefit.Text = model.MerchantInfoModel.Benefit; this.ddlCapitalCurrency.SelectedValue = model.MerchantInfoModel.CapitalCurrency; this.txtCapitalTotal.Text = Convert.ToString(model.MerchantInfoModel.CapitalTotal); this.ddlMerchantCurrency.SelectedValue = model.MerchantInfoModel.MerchantCurrency; this.ddlMerchantTotal.SelectedValue = model.MerchantInfoModel.MerchantTotal; this.txtZoneAbout.Value = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(Tz888.Common.Utility.PageValidate.HtmlToTxt(model.MerchantInfoModel.ZoneAbout.Trim())); if (!string.IsNullOrEmpty(model.MerchantInfoModel.ReceiveOrganization)) { this.MerchantInfoAddressInfo1.Undertaker = model.MerchantInfoModel.ReceiveOrganization.Trim(); } else { this.MerchantInfoAddressInfo1.Undertaker = ""; } ViewState["ZoneAboutBrief"] = model.MerchantInfoModel.ZoneAboutBrief; } string[] cooType = model.MerchantInfoModel.CooperationDemandType.ToString().Split(new char[] { ',' }); for (int i = 0; i < cooType.Length; i++)//3,4,5,6,7,8, { switch (cooType[i]) { case "3": cblCooperationDemandType.Items[0].Selected = true; break; case "4": cblCooperationDemandType.Items[1].Selected = true; break; case "5": cblCooperationDemandType.Items[2].Selected = true; break; case "6": cblCooperationDemandType.Items[3].Selected = true; break; case "7": cblCooperationDemandType.Items[4].Selected = true; break; case "8": cblCooperationDemandType.Items[5].Selected = true; break; default: break; } } //string CooperationDemandTypeItems; //for (int i = 0; i < cblCooperationDemandType.Items.Count; i++) //{ // CooperationDemandTypeItems = cblCooperationDemandType.Items[i].Value; // //CooperationDemandTypeItems += ","; // if (CooperationDemandTypeItems.IndexOf(CooperationDemandTypeItems) != -1) // cblCooperationDemandType.Items[i].Selected = true; //} #endregion if (!string.IsNullOrEmpty(model.MainInfoModel.KeyWord.Trim())) { string[] keys = model.MainInfoModel.KeyWord.Trim().Split(','); for (int i = 0; i < keys.Length; i++) { string key = keys[i].ToString().Trim(); switch (i) { case 0: this.txtKeyword1.Text = key; break; case 1: this.txtKeyword2.Text = key; break; case 2: this.txtKeyword3.Text = key; break; default: break; } } } this.ddlValiditeTerm.SelectedValue = model.MainInfoModel.ValidateTerm.ToString(); this.FilesUploadControl1.InfoList = model.InfoResourceModels; this.FilesUploadControl1.InfoType = "Merchant"; this.MerchantInfoAddressInfo1.InfoContact = model.InfoContactModel; //控件 //this.MerchantInfoAddressInfo1.infoContact = model.InfoContactManModels; if (Request.UrlReferrer != null) { ViewState["strPrePage"] = Request.UrlReferrer.ToString(); } else { ViewState["strPrePage"] = ""; } ViewState["InfoID"] = model.MainInfoModel.InfoID; ViewState["PublishT"] = model.MainInfoModel.publishT; ViewState["AuditingStatus"] = model.MainInfoModel.AuditingStatus; ViewState["HtmlFile"] = model.MainInfoModel.HtmlFile; if (model.ShortInfoModel != null) { ViewState["ShortTitle"] = model.ShortInfoModel.ShortTitle; ViewState["ShortContent"] = model.ShortInfoModel.ShortContent; ViewState["ShortInfoControlID"] = model.ShortInfoModel.ShortInfoControlID; } }
private void LoadInfo(long InfoID) { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); DataTable dt = dal.GetList("dicttab", "*", "idictvalue", 10, 1, 0, 0, " cdicttype='xmyxqxx' "); this.rdlValiditeTerm.DataTextField = "cdictname"; this.rdlValiditeTerm.DataValueField = "idictvalue"; this.rdlValiditeTerm.DataSource = dt; this.rdlValiditeTerm.DataBind(); //2010-07-28 以上绑定项目有效期限 Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.Model.Info.MerchantSetModel model = bll.GetIntegrityModel(Convert.ToInt64(InfoID)); //07-28项目有效期限 this.rdlValiditeTerm.SelectedValue = model.MainInfoModel.ValidateTerm.ToString(); this.txtMerchantTopic.Text = model.MainInfoModel.Title; if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountryCode)) { this.ZoneSelectControl1.CountryID = model.MerchantInfoModel.CountryCode.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.ProvinceID)) { this.ZoneSelectControl1.ProvinceID = model.MerchantInfoModel.ProvinceID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CityID)) { this.ZoneSelectControl1.CityID = model.MerchantInfoModel.CityID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountyID)) { this.ZoneSelectControl1.CountyID = model.MerchantInfoModel.CountyID.Trim(); } this.SelectIndustryControl1.IndustryString = model.MerchantInfoModel.IndustryClassList.Trim(); string CooperationDemandType = model.MerchantInfoModel.CooperationDemandType.Trim(); txtHuiBao.Text = Convert.ToString(model.MerchantInfoModel.Merchanreturns); txtAddress.Text = model.InfoContactModel.Address; //地址 txtEmail.Text = model.InfoContactModel.Email; //邮箱 txtMobile.Text = model.InfoContactModel.Mobile; //手机 txtCompanyName.Text = model.InfoContactModel.OrganizationName; //联系人 txtName.Text = model.InfoContactModel.Name; txtTelCountry.Text = model.InfoContactModel.TelCountryCode; txtTelZoneCode.Text = model.InfoContactModel.TelStateCode; txtTelNumber.Text = model.InfoContactModel.TelNum; txtKeord.Text = model.MainInfoModel.KeyWord; //网页关键字 txtWtitle.Text = model.MainInfoModel.DisplayTitle; //网页标题 this.txtDescript.Text = model.MainInfoModel.Descript; //网页描述 this.ddlCapitalCurrency.SelectedValue = model.MerchantInfoModel.CapitalCurrency; decimal CapitalTotal = Convert.ToDecimal(model.MerchantInfoModel.CapitalTotal); if (CapitalTotal > 0) { this.txtCapitalTotal.Text = CapitalTotal.ToString(); } this.txtZoneAbout.Value = model.MerchantInfoModel.ZoneAbout; if (model.MainInfoModel.IsVip == 1) { chkIsVip.Checked = true; } txtIsVipAbout.Text = model.MerchantInfoModel.VipAbout.Trim(); //this.ddlValiditeTerm.SelectedValue = model.MainInfoModel.ValidateTerm.ToString(); this.FilesUploadControl1.InfoList = model.InfoResourceModels; int FixPriceID = Convert.ToInt32(model.MainInfoModel.FixPriceID.Trim()); if (FixPriceID > 1) { chkIsPoint.Checked = true; spShowPoint.Attributes.Add("style", "display:''"); } else { rbFree.Checked = true; spShowPoint.Attributes.Add("style", "display:none"); } this.txtPointCount.Text = model.MainInfoModel.MainPointCount.ToString(); //ViewState["ShortInfoControlID"] = model.ShortInfoModel.ShortInfoControlID; this.tbHits.Text = model.MainInfoModel.Hit.ToString(); if (model.MainInfoModel.AuditingStatus == 0) { this.rdAudit.Checked = true; } //Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(0);", true); if (model.MainInfoModel.AuditingStatus == 1) { this.rdPass.Checked = true; } //Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(1);", true); if (model.MainInfoModel.AuditingStatus == 2) { this.rdNopass.Checked = true; } //Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit(2);", true); if (Request.UrlReferrer != null) { ViewState["strPrePage"] = Request.UrlReferrer.ToString(); } else { ViewState["strPrePage"] = ""; } lginName = model.MainInfoModel.LoginName; ViewState["UserName"] = model.MainInfoModel.LoginName; ViewState["InfoID"] = model.MainInfoModel.InfoID; //ViewState["InfoCode"] = model.MainInfoModel.InfoCode; ViewState["PublishT"] = model.MainInfoModel.publishT; //ViewState["FrontDisplayTime"] = model.MainInfoModel.FrontDisplayTime; //ViewState["ValidateStartTime"] = model.MainInfoModel.ValidateStartTime; ViewState["AuditingStatus"] = model.MainInfoModel.AuditingStatus; //ViewState["HtmlFile"] = model.MainInfoModel.HtmlFile; //ViewState["ShortInfoControlID"] = model.ShortInfoModel.ShortInfoControlID; }
protected void btnUpdate_Click(object sender, EventArgs e) { long _infoID = Convert.ToInt32(Request["infoID"].ToString()); Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel(); #region 招商信息实体 model.MerchantInfoModel.MerchantTypeID = "";// this.rblMerchantType.SelectedValue; model.MerchantInfoModel.CountryCode = this.ZoneSelectControl1.CountryID; model.MerchantInfoModel.ProvinceID = this.ZoneSelectControl1.ProvinceID; model.MerchantInfoModel.CityID = this.ZoneSelectControl1.CityID; model.MerchantInfoModel.CountyID = this.ZoneSelectControl1.CountyID; model.MerchantInfoModel.IndustryClassList = this.SelectIndustryControl1.IndustryString; model.MerchantInfoModel.CapitalCurrency = this.ddlCapitalCurrency.SelectedValue; model.MerchantInfoModel.CapitalTotal = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim()); model.MerchantInfoModel.MerchantCurrency = ""; //this.ddlMerchantCurrency.SelectedValue; model.MerchantInfoModel.MerchantTotal = ""; //this.ddlMerchantTotal.SelectedValue; model.MerchantInfoModel.Merchanreturns = Convert.ToInt32(this.txtHuiBao.Text.Trim()); //项目现状及规划 model.MerchantInfoModel.ProjectStatus = "";// txtProjectStatus.Text; //项目优势及市场分析 model.MerchantInfoModel.Market = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //地方经济指标描述 model.MerchantInfoModel.EconomicIndicators = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //投资环境描述 model.MerchantInfoModel.InvestmentEnvironment = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //经济效益分析 model.MerchantInfoModel.Benefit = Tz888.Common.Utility.PageValidate.TxtToHtml(""); model.MerchantInfoModel.ZoneAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtZoneAbout.Value.ToString())); if (ViewState["ZoneAboutBrief"] != null) { model.MerchantInfoModel.ZoneAboutBrief = ViewState["ZoneAboutBrief"].ToString(); } ViewState["ZoneAboutBrief"] = model.MerchantInfoModel.ZoneAboutBrief; model.MerchantInfoModel.CooperationDemandType = ""; #endregion model.MainInfoModel.InfoID = Convert.ToInt64(this.ViewState["InfoID"]); if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim())) { model.MainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); } model.MainInfoModel.publishT = Convert.ToDateTime(this.ViewState["PublishT"]); model.MainInfoModel.LoginName = ViewState["UserName"].ToString();//用户名称 if (chkIsPoint.Checked == true) { model.MainInfoModel.FixPriceID = "2"; model.MainInfoModel.MainPointCount = Convert.ToInt32(txtPointCount.Text.Trim()); } else { model.MainInfoModel.MainPointCount = 0; model.MainInfoModel.FixPriceID = "1"; } string keyword = ""; byte AuditingOrigin = Convert.ToByte(ViewState["AuditingStatus"]); byte AuditingStatus = 0; if (rdAudit.Checked == true) { AuditingStatus = 0; model.MainInfoModel.HtmlFile = ""; } if (rdPass.Checked == true) { AuditingStatus = 1; model.MainInfoModel.HtmlFile = "Merchant/" + DateTime.Now.ToString("yyyyMM") + "/Merchant" + DateTime.Now.ToString("yyyyMMdd") + "_" + _infoID + ".shtml"; } if (rdNopass.Checked == true) { AuditingStatus = 2; model.MainInfoModel.HtmlFile = ""; } model.MainInfoModel.AuditingStatus = AuditingStatus; //招商重大投资商机设置 Tz888.BLL.MerchantOppor objOppor = new Tz888.BLL.MerchantOppor(); if (chkIsVip.Checked) { objOppor.IsVip(_infoID, 1, txtIsVipAbout.Text.Trim()); } else { objOppor.IsVip(_infoID, 0, ""); } model.MainInfoModel.Hit = Convert.ToInt32(tbHits.Text.ToString().Trim()); string KeyWord = this.txtKeord.Text.ToString().Trim(); //关键字 string DisplayTitle = this.txtWtitle.Text.Trim(); //网页标题 string Descript = this.txtDescript.Text.ToString().Trim(); //网页描述 model.MainInfoModel.KeyWord = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(KeyWord); model.MainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(DisplayTitle); model.MainInfoModel.Descript = txtDescript.Text.ToString().Trim(); model.MainInfoModel.FrontDisplayTime = System.DateTime.Now; model.MainInfoModel.ValidateStartTime = System.DateTime.Now; //项目有效期限 model.MainInfoModel.ValidateTerm = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim()); model.MainInfoModel.InfoTypeID = "Merchant"; model.MainInfoModel.TemplateID = "001"; model.ShortInfoModel.ShortInfoControlID = "";// Convert.ToString(ViewState["ShortInfoControlID"]); //if (ViewState["ShortTitle"] != null) //{ // model.ShortInfoModel.ShortTitle = ViewState["ShortTitle"].ToString(); //} //if (ViewState["ShortContent"] != null) //{ model.ShortInfoModel.ShortContent = ""; //ViewState["ShortContent"].ToString(); //} model.InfoContactModel.Address = txtAddress.Text.ToString().Trim(); model.InfoContactModel.Email = txtEmail.Text.ToString().Trim(); model.InfoContactModel.Mobile = txtMobile.Text.ToString().Trim(); model.InfoContactModel.OrganizationName = txtCompanyName.Text.ToString().Trim(); model.InfoContactModel.Name = txtName.Text.ToString().Trim(); model.InfoContactModel.TelCountryCode = txtTelCountry.Text.ToString().Trim(); model.InfoContactModel.TelStateCode = txtTelZoneCode.Text.ToString().Trim(); model.InfoContactModel.TelNum = txtTelNumber.Text.ToString().Trim(); //List<Tz888.Model.Info.InfoResourceModel> infoResourceModels; //infoResourceModels = FilesUploadControl1.InfoList; ////List<Tz888.Model.Info.InfoResourceModel> infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, FilesUploadControl1.InfoList); //if (infoResourceModels != null) // model.InfoResourceModels.AddRange(infoResourceModels); //修改附件 Tz888.BLL.Info.InfoResourceBLL obj2 = new Tz888.BLL.Info.InfoResourceBLL(); obj2.DeleteByInfoID(long.Parse(this.ViewState["InfoID"].ToString())); List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = new List <Tz888.Model.Info.InfoResourceModel>(); infoResourceModels = this.FilesUploadControl1.InfoList; if (infoResourceModels != null) { model.InfoResourceModels.AddRange(infoResourceModels); } if (infoResourceModels != null) { foreach (Tz888.Model.Info.InfoResourceModel ResModel in infoResourceModels) { ResModel.InfoID = long.Parse(this.ViewState["InfoID"].ToString()); obj2.Insert(ResModel); } } Tz888.BLL.Info.InfoAuditMailBLL MailBll = new Tz888.BLL.Info.InfoAuditMailBLL(); Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); if (bll.UpdateMerchantSet(model)) { string AuditingRemark = ""; Tz888.Model.Info.InfoAuditModel auditModel = new Tz888.Model.Info.InfoAuditModel(); #region 写入信息审核记录 auditModel = new Tz888.Model.Info.InfoAuditModel(); auditModel.InfoID = model.MainInfoModel.InfoID; auditModel.InfoTypeID = theInfoType; auditModel.LoginName = ViewState["UserName"].ToString(); auditModel.PostDate = System.DateTime.Now; auditModel.Title = model.MainInfoModel.Title; auditModel.AuditingDate = System.DateTime.Now; auditModel.AuditingBy = Page.User.Identity.Name; auditModel.Memo = ""; switch (AuditingOrigin) { case 0: switch (AuditingStatus) { case 0: break; case 1: AuditingRemark = "未审核->审核通过"; auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingRemark = AuditingRemark; auditModel.FeedbackStatus = 0; //0,可修改|1,即将删除 break; case 2: AuditingRemark = "未审核->审核未通过"; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingRemark = AuditingRemark; auditModel.FeedbackStatus = Convert.ToInt32(this.rblFeedbackStatus.SelectedValue.Trim()); //0,可修改|1,即将删除 auditModel.FeedBackNote = tbAuditingRemark.Text.ToString().Trim(); break; default: break; } break; case 1: switch (AuditingStatus) { case 0: AuditingRemark = "审核通过->未审核"; auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingRemark = AuditingRemark; auditModel.FeedbackStatus = 0; break; case 1: AuditingRemark = "审核通过->审核通过(修改)"; bool c = mainBll.HasAuditing(_infoID, AuditingStatus, true, Convert.ToInt32(this.tbHits.Text.Trim()), model.MainInfoModel.LoginName, AuditingRemark, model.MainInfoModel.HtmlFile, "", 0, 0); break; case 2: AuditingRemark = "审核通过->审核未通过"; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingRemark = AuditingRemark; auditModel.FeedBackNote = this.tbAuditingRemark.Text.Trim(); auditModel.FeedbackStatus = Convert.ToInt32(this.rblFeedbackStatus.SelectedValue.Trim()); break; default: break; } break; case 2: switch (AuditingOrigin) { case 0: AuditingRemark = "审核未通过->未审核"; auditModel.FeedbackStatus = 0; auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingRemark = AuditingRemark; break; case 1: AuditingRemark = "审核未通过->审核通过"; auditModel.FeedbackStatus = 0; auditModel.FeedBackNote = ""; auditModel.AuditStatus = AuditingStatus; auditModel.AuditingRemark = AuditingRemark; break; case 2: AuditingRemark = "审核通过->审核未通过"; auditModel.FeedBackNote = this.tbAuditingRemark.Text.Trim(); auditModel.AuditStatus = AuditingStatus; auditModel.AuditingRemark = AuditingRemark; auditModel.FeedbackStatus = Convert.ToInt32(this.rblFeedbackStatus.SelectedValue.Trim()); break; default: break; } break; default: break; } bool b = mainBll.InfoAuditNote(auditModel); if (b) { if (model.MainInfoModel.AuditingStatus == 1) { int num = page.ModifyHtmlFile(Convert.ToInt32(_infoID)); if (num >= 0) { page = page.objGetMerchantInfoByInfoID(_infoID); //根ID获取信息 string IsVip = Mercahrstatic.SelIsVip(); //查询为重大商机的信息 string Idstuny = page.SelectLndus(model.MerchantInfoModel.ProvinceID); //根据区域查询信息 int sum = page.StaticHtml(Convert.ToInt32(_infoID), page.Title, page.PublishT, page.AreaName, page.Content, page.IndustryCarveOutID, page.MerchantNameTotal, page.ValidateID, Idstuny, IsVip, KeyWord, DisplayTitle, Descript, page.Merchanreturns); } else { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('生成静态页面失败!');location.href='MerchantManage.aspx'", true); } } Response.Redirect("MerchantManage.aspx"); } else { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核信息失败!');location.href='MerchantManage.aspx'", true); } #endregion } else { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核信息失败!');location.href='MerchantManage.aspx'", true); } }
protected void btnUpdate_Click(object sender, EventArgs e) { //结束部分 //实体部分 // this.imgLoding.Visible = true; Tz888.Model.Info.MainInfoModel mainInfoModel = new Tz888.Model.Info.MainInfoModel(); //创建主体信息实体 Tz888.Model.Info.MerchantInfoModel merchantInfoModel = new Tz888.Model.Info.MerchantInfoModel(); //创建招商信息实体 Tz888.Model.Info.InfoContactModel infoContactModel = new Tz888.Model.Info.InfoContactModel(); //创建信息联系方式主体 Tz888.Model.Info.ShortInfoModel shortInfoModel = new Tz888.Model.Info.ShortInfoModel(); //创建短信息实体 List <Tz888.Model.Common.IndustryModel> industryModels = new List <Tz888.Model.Common.IndustryModel>(); //融资行业实体列表 List <Tz888.Model.Info.InfoContactManModel> infoContactManModels = new List <Tz888.Model.Info.InfoContactManModel>(); //联系人实体列表 List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = new List <Tz888.Model.Info.InfoResourceModel>(); //招商信息资源信息实体 DateTime time_now = DateTime.Now; industryModels = this.SelectIndustryControl1.IndustryModels; //这里是多个联系方式的添加 #region 招商信息实体赋值 merchantInfoModel.MerchantTypeID = "";// rblMerchantType.SelectedValue; merchantInfoModel.CountryCode = ZoneSelectControl1.CountryID; merchantInfoModel.ProvinceID = ZoneSelectControl1.ProvinceID; merchantInfoModel.CityID = ZoneSelectControl1.CityID; merchantInfoModel.CountyID = ZoneSelectControl1.CountyID; //联系方式赋值 infoContactModel.OrganizationName = this.txtCompanyName.Text; infoContactModel.Name = this.txtName.Text; infoContactModel.Position = "";// this.txtPosition.Text; infoContactModel.TelCountryCode = this.txtTelCountry.Text; infoContactModel.TelStateCode = this.txtTelZoneCode.Text; infoContactModel.TelNum = this.txtTelNumber.Text; infoContactModel.Mobile = this.txtMobile.Text; infoContactModel.Email = this.txtEmail.Text; infoContactModel.Address = this.txtAddress.Text; merchantInfoModel.CooperationDemandType = ""; merchantInfoModel.CapitalCurrency = this.ddlCapitalCurrency.SelectedValue; if (!string.IsNullOrEmpty(this.txtCapitalTotal.Text.Trim())) { merchantInfoModel.CapitalTotal = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim()); } merchantInfoModel.MerchantCurrency = ""; // this.ddlMerchantCurrency.SelectedValue; merchantInfoModel.MerchantTotal = ""; // this.ddlMerchantTotal.SelectedValue; if (!string.IsNullOrEmpty(this.txtZoneAbout.Value.Trim())) { merchantInfoModel.ZoneAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(this.txtZoneAbout.Value.Trim()); } //这里是2010-06-01新加的招商信息 //if (!string.IsNullOrEmpty(this.txtZoneAboutBrief.Value.Trim())) merchantInfoModel.ZoneAboutBrief = Tz888.Common.Utility.PageValidate.TxtToHtml(""); // if (!string.IsNullOrEmpty(this.txtBenefit.Value.Trim())) merchantInfoModel.Benefit = Tz888.Common.Utility.PageValidate.TxtToHtml(""); // if (!string.IsNullOrEmpty(this.txtEconomicIndicators.Value.Trim())) merchantInfoModel.EconomicIndicators = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //if (!string.IsNullOrEmpty(this.txtInvestmentEnvironment.Value.Trim())) merchantInfoModel.InvestmentEnvironment = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //if (!string.IsNullOrEmpty(this.txtProjectStatus.Value.Trim())) merchantInfoModel.ProjectStatus = Tz888.Common.Utility.PageValidate.TxtToHtml(""); // if (!string.IsNullOrEmpty(this.txtMarket.Value.Trim())) merchantInfoModel.Market = Tz888.Common.Utility.PageValidate.TxtToHtml(""); //merchantInfoModel.Merchanreturns = Convert.ToInt32(this.txtHuiBao.Text.Trim());//回报率 if (txtHuiBao.Text.ToString().Trim() == "") { merchantInfoModel.Merchanreturns = 0; } else { merchantInfoModel.Merchanreturns = Convert.ToInt32(this.txtHuiBao.Text.Trim()); } //结束处 foreach (Tz888.Model.Common.IndustryModel model in industryModels) { merchantInfoModel.IndustryClassList += model.IndustryBID + ","; } //2010-06-08以下是对信息完整度的统计 merchantInfoModel.InformationIntegrity = Tz888.BLL.Info.MarchantInfoBLL.CountInfoInte(merchantInfoModel, infoContactModel); #endregion if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim())) { mainInfoModel.Title = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); } mainInfoModel.InfoCode = Tz888.BLL.Info.Common.CreateInfoCode("Merchant", industryModels[0].IndustryBID, this.ZoneSelectControl1.CountryID, DateTime.Now); mainInfoModel.publishT = time_now; mainInfoModel.Hit = Convert.ToInt32(tbHits.Text.Trim()); mainInfoModel.IsCore = true; //注意这里是添加主信息表与用户登陆表的通过用户名相联系 //mainInfoModel.LoginName = "111111"; mainInfoModel.LoginName = bp.LoginName; mainInfoModel.InfoOriginRoleName = "0"; //用户角色 mainInfoModel.GradeID = "0"; if (chkIsPoint.Checked == true) { mainInfoModel.FixPriceID = "2"; mainInfoModel.MainPointCount = Convert.ToInt32(txtPointCount.Text.Trim()); } else { mainInfoModel.MainPointCount = 0; mainInfoModel.FixPriceID = "1"; } mainInfoModel.FeeStatus = 0; mainInfoModel.KeyWord = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); mainInfoModel.Descript = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim())) { mainInfoModel.DisplayTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); } mainInfoModel.FrontDisplayTime = time_now; mainInfoModel.ValidateStartTime = time_now; mainInfoModel.ValidateTerm = Convert.ToInt32(this.rdlValiditeTerm.SelectedValue.Trim()); mainInfoModel.TemplateID = "001"; byte AuditingStatus = 0; if (rdAudit.Checked == true) { AuditingStatus = 0; } if (rdPass.Checked == true) { AuditingStatus = 1; } if (rdNopass.Checked == true) { AuditingStatus = 2; } mainInfoModel.AuditingStatus = AuditingStatus; mainInfoModel.HtmlFile = Tz888.Common.Utility.PageValidate.TxtToHtml(""); shortInfoModel.ShortInfoControlID = "MerchantIndex1"; if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim())) { shortInfoModel.ShortTitle = Tz888.Common.Utility.PageValidate.FiltrateHTMLTag(this.txtMerchantTopic.Text.Trim()); } shortInfoModel.ShortContent = ""; shortInfoModel.Remark = ""; //将已上传的图片从临时目录迁移到正式目录 //infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, FilesUploadControl1.InfoList); infoResourceModels = FilesUploadControl1.InfoList; Tz888.BLL.Info.MarchantInfoBLL marchantObj = new Tz888.BLL.Info.MarchantInfoBLL(); //插入数据 long infoID = marchantObj.Insert(mainInfoModel, merchantInfoModel, infoContactModel, shortInfoModel, infoResourceModels); if (infoID > 0) { if (rdPass.Checked == true) { Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel(); string url = "Merchant/" + DateTime.Now.ToString("yyyyMM") + "/Merchant" + DateTime.Now.ToString("yyyyMMdd") + "_" + infoID + ".shtml"; merstatic.UpdateUrl(url, infoID); page = page.objGetMerchantInfoByInfoID(infoID); //根ID获取信息 string IsVip = Mercahrstatic.SelIsVip(); //查询为重大商机的信息 string Idstuny = page.SelectLndus(ZoneSelectControl1.ProvinceID); //根据区域查询信息 int sum = page.StaticHtml(Convert.ToInt32(infoID), page.Title, page.PublishT, page.AreaName, page.Content, page.IndustryCarveOutID, page.MerchantNameTotal, page.ValidateID, Idstuny, IsVip, page.Title, page.Title, page.Title, page.Merchanreturns); } //招商重大投资商机设置 Tz888.BLL.MerchantOppor objOppor = new Tz888.BLL.MerchantOppor(); if (chkIsVip.Checked) { objOppor.IsVip(infoID, 1, txtIsVipAbout.Text.Trim()); } else { objOppor.IsVip(infoID, 0, ""); } Response.Redirect("MerchantManage.aspx"); } else { Tz888.Common.MessageBox.Show(this.Page, "发布失败!"); } }
private void LoadInfo(long InfoID) { Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); Tz888.Model.Info.MerchantSetModel model = bll.GetIntegrityModel(InfoID); this.rblMerchantType.SelectedValue = model.MerchantInfoModel.MerchantTypeID.Trim(); this.txtMerchantTopic.Text = model.MainInfoModel.Title; if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountryCode.Trim())) { this.ZoneSelectControl1.CountryID = model.MerchantInfoModel.CountryCode.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.ProvinceID.Trim())) { this.ZoneSelectControl1.ProvinceID = model.MerchantInfoModel.ProvinceID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CityID.Trim())) { this.ZoneSelectControl1.CityID = model.MerchantInfoModel.CityID.Trim(); } if (!string.IsNullOrEmpty(model.MerchantInfoModel.CountyID.Trim())) { this.ZoneSelectControl1.CountyID = model.MerchantInfoModel.CountyID.Trim(); } this.SelectIndustryControl1.IndustryString = model.MerchantInfoModel.IndustryClassList.Trim(); string CooperationDemandType = model.MerchantInfoModel.CooperationDemandType.Trim(); string CooperationDemandTypeItems; for (int i = 0; i < cblCooperationDemandType.Items.Count; i++) { CooperationDemandTypeItems = cblCooperationDemandType.Items[i].Value; //CooperationDemandTypeItems += ","; if (CooperationDemandType.IndexOf(CooperationDemandTypeItems) != -1) { cblCooperationDemandType.Items[i].Selected = true; } } this.ddlCapitalCurrency.SelectedValue = model.MerchantInfoModel.CapitalCurrency; this.txtCapitalTotal.Text = Convert.ToString(model.MerchantInfoModel.CapitalTotal); this.ddlMerchantCurrency.SelectedValue = model.MerchantInfoModel.MerchantCurrency; this.ddlMerchantTotal.SelectedValue = model.MerchantInfoModel.MerchantTotal; this.txtZoneAbout.Value = model.MerchantInfoModel.ZoneAbout.Trim(); if (!string.IsNullOrEmpty(model.MainInfoModel.KeyWord.Trim())) { string[] keys = model.MainInfoModel.KeyWord.Trim().Split(','); for (int i = 0; i < keys.Length; i++) { string key = keys[i].ToString().Trim(); switch (i) { case 0: this.txtKeyword1.Text = key; break; case 1: this.txtKeyword2.Text = key; break; case 2: this.txtKeyword3.Text = key; break; default: break; } } } this.ddlValiditeTerm.SelectedValue = model.MainInfoModel.ValidateTerm.ToString(); this.ImageUploadControl1.InfoList = model.InfoResourceModels; this.ImageUploadControl1.InfoType = "Merchant"; this.ImageUploadControl1.NoneCount = 3; this.ImageUploadControl1.Count = 5; this.MerchantInfoAddressInfo1.InfoContact = model.InfoContactModel; //this.MerchantInfoAddressInfo1.InfoContactMans = model.InfoContactManModels; this.MerchantInfoAddressInfo1.Undertaker = model.MerchantInfoModel.ReceiveOrganization.Trim(); if (Request.UrlReferrer != null) { ViewState["strPrePage"] = Request.UrlReferrer.ToString(); } else { ViewState["strPrePage"] = ""; } ViewState["InfoID"] = model.MainInfoModel.InfoID; ViewState["PublishT"] = model.MainInfoModel.publishT; ViewState["ZoneAboutBrief"] = model.MerchantInfoModel.ZoneAboutBrief; ViewState["AuditingStatus"] = model.MainInfoModel.AuditingStatus; ViewState["HtmlFile"] = model.MainInfoModel.HtmlFile; ViewState["ShortTitle"] = model.ShortInfoModel.ShortTitle; ViewState["ShortContent"] = model.ShortInfoModel.ShortContent; ViewState["ShortInfoControlID"] = model.ShortInfoModel.ShortInfoControlID; }
protected void btnUpdate_Click(object sender, EventArgs e) { Tz888.Model.Info.MerchantSetModel model = new Tz888.Model.Info.MerchantSetModel(); model.InfoContactModel = this.MerchantInfoAddressInfo1.InfoContact; // model.InfoContactManModels = this.MerchantInfoAddressInfo1.InfoContactMans; #region 招商信息实体 model.MerchantInfoModel.MerchantTypeID = this.rblMerchantType.SelectedValue; model.MerchantInfoModel.CountryCode = this.ZoneSelectControl1.CountryID; model.MerchantInfoModel.ProvinceID = this.ZoneSelectControl1.ProvinceID; model.MerchantInfoModel.CityID = this.ZoneSelectControl1.CityID; model.MerchantInfoModel.CountyID = this.ZoneSelectControl1.CountyID; model.MerchantInfoModel.IndustryClassList = this.SelectIndustryControl1.IndustryString; model.MerchantInfoModel.CapitalCurrency = this.ddlCapitalCurrency.SelectedValue; model.MerchantInfoModel.CapitalTotal = Convert.ToDecimal(this.txtCapitalTotal.Text.Trim()); model.MerchantInfoModel.MerchantCurrency = this.ddlMerchantCurrency.SelectedValue; model.MerchantInfoModel.MerchantTotal = this.ddlMerchantTotal.SelectedValue; model.MerchantInfoModel.ZoneAbout = this.txtZoneAbout.Value.ToString(); model.MerchantInfoModel.ZoneAboutBrief = ViewState["ZoneAboutBrief"].ToString(); if (MerchantInfoAddressInfo1.Undertaker != null) { model.MerchantInfoModel.ReceiveOrganization = this.MerchantInfoAddressInfo1.Undertaker.Trim(); } model.MerchantInfoModel.CooperationDemandType = ""; for (int i = 0; cblCooperationDemandType.Items.Count > i; i++) { if (cblCooperationDemandType.Items[i].Selected) { model.MerchantInfoModel.CooperationDemandType += cblCooperationDemandType.Items[i].Value + ","; } } #endregion model.MainInfoModel.InfoID = Convert.ToInt64(this.ViewState["InfoID"]); if (!string.IsNullOrEmpty(this.txtMerchantTopic.Text.Trim())) { model.MainInfoModel.Title = this.txtMerchantTopic.Text.Trim(); } model.MainInfoModel.publishT = Convert.ToDateTime(this.ViewState["PublishT"]); model.MainInfoModel.LoginName = ""; //用户名称 string keyword = ""; if (!string.IsNullOrEmpty(this.txtKeyword1.Text.Trim())) { keyword += this.txtKeyword1.Text.Trim() + ","; } if (!string.IsNullOrEmpty(this.txtKeyword2.Text.Trim())) { keyword += this.txtKeyword2.Text.Trim() + ","; } if (!string.IsNullOrEmpty(this.txtKeyword3.Text.Trim())) { keyword += this.txtKeyword3.Text.Trim() + ","; } model.MainInfoModel.KeyWord = keyword; model.MainInfoModel.Descript = ""; model.MainInfoModel.DisplayTitle = this.txtMerchantTopic.Text.Trim(); model.MainInfoModel.FrontDisplayTime = System.DateTime.Now; model.MainInfoModel.ValidateStartTime = System.DateTime.Now.AddDays(1); model.MainInfoModel.ValidateTerm = Convert.ToInt32(this.ddlValiditeTerm.SelectedValue.Trim()); model.MainInfoModel.TemplateID = "001"; model.MainInfoModel.HtmlFile = ViewState["HtmlFile"].ToString(); model.ShortInfoModel.ShortInfoControlID = Convert.ToString(ViewState["ShortInfoControlID"]); model.ShortInfoModel.ShortTitle = ViewState["ShortTitle"].ToString(); model.ShortInfoModel.ShortContent = ViewState["ShortContent"].ToString(); model.ShortInfoModel.Remark = ""; List <Tz888.Model.Info.InfoResourceModel> infoResourceModels = Tz888.Common.InfoResourceManage.ImageTransfer("Image", "Merchant", Tz888.Common.ResourceType.Image, Tz888.Common.ResourceProperty.InfoImage, ImageUploadControl1.InfoList); if (infoResourceModels != null) { model.InfoResourceModels.AddRange(infoResourceModels); } Tz888.BLL.Info.MarchantInfoBLL bll = new Tz888.BLL.Info.MarchantInfoBLL(); if (bll.Update(model)) { Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息成功!", Request.Url.ToString()); } else { Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改信息失败!", Request.Url.ToString()); } }