protected void btn_submit_Click(object sender, EventArgs e) { WebModels.Tbl_User user = WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()); //判断原始密码是否正确 if (WebCommon.Public.GetMD5(password.Text) != user.UserPwd) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('原始密码不正确');", true); return; } //判断两次密码输入一样 if (newspass.Text != newspass2.Text) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('两次密码输入不一样');", true); return; } //更新密码 user.UserPwd = WebCommon.Public.GetMD5(this.newspass.Text); int count = WebBLL.Tbl_UserManager.UpdateTbl_User(user); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改失败!');", true); } }
public void Bind() { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_User user = WebBLL.Tbl_UserManager.GetTbl_UserById(ID); this.username.Text = user.UserName; this.u_name.Text = user.U_Name; }
protected void btn_tg_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_Info info = WebBLL.Tbl_InfoManager.GetTbl_InfoById(ID); switch (info.NodeStatus) { case "部门主管审核": if (info.I_Type == "一般信息") { info.Status = "已审核"; info.NodeStatus = "已审核"; // "部门经理审批"; WebModels.Tbl_User user = WebBLL.Tbl_UserManager.GetTbl_UserDepartManager(WebCommon.Public.GetUserName()); info.NodeUser = user.UserName; } else { info.NodeUser = info.UserName; info.Status = "已审核"; info.NodeStatus = "已审核"; // "院长审批"; WebModels.Tbl_Config cofig = WebBLL.Tbl_ConfigManager.GetTbl_ConfigById(1); info.NodeUser = cofig.C_Set4; } break; case "部门经理审批": info.NodeStatus = "信息登记审核"; WebModels.Tbl_Config config = WebBLL.Tbl_ConfigManager.GetTbl_ConfigById(1); info.NodeUser = config.C_Set2; break; case "院长审批": info.NodeStatus = "信息登记审核"; WebModels.Tbl_Config config1 = WebBLL.Tbl_ConfigManager.GetTbl_ConfigById(1); info.NodeUser = config1.C_Set2; break; case "信息登记审核": info.NodeStatus = "已审核"; info.NodeUser = info.UserName; info.Status = "已审核"; break; } int count = WebBLL.Tbl_InfoManager.UpdateTbl_Info(info); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('操作成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('操作失败!');", true); } }
public void btnSave_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(Request.QueryString["ID"]); WebModels.Tbl_Info info = WebBLL.Tbl_InfoManager.GetTbl_InfoById(ID); info.ClassID = this.ClassID.SelectedValue.Remove(0, 1); info.I_Title = this.I_Title.Text; info.I_Keyword = this.I_Keyword.Text; info.I_Description = this.I_Description.Text; info.I_Content = this.I_Content.Value; info.I_File = WebCommon.Public.UploadFile(I_File, "info_file"); info.I_Pic = WebCommon.Public.UploadFile(I_Pic, "info_pic"); if (PicWidth.Text != "" && PicHeight.Text != "") { WebCommon.Public.CutPic(info.I_Pic, info.I_Pic.Insert(info.I_Pic.Length - 4, "_"), Convert.ToInt32(PicWidth.Text), Convert.ToInt32(PicHeight.Text), 90); //生成缩略图 } info.I_Type = this.I_Type.SelectedValue; info.OrderNum = Convert.ToInt32(this.OrderNum.Text); //string StatusText = ""; //foreach (ListItem li in Status.Items) //{ // if (li.Selected) StatusText += li.Text + ","; //} info.Status = this.Status.SelectedValue; info.NodeStatus = "部门主管审核"; WebModels.Tbl_User user = WebBLL.Tbl_UserManager.GetTbl_UserDepartLeader(WebCommon.Public.GetUserName()); info.NodeUser = user.UserName; info.DealUser = WebCommon.Public.GetUserName(); if (this.AddDate.Text != "") { info.AddDate = Convert.ToDateTime(this.AddDate.Text); } else { info.AddDate = System.DateTime.Now; } info.UserNameTo = WebCommon.Public.ListBoxValuesGet(UserNameTo); int count = WebBLL.Tbl_InfoManager.UpdateTbl_Info(info); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改失败!');", true); } }
protected void btn_submit_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_User user = WebBLL.Tbl_UserManager.GetTbl_UserById(ID); user.U_Sign = WebCommon.Public.UploadFile(FileUpload1, "Sign"); user.U_SignDxf = WebCommon.Public.UploadFile(FileUpload2, "SignDxf"); int count = WebBLL.Tbl_UserManager.UpdateTbl_User(user); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改失败!');", true); } }
public void ReadValue() { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_User user = WebBLL.Tbl_UserManager.GetTbl_UserById(ID); this.UserName.Value = user.UserName; this.LimitID.SelectedValue = user.LimitID.ToString(); U_DesignLimit.SelectedValue = user.U_DesignLimit; this.UserPwd.Text = user.UserPwd; this.U_DepartID.SelectedValue = user.U_DepartID.ToString(); this.U_JobID.SelectedValue = user.U_JobID.ToString(); foreach (ListItem li in U_Specialty.Items) { if (user.U_Specialty.Contains(li.Text)) { li.Selected = true; } } this.U_Name.Value = user.U_Name; this.U_Phone.Value = user.U_Phone; this.U_Mobile.Value = user.U_Mobile; this.U_Email.Value = user.U_Email; this.U_Sex.SelectedValue = user.U_Sex; this.U_Degrees.Value = user.U_Degrees; this.U_GraduateTime.Value = user.U_GraduateTime.ToString("yyyy-MM-dd"); this.U_EntryTime.Value = user.U_EntryTime.ToString("yyyy-MM-dd"); this.U_Professional.Value = user.U_Professional; this.Status.Text = user.Status; this.U_JobRank.SelectedValue = user.U_JobRank; this.U_JobTitle.SelectedValue = user.U_JobTitle; this.U_ContractStartTime.Value = user.U_ContractStartTime.ToString("yyyy-MM-dd"); this.U_ContractEndTime.Value = user.U_ContractEndTime.ToString("yyyy-MM-dd"); this.U_DocumentTime.Value = user.U_DocumentTime.ToString("yyyy-MM-dd"); this.U_CardID.Value = user.U_CardID; this.Remark.Value = user.Remark; foreach (ListItem li in U_DesignLimit.Items) { if (user.U_DesignLimit.Contains(li.Text)) { li.Selected = true; } } }
public void btnSave_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_User user = WebBLL.Tbl_UserManager.GetTbl_UserById(ID); user.UserName = this.UserName.Value; user.LimitID = this.LimitID.SelectedValue; if (this.UserPwd.Text != "") { user.UserPwd = WebCommon.Public.GetMD5(this.UserPwd.Text); } user.U_DepartID = this.U_DepartID.SelectedValue; user.U_JobID = this.U_JobID.SelectedValue; user.U_Name = this.U_Name.Value; user.U_Phone = this.U_Phone.Value; user.U_Mobile = this.U_Mobile.Value; user.U_Sex = this.U_Sex.SelectedValue; user.U_Email = this.U_Email.Value; user.Status = this.Status.SelectedValue; user.U_Degrees = this.U_Degrees.Value; user.U_GraduateTime = Convert.ToDateTime(this.U_GraduateTime.Value); user.U_EntryTime = Convert.ToDateTime(this.U_EntryTime.Value); user.U_Professional = this.U_Professional.Value; string U_SpecialtyText = ""; foreach (ListItem li in U_Specialty.Items) { if (li.Selected) { U_SpecialtyText += li.Value + ","; } } user.U_Specialty = U_SpecialtyText; user.U_JobRank = this.U_JobRank.SelectedValue; user.U_JobTitle = this.U_JobTitle.SelectedValue; user.U_ContractStartTime = Convert.ToDateTime(this.U_ContractStartTime.Value); user.U_ContractEndTime = Convert.ToDateTime(this.U_ContractEndTime.Value); user.U_DocumentTime = Convert.ToDateTime(this.U_DocumentTime.Value); user.U_CardID = this.U_CardID.Value; string DesignLimit = ""; foreach (ListItem li in U_DesignLimit.Items) { if (li.Selected) { DesignLimit += "," + li.Text; } } if (DesignLimit.Contains(",")) { DesignLimit = DesignLimit.Remove(0, 1); } user.U_DesignLimit = DesignLimit; user.Remark = this.Remark.Value; //user.U_Sign = ""; //user.U_SignDxf = ""; user.DealUser = ""; int count = WebBLL.Tbl_UserManager.UpdateTbl_User(user); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改失败!');", true); } }
protected void btn_submit_Click(object sender, EventArgs e) { WebModels.Tbl_User user = new WebModels.Tbl_User(); user.UserName = this.UserName.Value; user.LimitID = this.LimitID.SelectedValue; user.UserPwd = WebCommon.Public.GetMD5(this.UserPwd.Text); user.U_DepartID = this.U_DepartID.SelectedValue; user.U_JobID = this.U_JobID.SelectedValue; user.U_Name = this.U_Name.Value; user.U_Phone = this.U_Phone.Value; user.U_Mobile = this.U_Mobile.Value; user.U_Email = this.U_Email.Value; user.U_Sex = this.U_Sex.SelectedValue; user.U_Degrees = this.U_Degrees.Value; user.U_GraduateTime = Convert.ToDateTime(this.U_GraduateTime.Value); user.U_EntryTime = Convert.ToDateTime(this.U_EntryTime.Value); user.U_Professional = this.U_Professional.Value; user.Status = this.Status.SelectedValue; user.U_Specialty = this.U_Specialty.SelectedValue; user.U_Sign = ""; user.DealUser = ""; user.U_SignDxf = ""; user.U_JobRank = this.U_JobRank.SelectedValue; user.U_JobTitle = this.U_JobTitle.SelectedValue; user.U_ContractStartTime = Convert.ToDateTime(this.U_ContractStartTime.Value); user.U_ContractEndTime = Convert.ToDateTime(this.U_ContractEndTime.Value); user.U_DocumentTime = Convert.ToDateTime(this.U_DocumentTime.Value); user.U_CardID = this.U_CardID.Value; string DesignLimit = ""; foreach (ListItem li in U_DesignLimit.Items) { if (li.Selected) { DesignLimit += "," + li.Text; } } if (DesignLimit.Contains(",")) { DesignLimit = DesignLimit.Remove(0, 1); } user.U_DesignLimit = DesignLimit; user.Remark = this.Remark.Value; string where = "username='******'"; int usercount = WebBLL.Tbl_UserManager.GetDataTableByCount(where); if (usercount < 1) { int count = WebBLL.Tbl_UserManager.AddTbl_User(user); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加失败!');", true); } } else { this.UserName.Value = ""; ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('该用户名已存在,请重新输入!');", true); } }