public ActionResult UpdateAuthority(string guid) { List <R_UserCompany> rUserCompanyList = new Common.DAL.UserService().GetUserC(guid); string u_guid = rUserCompanyList.First().U_GUID; string GroupCode = rUserCompanyList.First().GroupCode; if (GroupCode == "GP001") { Response.Write("<script >alert('此用户为管理员无法修改权限!');</script >"); return(View("UserList")); } else { List <T_User> users = new FMS.DAL.CompanySvc().GetUserInfo(u_guid, ""); Session["uName"] = users.First().LoginName; string c_guid = new Common.DAL.UserService().GetCompanyC(guid).First().C_GUID; Session["UserGuid"] = rUserCompanyList.First().U_GUID; Session["ComGuid"] = c_guid; List <T_ModuleList> modelList = new Common.DAL.UserService().GetModuleList(u_guid, c_guid); ViewBag.ChineseName = modelList; return(View()); } }
public string EditNickName(string newNickName) { bool result = false; string msg = ""; //if (Session["LoginName"] == null) //{ // string loginName = Session["TelName"].ToString(); //} //else { //string loginName = Session["LoginName"].ToString(); //} List <FMS.Model.T_User> users = new Common.DAL.UserService().GetUserss(Session["CurrentUserGuid"].ToString(), Session["MasterCompanyGuid"].ToString()); //记录为0! if (users.Count.Equals(1)) { FMS.Model.T_User user = (FMS.Model.T_User)users[0]; user.NickName = newNickName; result = new UserService().UpdUserIfom(user); if (result) { Session["NickName"] = newNickName; msg = "修改成功"; } } else { result = false; msg = "修改失败"; } return(msg); }
public string EditUser(string newPassword) { bool result = false; string msg = ""; List <FMS.Model.T_User> users = new Common.DAL.UserService().GetUserss(Session["CurrentUserGuid"].ToString(), Session["MasterCompanyGuid"].ToString()); //记录为0! if (users.Count.Equals(1)) { FMS.Model.T_User user = (FMS.Model.T_User)users[0]; user.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(newPassword, "MD5"); result = new UserService().UpdUserIfom(user); if (result) { msg = "修改成功"; } } else { result = false; msg = "修改失败"; } return(msg); }
public string DelUser(string guid) { string GroupCode = new Common.DAL.UserService().GetUserC(guid).First().GroupCode; if (GroupCode == "GP001") { return("maserUser"); } else { if (new UserService().DelUserAndModule(guid)) { return("success"); } else { return("fail"); } } }