protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPBuMen MyBuMen = new ZWL.BLL.ERPBuMen(); MyBuMen.GetModel(int.Parse(Request.QueryString["ID"].ToString())); if (MyBuMen != null) { this.TextBox1.Text = MyBuMen.BuMenName; string ChargeMan = "'" + MyBuMen.ChargeMan.Replace(",", "','") + "'"; DataTable dt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [TrueName] from ERPUser Where [UserName] in (" + ChargeMan + ")"); string TrueName = ""; foreach (DataRow R in dt.Rows) { TrueName += TrueName == "" ? R["TrueName"] : "," + R["TrueName"]; } this.TextBox2.Text = TrueName; this.TextBox3.Text = MyBuMen.TelStr; this.TextBox4.Text = MyBuMen.ChuanZhen; this.TextBox5.Text = MyBuMen.BackInfo; } ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../SystemManage/BuMenInfo.aspx" : Request.UrlReferrer.ToString(); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (ZWL.Common.PublicMethod.IFExists("BuMenName", "ERPBuMen", 0, this.TextBox1.Text) == true) { ZWL.BLL.ERPBuMen MyBuMen = new ZWL.BLL.ERPBuMen(); MyBuMen.BuMenName = this.TextBox1.Text; MyBuMen.ChargeMan = this.TextBox2.Text; MyBuMen.TelStr = this.TextBox3.Text; MyBuMen.ChuanZhen = this.TextBox4.Text; MyBuMen.BackInfo = this.TextBox5.Text; MyBuMen.DirID = int.Parse(Request.QueryString["DirID"].ToString()); MyBuMen.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, "部门信息添加成功!", "BuMenInfo.aspx?View=" + Request.QueryString["View"].ToString() + "&Type=" + Request.QueryString["Type"].ToString() + "&DirID=" + Request.QueryString["DirID"].ToString()); } else { ZWL.Common.MessageBox.Show(this, "该部门已经存在,请更换名称!"); } }
//string Department_ID; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.BLL.ERPBuMen BuMenModel = new ZWL.BLL.ERPBuMen(); //Department_ID = BuMenModel.GetList("BuMenName='" + ZWL.Common.PublicMethod.GetSessionValue("Department") + "'").Tables[0].Rows[0]["ID"].ToString(); ZWL.Common.PublicMethod.CheckSession(); DataBindToGridview(); //设定按钮权限 btn_Add.Visible = ZWL.Common.PublicMethod.StrIFIn("|112A|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); btn_Change.Visible = ZWL.Common.PublicMethod.StrIFIn("|112M|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); btn_Del.Visible = ZWL.Common.PublicMethod.StrIFIn("|112D|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); btn_Report.Visible = ZWL.Common.PublicMethod.StrIFIn("|112E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); string uname = System.Web.HttpContext.Current.Session["UserName"].ToString(); if ((Request["token"] ?? "") == "ajax" && !string.IsNullOrEmpty(uname)) { string res = ""; ZWL.BLL.ERPHuiBao MyModel = new ZWL.BLL.ERPHuiBao(); res = MyModel.GetListByZT("预警取消"); Response.Clear(); Response.Write(res); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPBuMen MyBuMen = new ZWL.BLL.ERPBuMen(); MyBuMen.GetModel(int.Parse(Request.QueryString["ID"].ToString())); if (MyBuMen!=null) { this.TextBox1.Text = MyBuMen.BuMenName; string ChargeMan = "'" + MyBuMen.ChargeMan.Replace(",", "','") + "'"; DataTable dt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [TrueName] from ERPUser Where [UserName] in (" + ChargeMan + ")"); string TrueName = ""; foreach(DataRow R in dt.Rows) { TrueName += TrueName == "" ? R["TrueName"] : "," + R["TrueName"]; } this.TextBox2.Text = TrueName; this.TextBox3.Text = MyBuMen.TelStr; this.TextBox4.Text = MyBuMen.ChuanZhen; this.TextBox5.Text = MyBuMen.BackInfo; } ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../SystemManage/BuMenInfo.aspx" : Request.UrlReferrer.ToString(); } }
protected void btn_Sub_Click(object sender, EventArgs e) { if (ZWL.Common.PublicMethod.IFExists("BuMenName", "ERPBuMen", int.Parse(Request.QueryString["ID"].ToString()), this.TextBox1.Text) == true) { ZWL.BLL.ERPBuMen MyBuMen = new ZWL.BLL.ERPBuMen(); MyBuMen.ID = int.Parse(Request.QueryString["ID"].ToString()); MyBuMen.BuMenName = this.TextBox1.Text; MyBuMen.ChargeMan = this.TextBox2.Text; MyBuMen.TelStr = this.TextBox3.Text; MyBuMen.ChuanZhen = this.TextBox4.Text; MyBuMen.BackInfo = this.TextBox5.Text; MyBuMen.DirID = int.Parse(Request.QueryString["DirID"].ToString()); MyBuMen.Update(); //写系统日志 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='BuMenInfo.aspx?View=" + Request.QueryString["View"].ToString() + "&Type=" + Request.QueryString["Type"].ToString() + "&DirID=" + Request.QueryString["DirID"].ToString() + "'</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "部门信息修改成功!", "BuMenInfo.aspx?View=" + Request.QueryString["View"].ToString() + "&Type=" + Request.QueryString["Type"].ToString() + "&DirID=" + Request.QueryString["DirID"].ToString()); } else { Response.Write("<script>alert('该部门已经存在,请更换名称!!');</script>"); //ZWL.Common.MessageBox.Show(this, "该部门已经存在,请更换名称!"); } }
protected void btn_Sub_Click(object sender, EventArgs e) { if(ZWL.Common.PublicMethod.IFExists("BuMenName", "ERPBuMen", 0, this.TextBox1.Text) == true) { ZWL.BLL.ERPBuMen MyBuMen = new ZWL.BLL.ERPBuMen(); MyBuMen.BuMenName = this.TextBox1.Text; MyBuMen.ChargeMan = this.UserName_Input.Value; MyBuMen.TelStr = this.TextBox3.Text; MyBuMen.ChuanZhen = this.TextBox4.Text; MyBuMen.BackInfo = this.TextBox5.Text; MyBuMen.DirID = int.Parse(Request.QueryString["DirID"].ToString()); MyBuMen.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(); Response.Write("<script>alert('部门信息添加成功!');window.location.href='BuMenInfo.aspx?View=" + Request.QueryString["View"].ToString() + "&Type=" + Request.QueryString["Type"].ToString() + "&DirID=" + Request.QueryString["DirID"].ToString() + "'</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "部门信息添加成功!", "BuMenInfo.aspx?View=" + Request.QueryString["View"].ToString() + "&Type=" + Request.QueryString["Type"].ToString() + "&DirID=" + Request.QueryString["DirID"].ToString()); } else { Response.Write("<script>alert('该部门已经存在,请更换名称!!');</script>"); //ZWL.Common.MessageBox.Show(this, "该部门已经存在,请更换名称!"); } }
public void DataBindToGridview() { ZWL.BLL.ERPBuMen MyERPBuMen = new ZWL.BLL.ERPBuMen(); string DirID = "0"; try { DirID = Request.QueryString["DirID"].ToString(); } catch { } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPBuMen MyBuMen = new ZWL.BLL.ERPBuMen(); MyBuMen.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.TextBox1.Text = MyBuMen.BuMenName; this.TextBox2.Text = MyBuMen.ChargeMan; this.TextBox3.Text = MyBuMen.TelStr; this.TextBox4.Text = MyBuMen.ChuanZhen; this.TextBox5.Text = MyBuMen.BackInfo; } }
public void DataBindToGridview() { ZWL.BLL.ERPHuiBao MyModel = new ZWL.BLL.ERPHuiBao(); ZWL.BLL.ERPBuMen BuMenModel = new ZWL.BLL.ERPBuMen(); string Department_ID = BuMenModel.GetList("BuMenName='" + ZWL.Common.PublicMethod.GetSessionValue("Department") + "'").Tables[0].Rows[0]["ID"].ToString(); DataSet ds = MyModel.GetList("TitleStr Like '%" + this.TextBox1.Text + "%' and UserName='******'%" + this.TextBox1.Text + "%' and CHARINDEX('" + Department_ID + "',p_depart_ids)>0 order by ID desc"); if (ds!=null) { GVData.DataSource = ds; GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); } }
public void DataBindToGridview() { ZWL.BLL.ERPBuMen MyERPBuMen = new ZWL.BLL.ERPBuMen(); string DirID = "0"; try { DirID = Request.QueryString["DirID"].ToString(); } catch { } GVData.DataSource = MyERPBuMen.GetList("DirID=" + DirID + " and BuMenName Like '%"+this.TextBox1.Text+"%' order by ID desc"); GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
public void DataBindToGridview() { ZWL.BLL.ERPHuiBao MyModel = new ZWL.BLL.ERPHuiBao(); ZWL.BLL.ERPBuMen BuMenModel = new ZWL.BLL.ERPBuMen(); string Department_ID = BuMenModel.GetList("BuMenName='" + ZWL.Common.PublicMethod.GetSessionValue("Department") + "'").Tables[0].Rows[0]["ID"].ToString(); DataSet ds = MyModel.GetList("TitleStr Like '%" + this.TextBox1.Text + "%' and UserName='******'%" + this.TextBox1.Text + "%' and CHARINDEX('" + Department_ID + "',p_depart_ids)>0 order by ID desc"); if (ds != null) { GVData.DataSource = ds; GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); } }
public void DataBindToGridview() { ZWL.BLL.ERPBuMen MyERPBuMen = new ZWL.BLL.ERPBuMen(); string DirID = "0"; try { DirID = Request.QueryString["DirID"].ToString(); } catch { } GVData.DataSource = MyERPBuMen.GetList("DirID=" + DirID + " and BuMenName Like '%" + this.TextBox1.Text + "%' order by ID desc"); GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
public void DataBindToGridview() { GVData.PageSize = AspNetPager1.PageSize; GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1; ZWL.BLL.ERPBuMen MyERPBuMen = new ZWL.BLL.ERPBuMen(); string DirID = "0"; try { DirID = Request.QueryString["DirID"].ToString(); } catch { } DataSet ds = MyERPBuMen.GetList("DirID=" + DirID + " and BuMenName Like '%" + this.TextBox1.Text + "%' order by ID desc"); GVData.DataSource = ds; GVData.DataBind(); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; }
//string Department_ID; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.BLL.ERPBuMen BuMenModel = new ZWL.BLL.ERPBuMen(); //Department_ID = BuMenModel.GetList("BuMenName='" + ZWL.Common.PublicMethod.GetSessionValue("Department") + "'").Tables[0].Rows[0]["ID"].ToString(); ZWL.Common.PublicMethod.CheckSession(); string UserName = ""; try { UserName = Request.QueryString["UserName"].ToString(); TextBox2.Text = UserName; } catch { } DataBindToGridview(); //设定按钮权限 btn_Del.Visible = ZWL.Common.PublicMethod.StrIFIn("|109D|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); btn_Report.Visible = ZWL.Common.PublicMethod.StrIFIn("|109E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); } }
//string Department_ID; protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) { ZWL.BLL.ERPBuMen BuMenModel = new ZWL.BLL.ERPBuMen(); //Department_ID = BuMenModel.GetList("BuMenName='" + ZWL.Common.PublicMethod.GetSessionValue("Department") + "'").Tables[0].Rows[0]["ID"].ToString(); ZWL.Common.PublicMethod.CheckSession(); string UserName = ""; try { UserName = Request.QueryString["UserName"].ToString(); TextBox2.Text = UserName; } catch { } DataBindToGridview(); //设定按钮权限 btn_Del.Visible = ZWL.Common.PublicMethod.StrIFIn("|109D|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); btn_Report.Visible = ZWL.Common.PublicMethod.StrIFIn("|109E|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian")); } }