public ActionResult Modify(string oldPassword, string newPassword, string confirmPassword) { UserInfo user = Commom.ReadUserInfo(); string strError = string.Empty; user.PassWord = Common.Basic_Func.JiaMi(oldPassword); User_Func func = new User_Func(); if (!func.UserLogin(ref user, ref strError)) { ViewData["errorMsg"] = "原始密码不正确!"; return(View("ModifyPassword")); } user.IsChangePwd = true; user.PassWord = Common.Basic_Func.JiaMi(newPassword); user.RePassword = Common.Basic_Func.JiaMi(confirmPassword); if (!func.ChangeUserPassword(user, ref strError)) { // 数据有误 ViewData["errorMsg"] = "修改密码失败:" + strError; return(View("ModifyPassword")); } else { // 数据有误 ViewData["errorMsg"] = "修改成功退出重新登陆!"; return(View("ModifyPassword")); } }
/// <summary> /// 根据用户编码获取仓库列表 /// </summary> /// <param name="UserNo"></param> /// <returns></returns> public string GetWareHouseByUserADF(string UserNo) { User_Func tfun = new User_Func(); return(tfun.GetWareHouseByUserADF(UserNo)); }
/// <summary> /// 用户登录 /// </summary> /// <param name="UserJson"></param> /// <returns></returns> public string UserLoginADF(string UserJson) { User_Func tfunc = new User_Func(); return(tfunc.UserLoginADF(UserJson)); }
public bool UpdateT_UserStatus(UserInfo user, ref UserInfo t_user, int NewStatus, ref string strError) { User_Func tfunc = new User_Func(); return(tfunc.UpdateModelStatus(user, ref t_user, NewStatus, ref strError)); }
public bool GetAllT_UserByHeaderID(ref List <UserInfo> modelList, int headerID, ref string strError) { User_Func tfunc = new User_Func(); return(tfunc.GetModelListByHeaderID(ref modelList, headerID, ref strError)); }
public bool GetT_UserListByPage(ref List <UserInfo> modelList, UserInfo user, UserInfo t_user, ref BILBasic.Common.DividPage page, ref string strError) { User_Func tfunc = new User_Func(); return(tfunc.GetModelListByPage(ref modelList, user, t_user, ref page, ref strError)); }
public bool GetT_UserByID(ref UserInfo model, ref string strError) { User_Func tfunc = new User_Func(); return(tfunc.GetModelByID(ref model, ref strError)); }
public bool DeleteT_UserByModel(UserInfo user, UserInfo model, ref string strError) { User_Func tfunc = new User_Func(); return(tfunc.DeleteModelByModel(user, model, ref strError)); }
public bool SaveT_User(UserInfo user, ref UserInfo t_user, ref string strError) { User_Func tfunc = new User_Func(); return(tfunc.SaveModelToDB(user, ref t_user, ref strError)); }
public ActionResult Login(string userName, string password, string UserSelect, string remember_me) { UserInfo user = new UserInfo(); user.UserNo = userName; user.PassWord = Common.Basic_Func.JiaMi(password); string strError = ""; User_Func func = new User_Func(); if (func.UserLogin(ref user, ref strError)) { HttpCookie hc = new HttpCookie("userinfo"); hc["UserNo"] = user.UserNo; hc.Expires = DateTime.Now.AddDays(2); //设置过期时间 Response.Cookies.Add(hc); //保存到客户端 //// 登录成功 //this.TempData["lstMenu"] = user.lstMenu; return(RedirectToAction("Home_Page", "HomePage_Main")); } else { // 登录失败 //Custom.MessageWrite(Response, "用户名和密码不匹配,登录失败!"); ViewData["Msg"] = "用户名和密码不匹配,登录失败!"; return(View()); } ////记住密码 //loginService.RemberMe(Response, remember_me,UserSelect); ////从用户名Txt文档中取出历史记录显示在页面上 //string[] Users = loginService.UsersOut(Response); //ViewData["Users"] = Users; //string MdPassword = com.md5(password); ////后台判断用户名和密码是否为空 //if (String.IsNullOrEmpty(userName)) //{ // Custom.MessageWrite(Response, "用户名不能为空!"); // return View(); //} //if (String.IsNullOrEmpty(password)) //{ // Custom.MessageWrite(Response, "密码不能为空!"); // return View(); //} ////密码和用户名都输入了,数据库判断是否符合要求 //if (!String.IsNullOrEmpty(userName) && !String.IsNullOrEmpty(password)) //{ // if (loginService.checkUser(userName, MdPassword) == 1) // { // // 登录成功 // return RedirectToAction("Home_Page", "HomePage_Main"); // } // else // { // if (loginService.checkUser(userName, MdPassword) == 2) // { // //用户名已经被注销,登录失败 // Custom.MessageWrite(Response, "该用户名已经被注销,请重新登录!"); // } // else // { // // 登录失败 // Custom.MessageWrite(Response, "用户名和密码不匹配,登录失败!"); // return View(); // } // } //} //return View(); }
//public bool VerifyVersion(string FileVersion, string FileName, string path) //{ // AppVersion_Func func = new AppVersion_Func(); // return !func.VerifyVersion(FileVersion, FileName, path); //} //public bool VerifyAppVersion(ref AppVersionInfo appversion, ref string strError) //{ // AppVersion_Func func = new AppVersion_Func(); // return func.VerifyVersion(ref appversion, ref strError); //} public bool ChangeUserPassword(UserInfo user, ref string strError) { User_Func func = new User_Func(); return(func.ChangeUserPassword(user, ref strError)); }
public bool UserLogin(ref UserInfo user, ref string strError) { User_Func tfunc = new User_Func(); return(tfunc.UserLogin(ref user, ref strError)); }