public ActionResult DeleteConfirmed(int id) { Catig catig = db.Catigs.Find(id); db.Catigs.Remove(catig); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,Name,Details")] Catig catig) { if (ModelState.IsValid) { db.Entry(catig).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(catig)); }
public ActionResult Create([Bind(Include = "id,Name,Details")] Catig catig) { if (ModelState.IsValid) { db.Catigs.Add(catig); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(catig)); }
// GET: /Catig/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Catig catig = db.Catigs.Find(id); if (catig == null) { return(HttpNotFound()); } return(View(catig)); }