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