public ActionResult ChangePassword(AccountChangePassModel model) { //#region Permission //bool bPermission = _permissionService.PERMISSION(AccountIsAuthenticated(), ConfigPermission.ManagerAccount); //if (bPermission.Equals(false)) //{ // return RedirectToAction("Index", "Mainternance", new { area = "Admin" }); //} //#endregion model.ModifiedBy = AccountIsAuthenticated(); model.UserName = AccountIsAuthenticated(); MessageModel msg = _accountService.ChangePassword(model); ViewBag.message = Globals.ErrorMessage(msg.message, msg.result); return(View()); }
private MessageModel ValidateChangePass(AccountChangePassModel model) { var msgModel = new MessageModel(); if (model == null) { msgModel.result = false; msgModel.message = "Account Incorrect !"; } else if (model.PassNew != model.PassNew) { msgModel.result = false; msgModel.message = "Password Invalid, please check again !"; } else { msgModel.result = true; msgModel.message = ConstantsHandler.ErrorMessage.Message_OK; } return(msgModel); }
public MessageModel ChangePassword(AccountChangePassModel model) { var msgModel = new MessageModel(); try { msgModel = ValidateChangePass(model); if (msgModel.result.Equals(false)) { return(msgModel); } var mapper = Mapper.Map <AccountChangePassModel, AccountChangePassEntity>(model); var mapperEntity = _accountRepository.ChangePassword(mapper); msgModel = Mapper.Map <MessageEntity, MessageModel>(mapperEntity); } catch (Exception ex) { msgModel.result = false; msgModel.message = ConstantsHandler.ErrorMessage.Message_EX; Logger.ErrorLog(ConstantsHandler.ForderLogName.ServiceAccount, "ChangePassword : ", ex.ToString()); } return(msgModel); }