public ActionResult Deactivate(DeactivateUserModel model) { return(ValidatedCommandResult(model, new DeactivateUserCommand(_authenticationService.Identity, model.Password), () => { _authenticationService.SignOut(); return RedirectToAction("Index"); })); }
public ActionResult ActivateAUser(DeactivateUserModel userDetails) { try { OperationsOnDatabase odb = new OperationsOnDatabase(); odb.ActivateUser(userDetails.SelectedUserName); return(RedirectToAction("successPage")); } catch (Exception e) { log.Error("Prolem while deactivating the user" + e.Message); return(View("ErrorLogin")); } }
public ActionResult ActivateAUser() { DatabaseModel dbm = new DatabaseModel(); DeactivateUserModel dm = new DeactivateUserModel(); List <string> usernames = new List <string>(); foreach (var person in dbm.Person.ToList()) { if (person.UserStatus == "Inactive") { usernames.Add(person.Username); } } dm.Usernames = new SelectList(usernames); return(View(dm)); }