protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); //绑定页面数据 ZWL.BLL.ERPUser MyBuMen = new ZWL.BLL.ERPUser(); MyBuMen.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.Label1.Text = MyBuMen.UserName; this.HyperLink1.NavigateUrl = "../LanEmail/LanEmailAdd.aspx?UserName="******"******"; this.Label3.Text = MyBuMen.TrueName; this.Label4.Text = MyBuMen.Serils; this.Label5.Text = MyBuMen.Department; this.Label6.Text = MyBuMen.JiaoSe; this.Label7.Text = MyBuMen.ZhiWei; this.Label8.Text = MyBuMen.ZaiGang; this.Label9.Text = MyBuMen.EmailStr; this.Label10.Text = MyBuMen.IfLogin; this.Label11.Text = MyBuMen.Sex; this.Label12.Text = MyBuMen.BackInfo; this.Label13.Text = MyBuMen.BirthDay; this.Label14.Text = MyBuMen.MingZu; this.Label15.Text = MyBuMen.SFZSerils; this.Label16.Text = MyBuMen.HunYing; this.Label17.Text = MyBuMen.ZhengZhiMianMao; this.Label18.Text = MyBuMen.JiGuan; this.Label19.Text = MyBuMen.HuKou; this.Label20.Text = MyBuMen.XueLi; this.Label21.Text = MyBuMen.ZhiCheng; this.Label22.Text = MyBuMen.BiYeYuanXiao; this.Label23.Text = MyBuMen.ZhuanYe; this.Label24.Text = MyBuMen.CanJiaGongZuoTime; this.Label25.Text = MyBuMen.JiaRuBenDanWeiTime; this.Label26.Text = MyBuMen.JiaTingDianHua; this.Label27.Text = MyBuMen.JiaTingAddress; this.Label28.Text = MyBuMen.GangWeiBianDong; this.Label29.Text = MyBuMen.JiaoYueBeiJing; this.Label30.Text = MyBuMen.GongZuoJianLi; this.Label31.Text = MyBuMen.SheHuiGuanXi; this.Label32.Text = MyBuMen.JiangChengJiLu; this.Label33.Text = MyBuMen.ZhiWuQingKuang; this.Label34.Text = MyBuMen.PeiXunJiLu; this.Label35.Text = MyBuMen.DanBaoJiLu; this.Label36.Text = MyBuMen.NaoDongHeTong; this.Label37.Text = MyBuMen.SheBaoJiaoNa; this.Label38.Text = MyBuMen.TiJianJiLu; this.Label39.Text = MyBuMen.BeiZhuStr; this.Label40.Text = ZWL.Common.PublicMethod.GetWenJian(MyBuMen.FuJian, "../UploadFile/"); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "查看用户信息(" + this.Label1.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); } }
protected void button1_onclick(object sender, EventArgs e) { ZWL.BLL.ERPOperations MyModel1 = new ZWL.BLL.ERPOperations(); MyModel1.OrderNo = this.OrderNo.Text.Trim(); MyModel1.ResultPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyModel1.Msituation = this.Msituation.Text.Trim(); MyModel1.Completion = this.wcqk.SelectedValue.Trim(); MyModel1.Faulttype = this.gzlx.SelectedValue.Trim(); ZWL.BLL.ERPUser model = new ZWL.BLL.ERPUser(); model.UserName = this.headpeople.Text.Trim() + "','" + this.AssistPeople1.Text.Trim() + "','" + this.AssistPeople2.Text.Trim(); try { model.UpdateForname_zt(0); MyModel1.Update_Result(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "运维结果登记,工单号(" + this.OrderNo.Text.Trim() + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "运维结果登记成功!", "Operations_registration_result.aspx"); } catch { Response.Write("<script>alert('运维结果登记失败!');history.back(-1);</script>"); Response.End(); } }
protected void submitButton_Click(object sender, EventArgs e) { string IFPop = "否"; ZWL.BLL.ERPUser MyUser = new ZWL.BLL.ERPUser(); MyUser.UserLogin(TxtUserName.Text.Trim(), ZWL.Common.DEncrypt.DESEncrypt.Encrypt(TxtUserPwd.Text), IFPop, ConfigurationManager.AppSettings["OALogin"].ToString().Trim(), "Main/Main.aspx", cbRememberId.Checked); }
public void DataBindToGridview() { //string xKeGuanDep = "'"+ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 xKeGuanDep from ERPUser where UserName='******','")+"'")+"'"; //string ConditinonStr = " 1=1 "; //if (xKeGuanDep == "'所有部门'" || xKeGuanDep == "''") //{ //} //else //{ ConditinonStr = " Department in (" + xKeGuanDep + ") "; } ZWL.BLL.ERPUser MyModel = new ZWL.BLL.ERPUser(); //GVData.DataSource = MyModel.GetList("UserName Like '%" + this.TextBox1.Text + "%' and Department Like '%" + this.TextBox2.Text + "%' and " + ConditinonStr + " order by ID desc"); DataSet ds = MyModel.GetList("UserName Like '%" + this.TextBox1.Text + "%' and Department Like '%" + this.TextBox2.Text + "%' 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(); } }
protected void button1_onclick(object sender, EventArgs e) { String Headnamestr = ""; String Assist1str = ""; String Assist2str = ""; ZWL.BLL.ERPOperations MyModel1 = new ZWL.BLL.ERPOperations(); try { if (!this.HeadPeople.SelectedValue.Equals("")) { Headnamestr = this.HeadPeople.SelectedItem.ToString().Trim(); } if (!this.AssistPeople1.SelectedValue.Equals("")) { Assist1str = this.AssistPeople1.SelectedItem.ToString().Trim(); } if (!this.AssistPeople2.SelectedValue.Equals("")) { Assist2str = this.AssistPeople2.SelectedItem.ToString().Trim(); } } catch { } ZWL.BLL.ERPUser MyModel2 = new ZWL.BLL.ERPUser(); MyModel2.UserName = this.HeadPeople.SelectedValue.Trim() + ":" + Headnamestr; //this.HeadPeople.SelectedIndex.ToString(); ZWL.BLL.ERPUser MyModel3 = new ZWL.BLL.ERPUser(); MyModel3.UserName = this.AssistPeople1.SelectedValue.Trim() + ":" + Assist1str + "','" + this.AssistPeople2.SelectedValue.Trim() + ":" + Assist2str; MyModel1.OrderNo = this.OrderNo.Text.Trim(); MyModel1.DispatchingPeople = ZWL.Common.PublicMethod.GetSessionValue("username"); MyModel1.HeadPeople = this.HeadPeople.SelectedValue.Trim() + ":" + Headnamestr; MyModel1.AssistPeople1 = this.AssistPeople1.SelectedValue.Trim() + ":" + Assist1str; MyModel1.AssistPeople2 = this.AssistPeople2.SelectedValue.Trim() + ":" + Assist2str; try { MyModel1.Update_Technician(); MyModel2.Update_zt(1); MyModel3.Update_zt(2); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("username"); MyRiZhi.DoSomething = "运维派工,工单号(" + this.OrderNo.Text.Trim() + ";" + MyModel2.UserName + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "运维派工成功!", "Operations_dispatching.aspx"); //跳转回保修界面 Response.Redirect("registration.aspx"); //this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script>history.go(-2);</script>"); } catch { Response.Write("<script>alert('运维派工失败!');history.back(-1);</script>"); Response.End(); } }
public string Login(string uname, string pass) { string dpass = ZWL.Common.DEncrypt.DESEncrypt.Encrypt(pass); ZWL.BLL.ERPUser erpuser = new ZWL.BLL.ERPUser(); string result = erpuser.UserLogin(uname, dpass); return(result); }
public void DataBindToGridview() { ZWL.BLL.ERPUser MyModel = new ZWL.BLL.ERPUser(); GVData.DataSource = MyModel.GetList("Department like '%" + this.TextBox1.Text.Trim() + "%' order by UserName asc"); GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string IFPop = "否"; //if (this.CheckBox1.Checked == true) //{ // IFPop = "是"; //} ZWL.BLL.ERPUser MyUser = new ZWL.BLL.ERPUser(); MyUser.UserLogin(TxtUserName.Text.Trim(), ZWL.Common.DEncrypt.DESEncrypt.Encrypt(TxtUserPwd.Text), IFPop, ConfigurationManager.AppSettings["OALogin"].ToString().Trim(), "Main/Main.aspx", cbRememberId.Checked); }
public void DataBindToGridview() { GVData.PageSize = AspNetPager1.PageSize; GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1; ZWL.BLL.ERPUser MyModel = new ZWL.BLL.ERPUser(); DataSet ds = MyModel.GetList("Department like '%" + this.TextBox1.Text.Trim() + "%' order by UserName asc"); GVData.DataSource = ds; GVData.DataBind(); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); //绑定页面数据 ZWL.BLL.ERPUser MyBuMen = new ZWL.BLL.ERPUser(); MyBuMen.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.TextBox1.Text = MyBuMen.UserName; this.TextBox2.Text = ZWL.Common.DEncrypt.DESEncrypt.Decrypt(MyBuMen.UserPwd); this.TextBox3.Text = MyBuMen.TrueName; this.TextBox4.Text = MyBuMen.Serils; this.TextBox5.Text = MyBuMen.Department; this.TextBox6.Text = MyBuMen.JiaoSe; this.TextBox7.Text = MyBuMen.ZhiWei; this.TextBox8.Text = MyBuMen.ZaiGang; this.TextBox9.Text = MyBuMen.EmailStr; this.RadioButtonList1.SelectedValue = MyBuMen.IfLogin; this.TextBox10.Text = MyBuMen.Sex; this.TextBox11.Text = MyBuMen.BackInfo; //this.TextBox12.Text = MyBuMen.BirthDay; //this.TextBox13.Text = MyBuMen.MingZu; //this.TextBox14.Text = MyBuMen.SFZSerils; //this.TextBox15.Text = MyBuMen.HunYing; //this.TextBox16.Text = MyBuMen.ZhengZhiMianMao; //this.TextBox17.Text = MyBuMen.JiGuan; //this.TextBox18.Text = MyBuMen.HuKou; //this.TextBox19.Text = MyBuMen.XueLi; //this.TextBox20.Text = MyBuMen.ZhiCheng; //this.TextBox21.Text = MyBuMen.BiYeYuanXiao; //this.TextBox22.Text = MyBuMen.ZhuanYe; //this.TextBox23.Text = MyBuMen.CanJiaGongZuoTime; //this.TextBox24.Text = MyBuMen.JiaRuBenDanWeiTime; //this.TextBox25.Text = MyBuMen.JiaTingDianHua; this.txt_moblie.Text = MyBuMen.JiaTingDianHua; //this.TextBox26.Text = MyBuMen.JiaTingAddress; //this.TextBox27.Text = MyBuMen.GangWeiBianDong; //this.TextBox28.Text = MyBuMen.JiaoYueBeiJing; //this.TextBox29.Text = MyBuMen.GongZuoJianLi; //this.TextBox30.Text = MyBuMen.SheHuiGuanXi; //this.TextBox31.Text = MyBuMen.JiangChengJiLu; //this.TextBox32.Text = MyBuMen.ZhiWuQingKuang; //this.TextBox33.Text = MyBuMen.PeiXunJiLu; //this.TextBox34.Text = MyBuMen.DanBaoJiLu; //this.TextBox35.Text = MyBuMen.NaoDongHeTong; //this.TextBox36.Text = MyBuMen.SheBaoJiaoNa; //this.TextBox37.Text = MyBuMen.TiJianJiLu; //this.TextBox38.Text = MyBuMen.BeiZhuStr; ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyBuMen.FuJian); //ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList")); ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../SystemManage/SystemUser.aspx" : Request.UrlReferrer.ToString(); } }
protected void Button1_Click(object sender, EventArgs e) { ZWL.BLL.ERPUser MyUser = new ZWL.BLL.ERPUser(); if (ConfigurationManager.AppSettings["OALogin"].ToString().Trim() == "0") { string UserNameStr = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 UserName from ERPUser where TrueName='" + ProcessSqlStr(LoginCode.Text.Trim()) + "'"); MyUser.UserLogin(UserNameStr, ZWL.Common.DEncrypt.DESEncrypt.Encrypt(password.Text)); } else { MyUser.UserLogin(LoginCode.Text.Trim(), ZWL.Common.DEncrypt.DESEncrypt.Encrypt(password.Text)); } }
public void DataBindToGridview() { ZWL.BLL.ERPUser MyModel = new ZWL.BLL.ERPUser(); DataSet ds = MyModel.GetList("UserName Like '%" + this.TextBox1.Text + "%' and Department Like '%" + this.TextBox2.Text + "%' 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(); } }
protected void ImageButton1_Click(object sender, EventArgs e) { ZWL.BLL.ERPUser MyModel = new ZWL.BLL.ERPUser(); MyModel.ID = int.Parse(ZWL.Common.PublicMethod.GetSessionValue("UserID")); MyModel.UserPwd = ZWL.Common.DEncrypt.DESEncrypt.Encrypt(this.TextBox1.Text); MyModel.UpdatePwd(); ZWL.Common.MessageBox.Show(this, "修改用户密码成功!"); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户修改密码"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); }
public void DataBindToGridview(string IDList) { ZWL.BLL.ERPUser MyModel = new ZWL.BLL.ERPUser(); string m = DropDownList2.SelectedItem.Value.ToString(); if (m == "全体人员") { GVData.DataSource = MyModel.GetList1("c.jiaose in ('机电维修人员','信息维修人员','医疗设备维修人员','其他维修人员') order by c.jiaose,c.serils asc"); } else { GVData.DataSource = MyModel.GetList1("c.jiaose= '" + DropDownList2.SelectedItem.Value.ToString() + "' order by c.serils desc"); } GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
protected void button1_onclick(object sender, EventArgs e) { ZWL.BLL.ERPOperations MyModel1 = new ZWL.BLL.ERPOperations(); MyModel1.OrderNo = this.OrderNo.Text.Trim(); MyModel1.ReturnPeople = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyModel1.ReturnReason = this.returnreason.SelectedValue.Trim(); ZWL.BLL.ERPUser model = new ZWL.BLL.ERPUser(); model.UserName = this.headpeople.Text.Trim() + "','" + this.AssistPeople1.Text.Trim() + "','" + this.AssistPeople2.Text.Trim(); try { MyModel1.Update_Return(); model.Update_zt(0); string NewOrderNo = KNetOddNumbers(); using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["SQLConnectionString"].ToString())) { SqlCommand cmd = new SqlCommand("insert into ERPOperations(OrderNo,FauleEquipment,Phenomenon,RepairDepartment,RepairPeople,FauleDate,RepairDate,State,EquipmentType,EquipmentName,XingHao,CunFangAddr) select " + NewOrderNo + ",FauleEquipment,Phenomenon,RepairDepartment,RepairPeople,FauleDate,RepairDate,0,EquipmentType,EquipmentName,XingHao,CunFangAddr from ERPOperations where orderno='" + MyModel1.OrderNo + "'", conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "运维转单,工单号(" + this.OrderNo.Text.Trim() + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "运维转单成功!", "Operations_registration_result.aspx"); } catch { Response.Write("<script>alert('运维转单失败!');history.back(-1);</script>"); Response.End(); } }
protected void btn_Sub_Click(object sender, EventArgs e) { if (ZWL.Common.PublicMethod.IFExists("UserName", "ERPUser", int.Parse(Request.QueryString["ID"].ToString()), this.TextBox1.Text) == true) { if (ZWL.Common.PublicMethod.IFExists("Serils", "ERPUser", int.Parse(Request.QueryString["ID"].ToString()), this.TextBox4.Text) == true) { ZWL.BLL.ERPUser MyBuMen = new ZWL.BLL.ERPUser(); MyBuMen.ID = int.Parse(Request.QueryString["ID"].ToString()); MyBuMen.UserName = this.TextBox1.Text; MyBuMen.UserPwd = ZWL.Common.DEncrypt.DESEncrypt.Encrypt(this.TextBox2.Text); MyBuMen.TrueName = this.TextBox3.Text; MyBuMen.Serils = this.TextBox4.Text; MyBuMen.Department = this.TextBox5.Text; MyBuMen.JiaoSe = this.TextBox6.Text; MyBuMen.ZhiWei = this.TextBox7.Text; MyBuMen.ZaiGang = this.TextBox8.Text; MyBuMen.EmailStr = this.TextBox9.Text; MyBuMen.IfLogin = this.RadioButtonList1.SelectedItem.Text; MyBuMen.Sex = this.TextBox10.Text; MyBuMen.BackInfo = this.TextBox11.Text; //MyBuMen.BirthDay = this.TextBox12.Text; //MyBuMen.MingZu = this.TextBox13.Text; //MyBuMen.SFZSerils = this.TextBox14.Text; //MyBuMen.HunYing = this.TextBox15.Text; //MyBuMen.ZhengZhiMianMao = this.TextBox16.Text; //MyBuMen.JiGuan = this.TextBox17.Text; //MyBuMen.HuKou = this.TextBox18.Text; //MyBuMen.XueLi = this.TextBox19.Text; //MyBuMen.ZhiCheng = this.TextBox20.Text; //MyBuMen.BiYeYuanXiao = this.TextBox21.Text; //MyBuMen.ZhuanYe = this.TextBox22.Text; //MyBuMen.CanJiaGongZuoTime = this.TextBox23.Text; //MyBuMen.JiaRuBenDanWeiTime = this.TextBox24.Text; //MyBuMen.JiaTingDianHua = this.TextBox25.Text; MyBuMen.JiaTingDianHua = this.txt_moblie.Text; //MyBuMen.JiaTingAddress = this.TextBox26.Text; //MyBuMen.GangWeiBianDong = this.TextBox27.Text; //MyBuMen.JiaoYueBeiJing = this.TextBox28.Text; //MyBuMen.GongZuoJianLi = this.TextBox29.Text; //MyBuMen.SheHuiGuanXi = this.TextBox30.Text; //MyBuMen.JiangChengJiLu = this.TextBox31.Text; //MyBuMen.ZhiWuQingKuang = this.TextBox32.Text; //MyBuMen.PeiXunJiLu = this.TextBox33.Text; //MyBuMen.DanBaoJiLu = this.TextBox34.Text; //MyBuMen.NaoDongHeTong = this.TextBox35.Text; //MyBuMen.SheBaoJiaoNa = this.TextBox36.Text; //MyBuMen.TiJianJiLu = this.TextBox37.Text; //MyBuMen.BeiZhuStr = this.TextBox38.Text; MyBuMen.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList"); 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='SystemUser.aspx';</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "用户信息修改成功!", "SystemUser.aspx"); } else { Response.Write("<script>alert('该用户编号已经存在,请更换其他用户编号!');</script>"); //ZWL.Common.MessageBox.Show(this, "该用户编号已经存在,请更换其他用户编号!"); } } else { Response.Write("<script>alert('该用户名已经存在,请更换其他用户名!');</script>"); //ZWL.Common.MessageBox.Show(this, "该用户名已经存在,请更换其他用户名!"); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { //判断是否超过最大用户限制 if (ZWL.Common.PublicMethod.IFExists("UserName", "ERPUser", 0, this.TextBox1.Text) == true) { if (ZWL.Common.PublicMethod.IFExists("Serils", "ERPUser", 0, this.TextBox4.Text) == true) { ZWL.BLL.ERPUser MyBuMen = new ZWL.BLL.ERPUser(); MyBuMen.UserName = this.TextBox1.Text; MyBuMen.UserPwd = ZWL.Common.DEncrypt.DESEncrypt.Encrypt(this.TextBox2.Text); MyBuMen.TrueName = this.TextBox3.Text; MyBuMen.Serils = this.TextBox4.Text; MyBuMen.Department = this.TextBox5.Text; MyBuMen.JiaoSe = this.TextBox6.Text; MyBuMen.ZhiWei = this.TextBox7.Text; MyBuMen.ZaiGang = this.TextBox8.Text; MyBuMen.EmailStr = this.TextBox9.Text; MyBuMen.IfLogin = this.RadioButtonList1.SelectedItem.Text; MyBuMen.Sex = this.TextBox10.Text; MyBuMen.BackInfo = this.TextBox11.Text; MyBuMen.BirthDay = this.TextBox12.Text; MyBuMen.MingZu = this.TextBox13.Text; MyBuMen.SFZSerils = this.TextBox14.Text; MyBuMen.HunYing = this.TextBox15.Text; MyBuMen.ZhengZhiMianMao = this.TextBox16.Text; MyBuMen.JiGuan = this.TextBox17.Text; MyBuMen.HuKou = this.TextBox18.Text; MyBuMen.XueLi = this.TextBox19.Text; MyBuMen.ZhiCheng = this.TextBox20.Text; MyBuMen.BiYeYuanXiao = this.TextBox21.Text; MyBuMen.ZhuanYe = this.TextBox22.Text; MyBuMen.CanJiaGongZuoTime = this.TextBox23.Text; MyBuMen.JiaRuBenDanWeiTime = this.TextBox24.Text; MyBuMen.JiaTingDianHua = this.TextBox25.Text; MyBuMen.JiaTingAddress = this.TextBox26.Text; MyBuMen.GangWeiBianDong = this.TextBox27.Text; MyBuMen.JiaoYueBeiJing = this.TextBox28.Text; MyBuMen.GongZuoJianLi = this.TextBox29.Text; MyBuMen.SheHuiGuanXi = this.TextBox30.Text; MyBuMen.JiangChengJiLu = this.TextBox31.Text; MyBuMen.ZhiWuQingKuang = this.TextBox32.Text; MyBuMen.PeiXunJiLu = this.TextBox33.Text; MyBuMen.DanBaoJiLu = this.TextBox34.Text; MyBuMen.NaoDongHeTong = this.TextBox35.Text; MyBuMen.SheBaoJiaoNa = this.TextBox36.Text; MyBuMen.TiJianJiLu = this.TextBox37.Text; MyBuMen.BeiZhuStr = this.TextBox38.Text; MyBuMen.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList"); 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, "用户信息添加成功!", "SystemUser.aspx"); } else { ZWL.Common.MessageBox.Show(this, "该用户编号已经存在,请更改其他用户编号!"); } } else { ZWL.Common.MessageBox.Show(this, "该用户名已经存在,请更改其他用户名!"); } }
protected void Page_Load(object sender, EventArgs e) { //需要真正清空登录用户时,请启用下面这句代码。考虑到部分用户不需要真正清空用户信息,只是转回登陆页。此处,留待自定义启用 //ZWL.Common.PublicMethod.SetSessionValue("UserName", null); //验证序列号是否正确 int IsPC = 0; if (!Page.IsPostBack) { TxtUserName.Text = ZWL.Common.PublicMethod.GetCookie("DTRememberName"); string username = Request["UserName"]; string userpwd = Request["UserPwd"]; if (!string.IsNullOrEmpty(username)) { TxtUserName.Text = username; } if (!string.IsNullOrEmpty(userpwd)) { TxtUserPwd.Text = userpwd; TxtUserPwd.TextMode = TextBoxMode.SingleLine; IsPC = 1; } try { //当前序列号--------------------------------------------------------------------------- string NowSerils = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 SerilsStr from ERPSerils"); if (ZWL.Common.DEncrypt.DESEncrypt.Encrypt(GetMoAddress(), "www.cnsoftweb.com-13696432490").ToString() != NowSerils) { //序列号错误 // ZWL.Common.MessageBox.ShowAndRedirect(this, "系统授权码验证无效!请联系佰鼎科技重新获取授权!", "SerilsSetting.aspx"); } } catch { //ZWL.Common.MessageBox.ShowAndRedirect(this, "系统授权码验证无效!请联系佰鼎科技重新获取授权!", "SerilsSetting.aspx"); } try { //时间字符串----------------------------------------------------------------------------- DateTime DateStr = DateTime.Parse(ZWL.Common.DEncrypt.DESEncrypt.Decrypt(ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 DateStr from ERPSerils"), "www.cnsoftweb.com-13696432490")); if (DateStr < DateTime.Now) { // //使用时间到达 // ZWL.Common.MessageBox.ShowAndRedirect(this, "系统授权码过期!请联系佰鼎科技重新获取授权!", "SerilsSetting.aspx"); } } catch { //ZWL.Common.MessageBox.ShowAndRedirect(this, "系统授权码过期!请联系佰鼎科技重新获取授权!", "SerilsSetting.aspx"); } } //判断系统的IP限制 PassORNo(); if (IsPC > 0) { string IFPop = "否"; ZWL.BLL.ERPUser MyUser = new ZWL.BLL.ERPUser(); MyUser.UserLogin(TxtUserName.Text.Trim(), ZWL.Common.DEncrypt.DESEncrypt.Encrypt(TxtUserPwd.Text), IFPop, ConfigurationManager.AppSettings["OALogin"].ToString().Trim(), "Main/Main.aspx", cbRememberId.Checked); } }
protected void btn_Sub_Click(object sender, EventArgs e) { //判断是否超过最大用户限制 if (ZWL.Common.PublicMethod.IFExists("UserName", "ERPUser", 0, this.TextBox1.Text) == true) { if (ZWL.Common.PublicMethod.IFExists("Serils", "ERPUser", 0, this.TextBox4.Text) == true) { ZWL.BLL.ERPUser MyBuMen = new ZWL.BLL.ERPUser(); MyBuMen.UserName = this.TextBox1.Text; MyBuMen.UserPwd = ZWL.Common.DEncrypt.DESEncrypt.Encrypt(this.TextBox2.Text); MyBuMen.TrueName = this.TextBox3.Text; MyBuMen.Serils = this.TextBox4.Text; MyBuMen.Department = this.TextBox5.Text; MyBuMen.JiaoSe = this.TextBox6.Text; MyBuMen.ZhiWei = this.TextBox7.Text; MyBuMen.ZaiGang = this.TextBox8.Text; MyBuMen.EmailStr = this.TextBox9.Text; MyBuMen.IfLogin = this.RadioButtonList1.SelectedItem.Text; MyBuMen.Sex = this.TextBox10.Text; MyBuMen.BackInfo = this.TextBox11.Text; //MyBuMen.BirthDay = this.TextBox12.Text; //MyBuMen.MingZu = this.TextBox13.Text; //MyBuMen.SFZSerils = this.TextBox14.Text; //MyBuMen.HunYing = this.TextBox15.Text; //MyBuMen.ZhengZhiMianMao = this.TextBox16.Text; //MyBuMen.JiGuan = this.TextBox17.Text; //MyBuMen.HuKou = this.TextBox18.Text; //MyBuMen.XueLi = this.TextBox19.Text; //MyBuMen.ZhiCheng = this.TextBox20.Text; //MyBuMen.BiYeYuanXiao = this.TextBox21.Text; //MyBuMen.ZhuanYe = this.TextBox22.Text; //MyBuMen.CanJiaGongZuoTime = this.TextBox23.Text; //MyBuMen.JiaRuBenDanWeiTime = this.TextBox24.Text; MyBuMen.JiaTingDianHua = this.TextBox25.Text; //MyBuMen.JiaTingAddress = this.TextBox26.Text; //MyBuMen.GangWeiBianDong = this.TextBox27.Text; //MyBuMen.JiaoYueBeiJing = this.TextBox28.Text; //MyBuMen.GongZuoJianLi = this.TextBox29.Text; //MyBuMen.SheHuiGuanXi = this.TextBox30.Text; //MyBuMen.JiangChengJiLu = this.TextBox31.Text; //MyBuMen.ZhiWuQingKuang = this.TextBox32.Text; //MyBuMen.PeiXunJiLu = this.TextBox33.Text; //MyBuMen.DanBaoJiLu = this.TextBox34.Text; //MyBuMen.NaoDongHeTong = this.TextBox35.Text; //MyBuMen.SheBaoJiaoNa = this.TextBox36.Text; //MyBuMen.TiJianJiLu = this.TextBox37.Text; //MyBuMen.BeiZhuStr = this.TextBox38.Text; MyBuMen.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList"); int UserID = MyBuMen.Add(); #region 生成Voip string ACCOUNT_SID = "aaf98f894ff91386014ffacfd8ca02c4"; string AUTH_TOKEN = "89a0d9b29af1480e96ec8e23486e7ee7"; string APP_ID = "8a48b5514ff923b4014ffad344e40684"; string ret = null; CCPRestSDK.CCPRestSDK api = new CCPRestSDK.CCPRestSDK(); ZWL.BLL.ERPUser User = new ZWL.BLL.ERPUser(); ZWL.BLL.AccountInfo AccountInfo = new ZWL.BLL.AccountInfo(); //ip格式如下,不带https:// if (UserID > 0) { bool isInit = api.init("app.cloopen.com", "8883"); api.setAccount(ACCOUNT_SID, AUTH_TOKEN); api.setAppId(APP_ID); try { if (isInit) { Dictionary <string, object> retData = api.CreateSubAccount(this.TextBox1.Text); ret = getDictionaryData(retData); } else { ret = "初始化失败"; } } catch (Exception exc) { ret = exc.Message; } finally { BLLHelper.PassDataInsert passData = JsonHelper.JsonToObject <BLLHelper.PassDataInsert>(ret); if (passData.statusCode != "111150") { string voip = passData.SubAccount.voipAccount; string subAccountSid = passData.SubAccount.subAccountSid; User.ID = UserID; User.VoipAccount = passData.SubAccount.voipAccount; User.AddVoip(); AccountInfo.CreateDate = DateTime.Now; AccountInfo.DateCreated = Convert.ToDateTime(passData.SubAccount.dateCreated); AccountInfo.VoipAccount = passData.SubAccount.voipAccount; AccountInfo.VoipPwd = passData.SubAccount.voipPwd; AccountInfo.SubAccountSid = passData.SubAccount.subAccountSid; AccountInfo.SubToken = passData.SubAccount.subToken; AccountInfo.Add(); } } } #endregion //写系统日志 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='SystemUser.aspx';</script>"); //ZWL.Common.MessageBox.ShowAndRedirect(this, "用户信息添加成功!", "SystemUser.aspx"); } else { Response.Write("<script>alert('该用户编号已经存在,请更改其他用户编号!');</script>"); //ZWL.Common.MessageBox.Show(this, "该用户编号已经存在,请更改其他用户编号!"); } } else { Response.Write("<script>alert('该用户名已经存在,请更改其他用户名!');</script>"); //ZWL.Common.MessageBox.Show(this, "该用户名已经存在,请更改其他用户名!"); } }
/// <summary> /// 搜索 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SeachKeyTextChanged(object sender, EventArgs e) { string SeachKeyContent = this.SeachKey.Text.ToString(); //string SeachKeyContent = SeachKey.Text.ToString().Substring(2, 4); using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["SQLConnectionString"].ToString())) { conn.Open(); string Dostr = "SELECT * FROM ERPUser where department='临床工程信息部' and jiaose like '%维修%' and serils='" + SeachKeyContent + "' "; SqlCommand cmd = new SqlCommand(Dostr, conn); SqlDataReader dr = cmd.ExecuteReader(); //判断是否为维修员 if (dr.Read()) { string SeachKeyContent1 = this.SeachKey.Text.ToString(); String[] SeachKey = SeachKeyContent1.Split(':');//提取工号 Response.AddHeader("Refresh", "0"); using (SqlConnection conn1 = new SqlConnection(ConfigurationManager.AppSettings["SQLConnectionString"].ToString())) { conn1.Open(); string Dostr1 = "select * from ERPOperations where state='2' or state='3' and headpeople like '%" + SeachKey[0] + "%'"; // YU SqlCommand cmd1 = new SqlCommand(Dostr1, conn1); SqlDataReader dr1 = cmd1.ExecuteReader(); if (dr1.Read()) { ZWL.BLL.ERPOperations MyModel = new ZWL.BLL.ERPOperations(); MyModel.OrderNo = dr1["OrderNo"].ToString(); ZWL.BLL.ERPUser MyModel1 = new ZWL.BLL.ERPUser(); MyModel1.UserName = dr1["HeadPeople"].ToString();// ZWL.BLL.ERPUser MyModel2 = new ZWL.BLL.ERPUser(); MyModel2.UserName = dr1["AssistPeople1"].ToString() + "','" + dr1["AssistPeople2"].ToString(); try { MyModel.Update_Order(); MyModel1.Update_zt(3); MyModel2.Update_zt(4); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "运维接单,工单号(" + MyModel.OrderNo + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "运维接单成功!", "Operations_accept.aspx"); } catch { Response.Write("<script>alert('无法写入维修起始时间!');history.back(-1);</script>"); Response.End(); } //Response.Write("<script>window.open('Knet_Procure_OpenBilling_PrinterPage.aspx?orderno=" + dr1["OrderNo"].ToString() + "','_blank')</script>"); Response.Write("<script>window.open('Operations_Print.aspx?ID=" + dr1["ID"].ToString() + "','_blank')</script>"); Response.End(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language=javascript> window.alert('无新任务或正在维修中!');</script>"); } } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language=javascript> window.alert('对不起,您不是维修员或录入的卡号有误!');</script>"); } } }