public ActionResult DeleteConfirmed(int id) { PreSchedule preSchedule = db.PreSchedules.Find(id); db.PreSchedules.Remove(preSchedule); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PreId,RefNum,ContainerSize,pickupLocation,dropoffLocation,transportType,start,end,transit,Booked,id")] PreSchedule preSchedule) { if (ModelState.IsValid) { db.Entry(preSchedule).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id = new SelectList(db.Resources, "id", "statusResource", preSchedule.id); return(View(preSchedule)); }
// GET: PreSchedules/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PreSchedule preSchedule = db.PreSchedules.Find(id); if (preSchedule == null) { return(HttpNotFound()); } return(View(preSchedule)); }
// GET: PreSchedules/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PreSchedule preSchedule = db.PreSchedules.Find(id); if (preSchedule == null) { return(HttpNotFound()); } ViewBag.id = new SelectList(db.Resources, "id", "statusResource", preSchedule.id); return(View(preSchedule)); }