protected void btnUpdate_Click(object sender, EventArgs e) { loginName = ViewState["loginName"].ToString(); bool flag = false; if (ViewState["productTypeId"].Equals(ddlName.SelectedValue.ToString()))//用户没有更改下拉框的值 { flag = NewMethod(flag); } else { int number = dominBll.ExistsByProductTypeId(int.Parse(ddlName.SelectedValue.ToString()), loginName); if (number > 0) { lblMessage.Text = "(您已经录入了此类型!请重新选择)"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit();", true); return; } else { flag = NewMethod(flag); } } if (flag) { int num = pro.StaticHtml(dominM.productid, loginName); StaticIF sta = new StaticIF(); sta.StaticHtml(loginName, 3); if (num > 0) { flag = true; } } if (!flag) { Response.Write("<script>alert('修改失败!');document.location='ProductManage.aspx'</script>"); } else { Response.Redirect("ProductManage.aspx"); } }
public void GenerateStatic(string name) { //产业优势 如果ID为0就是通过用户名查找 PolicyStatic policySta = new PolicyStatic(); policySta.StaticHtml(0, name); //产业优势右边iframe policySta.StaticHtml(name); //投资成本如果ID为0就是通过用户名查找 StaticInvest InvestSta = new StaticInvest(); InvestSta.StaticHtml(0, name); //产业优势 StaticProduct ProductSta = new StaticProduct(); ProductSta.StaticHtml(0, name); //产业优势Ifrom StaticIF staticIf = new StaticIF(); staticIf.StaticHtml(name, 3); //staticIf.StaticHtml(name, 1); //园区特色 StaticPark ParkSta = new StaticPark(); ParkSta.StaticHtml(0, name); //联系方式 ContactStatic sta = new ContactStatic(); sta.StaticHtml(name); //区域概况 GZS.BLL.AreaTabBLL areatabbll = new GZS.BLL.AreaTabBLL(); int sdsas = areatabbll.StaticHtml(0, name); //IF areatabbll.StaticHtmls(name); //投资环境 GZS.BLL.EnvironmentTabBLL envtabbll = new GZS.BLL.EnvironmentTabBLL(); envtabbll.StaticHtml(name); //IF envtabbll.StaticHtmls(name); //友情链接 GZS.BLL.FriendLinkBLL bll = new GZS.BLL.FriendLinkBLL(); bll.StaticHtml(name); //相册列表 GZS.BLL.ImageTabMBLL imagebll = new GZS.BLL.ImageTabMBLL(); List <GZS.Model.ImageTabM> list = imagebll.GetAll(name); for (int i = 0; i < list.Count; i++) { imagebll.StaticHtmls(list[i].imageid, name); imagebll.StaticHtml(list[i].imageid, name); } imagebll.StaticHtmlshouye(name); //资讯 NewsTabBLL newstabbll = new NewsTabBLL(); PageStatic statics = new PageStatic(); List <GZS.Model.news.NewsTab> list1 = newstabbll.GetNewsTabAllByUserName(name); for (int i = 0; i < list1.Count; i++) { int row = statics.StaticHtml(list1[i].Newsid, name); } int dzx = statics.StaticHtmls(name); int daze = newstabbll.StaticHtml(name); GZS.BLL.VideoSysBLL Videobll = new GZS.BLL.VideoSysBLL(); List <GZS.Model.VideoSysM> lista = Videobll.GetAllModel(name); GZS.BLL.VideoSysPagestaticBLL staticblls = new GZS.BLL.VideoSysPagestaticBLL(); for (int i = 0; i < lista.Count; i++) { staticblls.StaticHtml(lista[i].videoid, name); } }
protected void Button1_Click(object sender, EventArgs e) { loginName = ViewState["loginName"].ToString(); if (dominBll.ExistsByProductTypeId(int.Parse(ddlName.SelectedValue.ToString()), loginName) > 0) { lblMessage.Text = "(不能有重复的类型录入!请重新选择)"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myKey", " ConAudit();", true); } else { dominM.Chineseintroduced = txtChina.Text.Trim(); dominM.Englishintroduction = txtEnglish.Text.Trim(); dominM.productTypeId = int.Parse(ddlName.SelectedValue.ToString()); dominM.productName = ddlName.SelectedItem.Text.ToString();//txtProductName.Text.Trim(); dominM.loginName = loginName; dominM.htmlurl = dominM.loginName + "/product" + dominM.loginName + ".htm"; bool flag = false; int num = dominBll.Add(dominM); if (num > 0) { dominBll.Update(dominM); if (DataList1.Items.Count > 0) { foreach (DataListItem item in DataList1.Items) { CheckBox ck = (CheckBox)item.FindControl("chckimage"); HiddenField fid = (HiddenField)item.FindControl("HiddenField1"); //if (File.Exists(path + fid.Value.Trim())) //{ imgM.productid = num; imgM.imgName = fid.Value.Trim(); imgM.imgexplain = "图片描述暂无"; if (imgBLL.Add(imgM) > 0) { flag = true; } //} } } else { flag = true; } } if (flag) { num = pro.StaticHtml(num, loginName); StaticIF sta = new StaticIF(); sta.StaticHtml(loginName, 3); if (num > 0) { flag = true; } } if (!flag) { Response.Write("<script>alert('添加失败!');document.location='ProductManage.aspx'</script>"); } else { Response.Redirect("ProductManage.aspx"); } } }