// GET: Class/Delete/5 public ActionResult Delete(int id) { //if (id == null) return new HttpStatusCodeResult(HttpStatusCode.BadRequest); vClass theClass = db.vClasses.Find(id); if (theClass == null) { return(HttpNotFound()); } return(View(theClass)); }
public ActionResult Delete(vClass theClass) { if (ModelState.IsValid) { try { db.vClasses.Remove(theClass); db.SaveChanges(); return(RedirectToAction("Index")); } catch { ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator."); } } return(View(theClass)); }
// GET: Class/Create public ActionResult Create() { vClass theClass = new vClass(); return(View(theClass)); }