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