Exemple #1
0
        public ActionResult Delete(int id)
        {
            Models.User deleteUser = Models.User.Find(id);
            deleteUser.Delete();

            return(RedirectToAction("ViewAll"));
        }
        public ActionResult Delete(string id, FormCollection collection)
        {
            try
            {
                Models.User user = new Models.User(id);
                user.Delete();

                return RedirectToAction("Index");
            }
            catch
            {
                return View(new Models.User(id));
            }
        }