protected void btnSave_Click(object sender, EventArgs e) { GZS.BLL.EnvironmentTabBLL envtabbll = new GZS.BLL.EnvironmentTabBLL(); GZS.BLL.EnvironmentImgBLL envimgbll = new GZS.BLL.EnvironmentImgBLL(); if (txtzhongwen.Text.Trim() == "") { Response.Write("<script>alert('请输入中文描述!');</script>"); txtzhongwen.Focus(); return; } if (counts == 0) { GZS.Model.EnvironmentTabM environmentTabmodel = new GZS.Model.EnvironmentTabM(); environmentTabmodel.loginName = loginname; environmentTabmodel.EnvironmentTypeid = EnvironmentTypeids; environmentTabmodel.Chineseintroduced = txtzhongwen.Text.Trim(); environmentTabmodel.Englishintroduction = txtengilsh.Text.Trim(); environmentTabmodel.Createtime = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString().Trim(); environmentTabmodel.Updatetime = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString().Trim(); int re = envtabbll.CountByLoginNameandTypeid(environmentTabmodel.loginName.Trim(), EnvironmentTypeids); if (re > 0) { Response.Write("<script>alert('已经存在该类型的资料!');</script>"); return; } int reslut = envtabbll.Insert(environmentTabmodel); if (reslut != 0) { foreach (DataListItem item in DataList1.Items) { HiddenField fid1 = (HiddenField)item.FindControl("HiddenField1"); HiddenField fid2 = (HiddenField)item.FindControl("HiddenField2"); GZS.Model.EnvironmentImgM envimgmodel = new GZS.Model.EnvironmentImgM(); envimgmodel.Environmenttabid = reslut; envimgmodel.imgpath = fid1.Value.Trim(); envimgmodel.imgexplain = fid2.Value.Trim(); int res = envimgbll.Insert(envimgmodel); } int resa = envtabbll.StaticHtml(loginname); int ax = envtabbll.StaticHtmls(loginname); Response.Write("<script>alert('录入成功!');</script>"); } else { Response.Write("<script>alert('录入失败!');</script>"); } } else { GZS.Model.EnvironmentTabM environmentTabmodelS = envtabbll.GetModel(counts); GZS.Model.EnvironmentTabM environmentTabmodel = new GZS.Model.EnvironmentTabM(); environmentTabmodel.loginName = loginname; environmentTabmodel.EnvironmentTypeid = EnvironmentTypeids; environmentTabmodel.Chineseintroduced = txtzhongwen.Text.Trim(); environmentTabmodel.Englishintroduction = txtengilsh.Text.Trim(); environmentTabmodel.Createtime = environmentTabmodelS.Createtime.Trim(); environmentTabmodel.Environmentid = counts; environmentTabmodel.Updatetime = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString().Trim(); int s = envtabbll.Update(environmentTabmodel); if (ViewState["update"].Equals("true")) { envimgbll.Delete(counts); foreach (DataListItem item in DataList1.Items) { HiddenField fid1 = (HiddenField)item.FindControl("HiddenField1"); HiddenField fid2 = (HiddenField)item.FindControl("HiddenField2"); GZS.Model.EnvironmentImgM envimgmodel = new GZS.Model.EnvironmentImgM(); envimgmodel.Environmenttabid = counts; envimgmodel.imgpath = fid1.Value.Trim(); envimgmodel.imgexplain = fid2.Value.Trim(); int res = envimgbll.Insert(envimgmodel); } } int resa = envtabbll.StaticHtml(loginname); int ax = envtabbll.StaticHtmls(loginname); if (resa > 0) { Response.Write("<script>alert('修改成功!');location.href='EnvironmentManage.aspx';</script>"); } else { Response.Write("<script>alert('修改失败!');</script>"); } } }
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); } }