public ActionResult DeleteConfirmed(int id) { CDSEvent cDSEvent = db.CDSEvents.Find(id); db.CDSEvents.Remove(cDSEvent); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "eventID,title,createdBy,dateStart,dateEnd,eventTypeID,groupID,createdOn,modifiedOn,modifiedBy,doubleDateRequestID,description,eventStatusID")] CDSEvent cDSEvent) { if (ModelState.IsValid) { db.Entry(cDSEvent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.doubleDateRequestID = new SelectList(db.DoubleDateRequest, "doubleDateRequestID", "memo", cDSEvent.doubleDateRequestID); ViewBag.eventStatusID = new SelectList(db.EventStatus, "EventStatusID", "Description", cDSEvent.eventStatusID); ViewBag.eventTypeID = new SelectList(db.EventType, "eventTypeID", "description", cDSEvent.eventTypeID); ViewBag.groupID = new SelectList(db.Group, "groupID", "name", cDSEvent.groupID); return(View(cDSEvent)); }
// GET: CDSEvents/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CDSEvent cDSEvent = db.CDSEvents.Find(id); if (cDSEvent == null) { return(HttpNotFound()); } return(View(cDSEvent)); }
// GET: CDSEvents/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CDSEvent cDSEvent = db.CDSEvents.Find(id); if (cDSEvent == null) { return(HttpNotFound()); } ViewBag.doubleDateRequestID = new SelectList(db.DoubleDateRequest, "doubleDateRequestID", "memo", cDSEvent.doubleDateRequestID); ViewBag.eventStatusID = new SelectList(db.EventStatus, "EventStatusID", "Description", cDSEvent.eventStatusID); ViewBag.eventTypeID = new SelectList(db.EventType, "eventTypeID", "description", cDSEvent.eventTypeID); ViewBag.groupID = new SelectList(db.Group, "groupID", "name", cDSEvent.groupID); return(View(cDSEvent)); }