protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPGongGao Model = new ZWL.BLL.ERPGongGao(); Model.TitleStr = this.TextBox1.Text; Model.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); if (Request.QueryString["Type"].ToString() != "单位") { Model.UserBuMen = ZWL.Common.PublicMethod.GetSessionValue("Department"); } else { Model.UserBuMen = this.TextBox2.Text.Trim(); } Model.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList"); Model.TypeStr = Request.QueryString["Type"].ToString(); Model.ContentStr = this.TxtContent.Text; Model.NoticeType = this.txt_nt.Text; Model.Add(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加公告通知信息(" + this.TextBox1.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "公告通知信息添加成功!", "GongGao.aspx?Type=" + Request.QueryString["Type"].ToString()); }
protected void btn_Sub_Click(object sender, EventArgs e) { ZWL.BLL.ERPGongGao Model = new ZWL.BLL.ERPGongGao(); Model.TitleStr = this.TextBox1.Text; Model.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Model.UserBuMen = this.Send_Person.Value; Model.NoticeType = this.DropDownList1.SelectedValue; Model.ZT = this.ZT.SelectedValue; Model.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList"); Model.TypeStr = this.TextBox3.Text; Model.ContentStr = this.TxtContent.Text; Model.Num = 0; int id = Model.Add(); DataEntityDataContext context = new DataEntityDataContext(); if (!string.IsNullOrEmpty(this.Send_Person.Value)) { string[] ss = this.Send_Person.Value.Split(','); for (int i = 0; i < ss.Length; i++) { ERPGongGaoYD model = new ERPGongGaoYD(); model.FID = id; model.SSBM = context.ERPUser.SingleOrDefault(p => p.UserName == ZWL.Common.PublicMethod.GetSessionValue("UserName")).Department; model.XM = ss[i]; model.SFYY = "否"; model.BZ1 = ""; model.BZ2 = ""; context.ERPGongGaoYD.InsertOnSubmit(model); context.SubmitChanges(); } } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加通知公告信息(" + this.TextBox1.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert('通知公告信息添加成功!');window.location.href='GongGao.aspx'</script>"); }
protected void ImageButton1_Click(object sender, EventArgs e) { ZWL.BLL.ERPGongGao Model = new ZWL.BLL.ERPGongGao(); Model.TitleStr = this.TextBox1.Text; Model.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Model.UserBuMen = ZWL.Common.PublicMethod.GetSessionValue("Department"); Model.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList"); Model.TypeStr = "单位"; Model.ContentStr = this.TxtContent.Text; Model.Add(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加公告通知信息(" + this.TextBox1.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "公告通知信息添加成功!", "GongGao.aspx?Type=%B5%A5%CE%BB"); }
string UserName = ""; //用户名 #endregion Fields #region Methods protected void btn_Sub_Click(object sender, EventArgs e) { ZWL.BLL.ERPGongGao Model = new ZWL.BLL.ERPGongGao(); Model.TitleStr = this.TextBox1.Text; Model.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Model.UserBuMen = this.Send_Person.Value; Model.NoticeType = this.DropDownList1.SelectedValue; Model.ZT = this.ZT.SelectedValue; Model.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList"); Model.TypeStr = this.TextBox3.Text; Model.ContentStr = this.TxtContent.Text; Model.Num = 0; int id = Model.Add(); DataEntityDataContext context = new DataEntityDataContext(); if(!string.IsNullOrEmpty(this.Send_Person.Value)) { string[] ss =this.Send_Person.Value.Split(','); for(int i = 0; i < ss.Length; i++) { ERPGongGaoYD model = new ERPGongGaoYD(); model.FID = id; model.SSBM = context.ERPUser.SingleOrDefault(p => p.UserName == ZWL.Common.PublicMethod.GetSessionValue("UserName")).Department; model.XM = ss[i]; model.SFYY = "否"; model.BZ1 = ""; model.BZ2 = ""; context.ERPGongGaoYD.InsertOnSubmit(model); context.SubmitChanges(); } } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加通知公告信息(" + this.TextBox1.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); Response.Write("<script>alert('通知公告信息添加成功!');window.location.href='GongGao.aspx'</script>"); }