protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Tz888.BLL.Info.InfoContact dal = new Tz888.BLL.Info.InfoContact(); Tz888.Model.Info.InfoContactModel model = new Tz888.Model.Info.InfoContactModel(); model.InfoID = _infoID; model.OrganizationName = txtCompanyName.Value.Trim(); model.Name = txtLinkMan.Value.Trim(); model.Career = txtCareer.Value.Trim(); model.TelStateCode = txtTelStateCode.Value.Trim(); model.TelNum = txtTel.Value.Trim(); model.Mobile = txtMobile.Value.Trim(); model.Address = txtAddress.Value.Trim(); model.WebSite = txtWebSite.Value.Trim(); model.Email = txtEmail.Value.Trim(); bool b = dal.Add(model); if (b) { Tz888.Model.Info.MainInfoModel mainInfoModel = new Tz888.Model.Info.MainInfoModel(); Tz888.BLL.Info.MainInfoBLL mainDAL = new Tz888.BLL.Info.MainInfoBLL(); mainInfoModel = mainDAL.GetModel(_infoID); string HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Project", mainInfoModel.InfoCode, _infoID); Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL(); mainBll.HasHtmlFile(_infoID, HtmlFile); string actionMsg = ""; Tz888.BLL.PageStatic.ProjectPageStatic dalPage = new Tz888.BLL.PageStatic.ProjectPageStatic(); dalPage.CreateStaticPageProject_New(_infoID.ToString(), ref actionMsg); Response.Redirect("/Publish/Publishproject3.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(_infoID.ToString() + "|Project|" + title)); } else { Tz888.Common.MessageBox.Show(this.Page, "联系信息添加失败.."); } }
protected void Page_Load(object sender, EventArgs e) { //本地调试时使用默认值 //InfoID = "103"; if (string.IsNullOrEmpty(Page.User.Identity.Name)) { Response.Redirect("/Login.aspx?ReturnUrl=" + Server.UrlEncode(Request.RawUrl)); } if (Request.QueryString["InfoID"] != null) { InfoID = Request.QueryString["InfoID"].ToString(); } //根据InfoID获取资源标题 //Session["Title"] = "投资壹亿美金合作建设“中国硅热法炼镁”基地"; if (InfoID.Trim() != "") { Tz888.BLL.Info.MainInfoBLL MainInfoBLL = new Tz888.BLL.Info.MainInfoBLL(); Tz888.Model.Info.MainInfoModel MainInfoModel = new Tz888.Model.Info.MainInfoModel(); MainInfoModel = MainInfoBLL.GetModel(long.Parse(InfoID)); if (MainInfoModel != null) { tbTitle.Value = MainInfoModel.Title.ToString(); } } }
//第二步,确认联络方式 private int ConfirmContact() { Tz888.BLL.Info.InfoContact dal = new Tz888.BLL.Info.InfoContact(); Tz888.Model.Info.InfoContactModel model = new Tz888.Model.Info.InfoContactModel(); int returnValue = 0; model.InfoID = _infoID2; model.OrganizationName = txtCompanyName.Value.Trim(); model.Name = txtLinkMan.Value.Trim(); model.Career = txtCareer.Value.Trim(); model.TelCountryCode = telArea1.Value.Trim(); //新加的国际号 model.TelStateCode = txtTelStateCode.Value.Trim(); //区号 if (telFg.Value.Trim() != "") //如果分机号不为空 { model.TelNum = txtTel.Value.Trim() + "-" + telFg.Value.Trim(); } else { model.TelNum = txtTel.Value.Trim(); //电话号加分机号 } model.Mobile = txtMobile.Value.Trim(); model.Address = txtAddress.Value.Trim(); model.WebSite = txtWebSite.Value.Trim(); model.Email = txtEmail.Value.Trim(); bool b = dal.Update(model); //修改联络方式信息 if (b) { //用于生成静态页,暂不用 Tz888.Model.Info.MainInfoModel mainInfoModel = new Tz888.Model.Info.MainInfoModel(); Tz888.BLL.Info.MainInfoBLL mainDAL = new Tz888.BLL.Info.MainInfoBLL(); mainInfoModel = mainDAL.GetModel(_infoID2); string HtmlFile = Tz888.BLL.Info.Common.createStaticPageFileName("Project", mainInfoModel.InfoCode, _infoID2); Tz888.BLL.Info.MainInfoBLL mainBll = new Tz888.BLL.Info.MainInfoBLL(); mainBll.HasHtmlFile(_infoID2, HtmlFile); string actionMsg = ""; Tz888.BLL.PageStatic.ProjectPageStatic dalPage = new Tz888.BLL.PageStatic.ProjectPageStatic(); dalPage.CreateStaticPageProject_New(_infoID2.ToString(), ref actionMsg); //Response.Redirect("/Publish/Publishproject3.aspx?code=" + Tz888.Common.DEncrypt.DESEncrypt.Encrypt(_infoID.ToString() + "|Project|" + title)); //Tz888.Common.MessageBox.Show(this.Page, "发布资源成功!"); returnValue = 1; } else { //Tz888.Common.MessageBox.Show(this.Page, "联系信息添加失败,请检查!"); } return(returnValue); }