public ActionResult DoResetPass(string p_user_name, string p_password, string p_re_password) { try { var userBL = new UserBL(); int re = userBL.DoResetPass(p_user_name, Encription.EncryptAccountPassword(p_user_name, p_password), p_re_password, SessionData.CurrentUser.Username); return(Json(new { success = re })); } catch (Exception ex) { Logger.LogException(ex); return(Json(new { success = -1 })); } }
public ActionBusinessResult ChangeUserSelfPassword(UserInfo userInfo, string newPassword) { userInfo.Password = Encription.EncryptAccountPassword(userInfo.Username, userInfo.Password); userInfo.ModifiedBy = userInfo.Username; newPassword = Encription.EncryptAccountPassword(userInfo.Username, newPassword); var result = UserDA.ChangeUserPassword(userInfo, newPassword); if (result > 0) { this.SetActionSuccess(true); AccountManagerBL.AddToAccountForceReLoginCollection(userInfo.Id); } return(this.SetActionResult(result, KnMessageCode.ChangePasswordUserSuccess)); }
public ActionBusinessResult DoLoginAccount(string userName, string password, string language) { var passwordEncrypt = Encription.EncryptAccountPassword(userName, password); var result = this.CheckUserLogin(userName, passwordEncrypt); if (this.GetActionSuccess()) { this.LoadAllRolesOfUser(); this.CurrentUserInfo.HtmlMenu = this.GetUserHtmlMenu(language); this.CurrentUserInfo.LoginTime = DateTime.Now; AccountManagerBL.UpdateDicAccountLogin(this.CurrentUserInfo); } return(result); }
public ActionBusinessResult AddUser(UserInfo userAdd, string GroupId) { var passwordEncrypt = Encription.EncryptAccountPassword(userAdd.Username, userAdd.Password); userAdd.Password = passwordEncrypt; var result = UserDA.AddUser(userAdd, GroupId); if (result > 0) { this.SetActionSuccess(true); ModuleMemoryData.MemoryData.GetCache_represent(); } return(this.SetActionResult(result, KnMessageCode.AddUserSuccess)); }
public ActionResult UpdatePass(decimal user_id, string user_name, string pass) { decimal _ck = -1; try { var userBL = new UserBL(); int re = userBL.DoResetPass(user_name, Encription.EncryptAccountPassword(user_name, pass), pass, user_name); return(Json(new { success = re })); } catch (Exception ex) { Logger.LogException(ex); } return(Json(new { success = _ck })); }
public ActionResult XacNhanKhachHangDK(decimal pID, string pEmail) { var lstUsers = new List <RegisterInfo>(); try { string _pass = CommonFunction.AppsCommon.CreateRandomString(10); var passwordEncrypt = Encription.EncryptAccountPassword(pEmail, _pass); UserBL objBL = new UserBL(); RegisterInfo pInfo = new RegisterInfo(); pInfo.Id = pID; pInfo.Modifiedby = SessionData.CurrentUser.Username; pInfo.ModifiedDate = SessionData.CurrentUser.CurrentDate; pInfo.KeySecret = passwordEncrypt; pInfo.Status = 1; int preturn = objBL.RegisterUpdate(pInfo); if (preturn >= 0) { Email_Info _Email_Info = new Email_Info { EmailFrom = EmailHelper.EmailOriginal.EMailFrom, Pass = EmailHelper.EmailOriginal.PassWord, Display_Name = EmailHelper.EmailOriginal.DisplayName, EmailTo = pEmail, EmailCC = "", Subject = "Email thông báo đăng ký mở tài khoản thành công", Content = "Dear Customer, Quí khách đăng ký thành công tài khoản username:"******" password:"******"\n quí khách vui lòng truy cập vào địa chỉ <a href='http://pathlaw.net/vi-vn/account/login'>http://pathlaw.net/vi-vn/account/login</a> để đổi mật khẩu của tài khoản. \n cảm ơn quí khách hàng. ", LstAttachment = new List <string>(), }; CommonFunction.AppsCommon.EnqueueSendEmail(_Email_Info); //EmailHelper.SendMail(pEmail, "", "Email thông báo đăng ký mở tài khoản thành công", "Dear Customer, Quí khách đăng ký thành công tài khoản username:"******" password:"******"\n quí khách vui lòng truy cập vào địa chỉ <a href='http://pathlaw.net/vi-vn/account/login'>http://pathlaw.net/vi-vn/account/login</a> để đổi mật khẩu của tài khoản. \n cảm ơn quí khách hàng. ", new List<string>()); } return(Json(new { status = preturn })); } catch (Exception ex) { Logger.LogException(ex); return(Json(new { status = -3 })); } }