// GET: ClientUsers/Delete/5
 public ActionResult Delete(int id, bool?saveChangesError)
 {
     if (saveChangesError.GetValueOrDefault())
     {
         ViewBag.ErrorMessage = "Unable to save changes. Try again, and if the problem persists see your system administrator.";
     }
     return(View(ClientUserMethods.GetItem(id)));
 }
        // GET: ClientUsers/Edit/5
        public ActionResult Edit(int id)
        {
            ClientUser client = ClientUserMethods.GetItem(id);

            if (client == null)
            {
                return(HttpNotFound());
            }
            return(View(client));
        }
        // GET: ClientUsers/Details/5
        public ActionResult Details(int id)
        {
            ClientUser clientUser = ClientUserMethods.GetItem(id);

            if (clientUser == null)
            {
                return(HttpNotFound());
            }
            return(View(clientUser));
        }
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         ClientUserMethods.DeleteItem(id);
     }
     catch (DataException)
     {
         return(RedirectToAction("Delete",
                                 new System.Web.Routing.RouteValueDictionary {
             { "id", id },
             { "saveChangesError", true }
         }));
     }
     return(RedirectToAction("Index"));
 }
 public ActionResult Edit(ClientUser client)
 {
     try
     {
         if (ModelState.IsValid)
         {
             ClientUserMethods.ChangeItem(client);
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException)
     {
         //Log the error (add a variable name after DataException)
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
     }
     return(View(client));
 }
 // GET: ClientUsers
 public ActionResult Index()
 {
     return(View(ClientUserMethods.Outpoot().ToList()));
 }