public ActionResult DeleteConfirmed(short id) { EventDetailStatu eventDetailStatu = db.EventDetailStatus.Find(id); db.EventDetailStatus.Remove(eventDetailStatu); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "EventDetailStatusID,EvenDetailStatusName")] EventDetailStatu eventDetailStatu) { if (ModelState.IsValid) { db.Entry(eventDetailStatu).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(eventDetailStatu)); }
public ActionResult Create([Bind(Include = "EventDetailStatusID,EvenDetailStatusName")] EventDetailStatu eventDetailStatu) { if (ModelState.IsValid) { db.EventDetailStatus.Add(eventDetailStatu); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(eventDetailStatu)); }
// GET: EventDetailStatus/Delete/5 public ActionResult Delete(short?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EventDetailStatu eventDetailStatu = db.EventDetailStatus.Find(id); if (eventDetailStatu == null) { return(HttpNotFound()); } return(View(eventDetailStatu)); }
// GET: EventDetailStatus/Edit/5 public ActionResult Edit(short?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EventDetailStatu @event = db.EventDetailStatus.Find(id); if (@event == null) { return(HttpNotFound()); } return(View(@event)); }
public ActionResult DeleteEvent(int[] EventIDs) { try { using (HollywoodTestEntities1 entities = new HollywoodTestEntities1()) { foreach (int EventId in EventIDs) { EventDetailStatu events = (from Ev in entities.EventDetailStatus where Ev.EventDetailStatusID == EventId select Ev).FirstOrDefault(); entities.EventDetailStatus.Remove(events); } entities.SaveChanges(); } return(new EmptyResult()); } catch { return(View()); } }