/// <summary> /// 用户模式设置 /// </summary> public string UserModelSetting(string id, string code) { if (id.Length > 0) { Sys_UserInfoBLL bllUser = new Sys_UserInfoBLL(); Sys_UserInfo UserInfo = bllUser.Get(p => p.UserInfoID == id); if (UserInfo.IsNotNull()) { UserInfo.UserInfo_WorkingState = code; if (bllUser.Update(UserInfo)) { return("1"); } else { return("0"); } } else { return("0"); } } else { return("0"); } }
public void ModifyPassWord(HttpContext context) { string ypwd = DESEncrypt.Encrypt(HttpUtility.UrlDecode(context.Request.QueryString["ypwd"].ToString())); string pwd = HttpUtility.UrlDecode(context.Request.QueryString["pwd"].ToString()); SessionUserModel currUserInfo = context.Session["UserInfo"] as SessionUserModel; Sys_UserInfoBLL bllUserInfo = new Sys_UserInfoBLL(); List <Sys_UserInfo> userModelList = bllUserInfo.GetList(p => p.UserInfo_LoginUserName == currUserInfo.LoginUserName && p.UserInfo_LoginUserPwd == ypwd).ToList(); if (userModelList.Count > 0) { userModelList[0].UserInfo_LoginUserPwd = DESEncrypt.Encrypt(pwd); string msg = string.Empty; if (bllUserInfo.Update(userModelList[0])) { context.Response.Write("success"); } else { context.Response.Write("error_pwd"); } } else { context.Response.Write("error_pwd"); } }
/// <summary> /// 删除用户 /// </summary> /// <param name="id"></param> public string DelBank(string id) { string msg = string.Empty; bool bol = false; Sys_UserInfoBLL userBll = new Sys_UserInfoBLL(); Sys_UserInfo user = userBll.Get(p => p.UserInfoID == id); if (user != null) { string s = ""; user.UserInfo_IsDelete = true; bol = userBll.Update(user); } if (bol) { //删除成功 msg = "1"; } else { //删除失败 msg = "0"; } return(msg); }
/// <summary> /// 批量删除数据 /// </summary> public string BatchDelInfo(string id) { if (id.Length > 0) { string sql = ""; List <string> listId = new List <string>(); listId = id.Split(',').ToList(); //foreach (var item in listId) //{ // sql += "'" + item.ToString()+ "',"; //} //if(sql.Length>0) //{ // sql = sql.Substring(0,sql.Length-1); //} Sys_UserInfoBLL userBll = new Sys_UserInfoBLL(); List <Sys_UserInfo> userList = userBll.GetList(p => listId.Contains(p.UserInfoID)).ToList();//(" UserInfoID in (" + sql + ") "); List <Sys_UserInfo> newList = new List <Sys_UserInfo>(); foreach (var users in userList) { users.UserInfo_IsDelete = true; newList.Add(users); } bool b = userBll.Update(newList); if (b) { //删除待办事项 //new RoleConfig().DeleteBatchMatterTasks(sql); //string rtnUrl = Request.RawUrl; //Sys_Menu MenuModel = bllMenu.FindByURL(rtnUrl); //if (MenuModel != null) //{ // if (!string.IsNullOrEmpty(MenuModel.Menu_Name)) // { // pg.AddLog(MenuModel.Menu_Name, "", "批量删除成功", "批量删除通过:" + listId, bg.CurrUserInfo().UserID, bg.CurrUserInfo().DepartmentCode); // } //} return("1"); } else { return("0"); } } else { return("0"); } }
private void Show() { string id = Request["id"]; if (!string.IsNullOrEmpty(id)) { Workflow_NodeConfigEx entity = new Workflow_NodeConfigEx(); Sys_UserInfoBLL UserBll = new Sys_UserInfoBLL(); Sys_RoleBLL RoleBll = new Sys_RoleBLL(); entity = bll.Get(p => p.NodeConfigExID == id); if (entity.IsNotNull()) { txtWorkflowNodeConfig_Name.Text = entity.NodeConfigEx_Name; txtWorkflowNodeConfig_Setp.Text = entity.NodeConfigEx_Setp == null ? "" : entity.NodeConfigEx_Setp.ToString(); drpWorkflowNodeConfig_AuditMode.SelectedValue = entity.NodeConfigEx_AuditMode; ddlMechanism.SelectedValue = entity.NodeConfigEx_Mechanism.SafeToString("0"); hidAutoOption.Value = entity.NodeConfigEx_DistributionRule; string objectId = hid_DepCode.Value = entity.NodeConfigEx_AuditObjectID; ddlNodeSign.SelectedValue = entity.NodeConfigEx_NodeSign; hid_NodeConfigEx_DataMappingID.Value = entity.NodeConfigEx_DataMappingID; //ckoNodeConfigEx_IsDisplayContract.Checked = entity.NodeConfigEx_IsDisplayContract.ToType(false); if (!string.IsNullOrEmpty(objectId)) { if (drpWorkflowNodeConfig_AuditMode.SelectedValue == "0") { Sys_Role role = RoleBll.Get(p => p.RoleID == objectId); if (role.IsNotNull()) { txt_Dep.Text = role.Role_Name; } } else { Sys_UserInfo UserInfo = UserBll.Get(p => p.UserInfoID == objectId); if (UserInfo.IsNotNull()) { txt_Dep.Text = UserInfo.UserInfo_FullName; } } } } } }
/// <summary> /// 保存新增的信息 /// </summary> private void AddUserInfo() { userInfo.UserInfoID = hid_AccountId.Value; if (bllUserInfo.GetList(p => p.UserInfo_LoginUserName == txtLoginName.Text.Trim() && p.UserInfo_Status == "0301").ToList().Count > 0 && ddlStatus.SelectedValue.Equals("0301")) { MessageBox.Show(this, "您输入的用户帐号已经存在,请重新输入!"); return; } else { userInfo.UserInfo_LoginUserName = this.txtLoginName.Text; } if (this.t_UserInfo_PhoneNumber.Text.Trim() != "")//手机号码 { List <Sys_UserInfo> bu = bllUser.GetList(p => p.UserInfo_PhoneNumber == this.t_UserInfo_PhoneNumber.Text.Trim().ToString()).ToList(); if (bu.Count > 0) { MessageBox.Show(this, "手机号码已存在,请重新输入!"); return; } } userInfo.UserInfo_FullName = this.txtManName.Text.Trim(); if (this.ddlDepart.SelectedItem != null) { userInfo.UserInfo_DepCode = this.ddlDepart.SelectedValue; } string pwd = this.txtLoginPwd.Text.Trim(); userInfo.UserInfo_LoginUserPwd = DESEncrypt.Encrypt(pwd); userInfo.UserInfo_AddTime = DateTime.Now; userInfo.UserInfo_Sequence = Convert.ToInt32(txtPx.Text.Trim()); userInfo.UserInfo_Type = ddlUserType.SelectedValue; userInfo.UserInfo_Status = ddlStatus.SelectedValue; string strRole = this.GetChecked(ckbxlist, ","); if (!strRole.Equals("")) { strRole = strRole.Substring(0, strRole.LastIndexOf(',')); } userInfo.UserInfo_RoleID = strRole; string strGwxx = GetChecked(chbGwList, ","); if (!strGwxx.Equals("")) { strGwxx = strGwxx.Substring(0, strGwxx.LastIndexOf(',')); } userInfo.UserInfo_Post = strGwxx; userInfo.UserInfo_PhoneNumber = t_UserInfo_PhoneNumber.Text; userInfo.UserInfo_Nation = t_UserInfo_Nation.SelectedValue; userInfo.UserInfo_Sex = t_UserInfo_Sex.SelectedValue; userInfo.UserInfo_IdentityCred = t_UserInfo_IdentityCred.Text; userInfo.UserInfo_IsDelete = false; if (t_UserInfo_Age.Text != "") { userInfo.UserInfo_Age = Convert.ToInt32(t_UserInfo_Age.Text.Trim()); } if (t_UserInfo_DateBirth.Text != "") { userInfo.UserInfo_DateBirth = Convert.ToDateTime(t_UserInfo_DateBirth.Text.Trim()); } userInfo.UserInfo_Hometown = t_UserInfo_Hometown.Text; userInfo.UserInfo_Address = t_UserInfo_Address.Text; userInfo.UserInfo_PoliticalLandscape = t_UserInfo_PoliticalLandscape.Text; userInfo.UserInfo_EducationalLevel = t_UserInfo_EducationalLevel.Text; userInfo.UserInfo_Schools = t_UserInfo_Schools.Text; userInfo.UserInfo_Specialty = t_UserInfo_Specialty.Text; if (t_UserInfo_StartWorkDate.Text != "") { userInfo.UserInfo_StartWorkDate = Convert.ToDateTime(t_UserInfo_StartWorkDate.Text); } if (t_UserInfo_JoinPartyDate.Text != "") { userInfo.UserInfo_JoinPartyDate = Convert.ToDateTime(t_UserInfo_JoinPartyDate.Text); } if (t_UserInfo_EnlistTime.Text != "") { userInfo.UserInfo_NowHoldPostTime = Convert.ToDateTime(t_UserInfo_EnlistTime.Text); } userInfo.UserInfo_Badge = t_UserInfo_Badge.Text; userInfo.UserInfo_EduBackground = t_UserInfo_EnlistPlace.Text; userInfo.UserInfo_Position = t_UserInfo_Position.Text; userInfo.UserInfo_PositionLevel = t_UserInfo_PositionLevel.Text; if (t_UserInfo_NowHoldPostTime.Text != "") { userInfo.UserInfo_NowHoldPostTime = Convert.ToDateTime(t_UserInfo_NowHoldPostTime.Text); } userInfo.UserInfo_OccupTitle = t_UserInfo_OccupTitle.Text; if (txt_Yhxx_DTcsrq.Value != "") { userInfo.UserInfo_DateBirth = Convert.ToDateTime(txt_Yhxx_DTcsrq.Value); } if (txt_Yhxx_Iage.Value != "") { userInfo.UserInfo_Age = Convert.ToInt32(txt_Yhxx_Iage.Value); } bool i = new Sys_UserInfoBLL().Add(userInfo); if (i) { new Common_BLL().AddLog("用户账户管理", userInfo.UserInfoID, "新增", "", base.CurrUserInfo().UserID, base.CurrUserInfo().DepartmentCode); MessageBox.ShowAndRedirect(this, "新增用户成功", "UserInfoList.aspx?depCode=" + this.hid_Dep.Value); } else { MessageBox.ShowAndRedirect(this, "新增用户失败", "UserInfoList.aspx?depCode=" + this.hid_Dep.Value); } }
/// <summary> /// 保存修改信息 /// </summary> private void UpdateUserInfo() { string id = RequstStr("id"); //Sys_UserInfo account = bllUserInfo.Find(RequstStr("id")); Sys_UserInfo account = bllUserInfo.Get(p => p.UserInfoID == id); string oldDepid = account.UserInfo_DepCode; string oldState = account.UserInfo_Status; string newDepid = ""; string newState = ""; bool changeState = false; string strWhere = "1<>1"; if (ddlStatus.SelectedValue.Equals("0301")) { strWhere = "UserInfo_LoginUserName ='******' and UserInfoID != '" + RequstStr("id") + "' and UserInfo_Status='0301'"; } //if (bllUserInfo.GetList(strWhere).Count > 0) if (bllUserInfo.GetList(p => p.UserInfo_LoginUserName == txtLoginName.Text && p.UserInfoID == RequstStr("id") && p.UserInfo_Status == "0301").ToList().Count > 0) { MessageBox.Show(this, "您输入的用户帐号已经存在,请重新输入!"); // txtLoginName.Text = ""; return; } if (this.t_UserInfo_PhoneNumber.Text.Trim() != "")//手机号码 { List <Sys_UserInfo> bu = bllUser.GetList(p => p.UserInfo_PhoneNumber == this.t_UserInfo_PhoneNumber.Text.Trim().ToString() && p.UserInfoID != id).ToList(); if (bu.Count > 0) { MessageBox.Show(this, "手机号码已存在,请重新输入!"); return; } } account.UserInfo_LoginUserName = this.txtLoginName.Text; account.UserInfo_FullName = this.txtManName.Text.Trim(); if (this.ddlDepart.SelectedItem != null) { account.UserInfo_DepCode = this.ddlDepart.SelectedValue; newDepid = this.ddlDepart.SelectedValue; } string pwd = this.txtLoginPwd.Text.Trim(); account.UserInfo_LoginUserPwd = DESEncrypt.Encrypt(pwd); account.UserInfo_Sequence = Convert.ToInt32(txtPx.Text.Trim()); string strRole = this.GetChecked(ckbxlist, ","); if (!strRole.Equals("")) { strRole = strRole.Substring(0, strRole.LastIndexOf(',')); } account.UserInfo_RoleID = strRole; account.UserInfo_Type = ddlUserType.SelectedValue; string strGwxx = GetChecked(chbGwList, ","); if (!strGwxx.Equals("")) { strGwxx = strGwxx.Substring(0, strGwxx.LastIndexOf(',')); } account.UserInfo_Post = strGwxx; account.UserInfo_Status = ddlStatus.SelectedValue; newState = ddlStatus.SelectedValue; // account.UserInfo_LoginUserPwd = t_UserInfo_LoginUserPwd.Text; account.UserInfo_PhoneNumber = t_UserInfo_PhoneNumber.Text; account.UserInfo_Nation = t_UserInfo_Nation.SelectedValue; account.UserInfo_Sex = t_UserInfo_Sex.SelectedValue; account.UserInfo_IdentityCred = t_UserInfo_IdentityCred.Text; if (t_UserInfo_Age.Text != "") { account.UserInfo_Age = Convert.ToInt32(t_UserInfo_Age.Text.Trim()); } if (t_UserInfo_DateBirth.Text != "") { account.UserInfo_DateBirth = Convert.ToDateTime(t_UserInfo_DateBirth.Text.Trim()); } //modelUser.UserInfo_Status = t_UserInfo_StatusName.Text; //modelUser. = t_Department_Name.Text; //modelUser.UserInfo_Post = t_UserInfo_PostName.Text; account.UserInfo_Hometown = t_UserInfo_Hometown.Text; account.UserInfo_Address = t_UserInfo_Address.Text; account.UserInfo_PoliticalLandscape = t_UserInfo_PoliticalLandscape.Text; account.UserInfo_EducationalLevel = t_UserInfo_EducationalLevel.Text; account.UserInfo_Schools = t_UserInfo_Schools.Text; account.UserInfo_Specialty = t_UserInfo_Specialty.Text; if (t_UserInfo_StartWorkDate.Text != "") { account.UserInfo_StartWorkDate = Convert.ToDateTime(t_UserInfo_StartWorkDate.Text); } if (t_UserInfo_JoinPartyDate.Text != "") { account.UserInfo_JoinPartyDate = Convert.ToDateTime(t_UserInfo_JoinPartyDate.Text); } if (t_UserInfo_EnlistTime.Text != "") { account.UserInfo_NowHoldPostTime = Convert.ToDateTime(t_UserInfo_EnlistTime.Text); } account.UserInfo_Badge = t_UserInfo_Badge.Text; account.UserInfo_EduBackground = t_UserInfo_EnlistPlace.Text; account.UserInfo_Position = t_UserInfo_Position.Text; account.UserInfo_PositionLevel = t_UserInfo_PositionLevel.Text; if (t_UserInfo_NowHoldPostTime.Text != "") { account.UserInfo_NowHoldPostTime = Convert.ToDateTime(t_UserInfo_NowHoldPostTime.Text); } account.UserInfo_OccupTitle = t_UserInfo_OccupTitle.Text; // account.UserInfo_LoginUserPwd = DESEncrypt.Encrypt(t_UserInfo_LoginUserPwd.Text.ToString().Trim()); if (txt_Yhxx_DTcsrq.Value != "") { account.UserInfo_DateBirth = Convert.ToDateTime(txt_Yhxx_DTcsrq.Value); } if (txt_Yhxx_Iage.Value != "") { account.UserInfo_Age = Convert.ToInt32(txt_Yhxx_Iage.Value); } bool i = new Sys_UserInfoBLL().Update(account); if (i) { new Common_BLL().AddLog("用户管理", account.UserInfoID, "修改", "", base.CurrUserInfo().UserID, base.CurrUserInfo().DepartmentCode); if (changeState) { MessageBox.ShowAndRedirect(this, "修改用户信息成功,该用户具有分管范围,为了避免影响系统的正常使用,请及时调整领导的分管范围,以免有所遗漏!", "UserInfoList.aspx?depCode=" + this.hid_Dep.Value); } else { MessageBox.ShowAndRedirect(this, "修改用户信息成功", "UserInfoList.aspx?depCode=" + this.hid_Dep.Value); } } else { MessageBox.ShowAndRedirect(this, "保存出现问题,请重试", "UserInfoList.aspx?depCode=" + this.hid_Dep.Value); } }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btntijiao_Click(object sender, ImageClickEventArgs e) { string id = RequstStr("id"); //modelUser = bllUser.Find(p=>p.UserInfoID == id); // FormModel.GetForm<Sys_UserInfo>(this, modelUser, "t_"); Sys_UserInfoBLL bllUser = new Sys_UserInfoBLL(); Sys_UserInfo modelUser = bllUser.Find(p => p.UserInfoID == id); //modelUser.UserInfo_LoginUserName = t_UserInfo_LoginUserName.Text; //modelUser.UserInfo_FullName = t_UserInfo_FullName.Text; modelUser.UserInfo_LoginUserPwd = t_UserInfo_LoginUserPwd.Text; modelUser.UserInfo_PhoneNumber = t_UserInfo_PhoneNumber.Text; modelUser.UserInfo_Nation = t_UserInfo_Nation.SelectedValue; modelUser.UserInfo_Sex = t_UserInfo_Sex.SelectedValue; modelUser.UserInfo_IdentityCred = t_UserInfo_IdentityCred.Text; //if (t_UserInfo_Age.Text !="") //{ // modelUser.UserInfo_Age = Convert.ToInt32(t_UserInfo_Age); //} //if (t_UserInfo_DateBirth.Text != "") //{ // modelUser.UserInfo_DateBirth = Convert.ToDateTime(t_UserInfo_DateBirth); //} //modelUser.UserInfo_Status = t_UserInfo_StatusName.Text; //modelUser. = t_Department_Name.Text; //modelUser.UserInfo_Post = t_UserInfo_PostName.Text; modelUser.UserInfo_Hometown = t_UserInfo_Hometown.Text; modelUser.UserInfo_Address = t_UserInfo_Address.Text; modelUser.UserInfo_PoliticalLandscape = t_UserInfo_PoliticalLandscape.Text; modelUser.UserInfo_EducationalLevel = t_UserInfo_EducationalLevel.Text; modelUser.UserInfo_Schools = t_UserInfo_Schools.Text; modelUser.UserInfo_Specialty = t_UserInfo_Specialty.Text; if (t_UserInfo_StartWorkDate != null) { modelUser.UserInfo_StartWorkDate = Convert.ToDateTime(t_UserInfo_StartWorkDate.Text); } if (t_UserInfo_JoinPartyDate != null) { modelUser.UserInfo_JoinPartyDate = Convert.ToDateTime(t_UserInfo_JoinPartyDate.Text); } if (t_UserInfo_EnlistTime != null) { modelUser.UserInfo_NowHoldPostTime = Convert.ToDateTime(t_UserInfo_EnlistTime.Text); } modelUser.UserInfo_Badge = t_UserInfo_Badge.Text; modelUser.UserInfo_EduBackground = t_UserInfo_EnlistPlace.Text; modelUser.UserInfo_Position = t_UserInfo_Position.Text; modelUser.UserInfo_PositionLevel = t_UserInfo_PositionLevel.Text; if (t_UserInfo_NowHoldPostTime != null) { modelUser.UserInfo_NowHoldPostTime = Convert.ToDateTime(t_UserInfo_NowHoldPostTime.Text); } modelUser.UserInfo_OccupTitle = t_UserInfo_OccupTitle.Text; modelUser.UserInfo_LoginUserPwd = DESEncrypt.Encrypt(t_UserInfo_LoginUserPwd.Text.ToString().Trim()); if (txt_Yhxx_DTcsrq.Value != "") { modelUser.UserInfo_DateBirth = Convert.ToDateTime(txt_Yhxx_DTcsrq.Value); } if (txt_Yhxx_Iage.Value != "") { modelUser.UserInfo_Age = Convert.ToInt32(txt_Yhxx_Iage.Value); } //List<Sys_UserInfo> bu = bllUser.FindWhere("UserInfo_PhoneNumber='" + this.t_UserInfo_PhoneNumber.Text.Trim().ToString() + "' and UserInfoID not in('" + id + "')"); List <Sys_UserInfo> bu = bllUser.FindWhere(p => p.UserInfo_PhoneNumber == this.t_UserInfo_PhoneNumber.Text.Trim().ToString() && p.UserInfoID != id); if (bu.Count > 0) { this.t_UserInfo_PhoneNumber.Text = ""; MessageBox.Show(this, "手机号码已存在,请重新输入!"); } else { string msg = string.Empty; if (bllUser.Update(modelUser, out msg)) { new Common_BLL().AddLog("系统管理>>用户信息维护", id, "修改", "修改用户信息维护", CurrUserInfo().UserID, CurrUserInfo().DepartmentCode); MessageBox.ShowAndRedirect(this, "修改成功", "UserInfoList_T.aspx?depCode=" + this.hid_Dep.Value); // //更新此人对应的岗位自查表模块表 //(new DAL.PositionChange()).UpdateGwfxwx(model.ManID, "1", model.Position); } else { MessageBox.ShowAndRedirect(this, msg, "UserInfoList_T.aspx?depCode=" + this.hid_Dep.Value); } } }