public IActionResult DeactivateAdmin(int adminId, DeactivateAdminViewModel model) { if (!ModelState.IsValid) { return(View(model)); } userDataService.DeactivateAdmin(adminId); return(View("DeactivateAdminConfirmation")); }
public IActionResult DeactivateOrDeleteAdmin(int adminId, DeactivateAdminViewModel model) { var adminUser = userDataService.GetAdminUserById(adminId); if (!CurrentUserCanDeactivateAdmin(adminUser !)) { return(NotFound()); } if (!ModelState.IsValid) { return(View(model)); } userService.DeactivateOrDeleteAdmin(adminId); return(View("DeactivateOrDeleteAdminConfirmation")); }