コード例 #1
0
        public IActionResult DeactivateAdmin(int adminId, DeactivateAdminViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            userDataService.DeactivateAdmin(adminId);

            return(View("DeactivateAdminConfirmation"));
        }
コード例 #2
0
        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"));
        }