public ActionResult ChangeRole() { IList<RefRole> role = AccountService.GetUserRole(User.UserId); var roleChooseViewModel = new RoleChooseViewModel() { RefUserId = User.UserId, RefEmpId = User.EmpId, listRole = role }; return PartialView("_ListChooseRole", roleChooseViewModel); }
public ActionResult Login(LoginViewModel loginViewModel) { //String a = SimpleHash.ComputeHash("ragil123", "SHA256", null); RefUser user = AccountService.GetUserByUserName(loginViewModel.UserName); if (ModelState.IsValid && user != null && Membership.ValidateUser(loginViewModel.UserName, loginViewModel.Password)) { IList<RefRole> role = AccountService.GetUserRole(user.RefUserId); var roleChooseViewModel = new RoleChooseViewModel() { RefUserId = user.RefUserId, RefEmpId = user.RefEmpId, listRole = role }; return PartialView("_ListChooseRole", roleChooseViewModel); } if (user != null && user.IsLockedOut == "1") { this.ShowNotification(NotificationType.Danger, "Your account is locked, contact your administrator"); return View(loginViewModel); } else if (user != null && user.IsActive == "0") { this.ShowNotification(NotificationType.Danger, "Your account is not active"); return View(loginViewModel); } else { this.ShowNotification(NotificationType.Danger, Resources.IncorrectUsernamePassword); return View(loginViewModel); } }