public ActionResult DeleteConfirmed(int id) { MealPlanCategory mealPlanCategory = db.MealPlanCategories.Find(id); db.MealPlanCategories.Remove(mealPlanCategory); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MealPlanCategoryId,Description,Active,Created")] MealPlanCategory mealPlanCategory) { if (ModelState.IsValid) { db.Entry(mealPlanCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mealPlanCategory)); }
public ActionResult Create([Bind(Include = "MealPlanCategoryId,Description,Active")] MealPlanCategory mealPlanCategory) { if (ModelState.IsValid) { mealPlanCategory.Created = DateTime.Now; db.MealPlanCategories.Add(mealPlanCategory); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mealPlanCategory)); }
// GET: MealPlanCategory/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MealPlanCategory mealPlanCategory = db.MealPlanCategories.Find(id); if (mealPlanCategory == null) { return(HttpNotFound()); } return(View(mealPlanCategory)); }
// GET: MealPlanCategory/Create public ActionResult Create() { MealPlanCategory mealPlanCategory = new MealPlanCategory(); return(View(mealPlanCategory)); }