public ActionResult Edit([Bind(Include = "ScheduleId,ShipmentDate,FromLocation,ToLocation,Rate,EarliestDeparture,Status,VesselsID")] Schedule schedule) { if (ModelState.IsValid) { db.Entry(schedule).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(schedule)); }
public ActionResult Edit([Bind(Include = "BookingId,Cargo,ContainerType,ScheduleId,UsersId")] ScheduleBooking scheduleBooking) { if (ModelState.IsValid) { db.Entry(scheduleBooking).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ScheduleId = new SelectList(db.Schedules, "ScheduleId", "FromLocation", scheduleBooking.ScheduleId); ViewBag.UsersId = new SelectList(db.Users, "UsersId", "Username", scheduleBooking.UsersId); return(View(scheduleBooking)); }