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