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