Example #1
0
 public ActionResult Delete(UserVm.Delete model)
 {
     if (ModelState.IsValid)
     {
         TheUserManager.DeleteUser(model.UserId);
         GetAlert(Success, "User deleted!");
         return(RedirectToAction("Index"));
     }
     GetAlert(Danger, "Error!");
     return(View("Delete", model));
 }
        public ActionResult Delete(Guid id)
        {
            var user = _userSvc.GetById(id);

            if (user == null)
            {
                GetAlert(Danger, "User cannot be found!");
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
            var model = new UserVm.Delete()
            {
                UserId           = user.UserId,
                UserName         = user.UserName,
                UserFirstName    = user.FirstName,
                UserLastName     = user.LastName,
                UserAlias        = user.Alias,
                EmailAddress     = user.EmailAddress,
                UserLoginEnabled = user.LoginEnabled
            };

            return(View("Delete", model));
        }
Example #3
0
        public ActionResult Delete(Guid?id)
        {
            if (id == null)
            {
                GetAlert(Danger, "ID cannot be null!");
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var user = TheUserManager.GetUserById(id);

            if (user == null)
            {
                GetAlert(Danger, "User cannot be found!");
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
            var model = new UserVm.Delete()
            {
                UserId      = user.UserId,
                UserName    = user.Name,
                UserEnabled = user.Enabled,
                UserLocked  = user.Locked
            };

            return(View("Delete", model));
        }