Beispiel #1
0
 public ActionResult Admin(string status)
 {
     ViewData["Message"] = status;
     GetUsersBase();
     DeleteUserModel = new DeleteModel();
     return View();
 }
Beispiel #2
0
 public bool DeleteUser(DeleteModel model)
 {
     dbHelper.Configure();
     IList<UserInfo> list = DbHelper.FindContacts(model.Login);
     if (list.Count == 0)
     {
         return false;
     }
     DbHelper.DeleteUserInfo(list[0]);
     return true;
 }
Beispiel #3
0
        public ActionResult AdminDeleteUser(DeleteModel model)
        {
            try
            {
                if ((ModelState.IsValid == false) || (model.Login == null) || (AdminHelper.DeleteUser(model) == false))
                {
                    ViewData["Message"] = ViewResource.SharedStrings.OperationError;
                    return RedirectToAction("Admin", "Admin");
                }

                ViewData["Message"] = ViewResource.SharedStrings.OperationComplete;
                return RedirectToAction("Admin", "Admin");
            }
            catch (Exception e)
            {
                ViewData["Error"] = e.Message;
            }
            return RedirectToAction("Admin", "Admin");
        }