public ActionResult DeleteConfirmed(int id) { SharjCategory sharjcategory = context.SharjCategories.Single(x => x.ID == id); context.SharjCategories.Remove(sharjcategory); context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(SharjCategory sharjcategory) { if (ModelState.IsValid) { context.Entry(sharjcategory).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index")); } return(View(sharjcategory)); }
public ActionResult Create(SharjCategory sharjcategory) { if (ModelState.IsValid) { context.SharjCategories.Add(sharjcategory); context.SaveChanges(); return(RedirectToAction("Index")); } return(View(sharjcategory)); }
// // GET: /SharjCategory/Delete/5 public ActionResult Delete(int id) { SharjCategory sharjcategory = context.SharjCategories.Single(x => x.ID == id); return(View(sharjcategory)); }
// // GET: /SharjCategory/Details/5 public ViewResult Details(int id) { SharjCategory sharjcategory = context.SharjCategories.Single(x => x.ID == id); return(View(sharjcategory)); }