public ActionResult Deactivate(DeactivateUserModel model)
 {
     return(ValidatedCommandResult(model,
                                   new DeactivateUserCommand(_authenticationService.Identity, model.Password),
                                   () => {
         _authenticationService.SignOut();
         return RedirectToAction("Index");
     }));
 }
Esempio n. 2
0
 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"));
     }
 }
Esempio n. 3
0
        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));
        }