public IHttpActionResult PutTrip(int id, Trip trip) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != trip.TripID) { return(BadRequest()); } db.Entry(trip).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TripExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "BusID,Capacity,Company,Class")] Bus bus) { if (ModelState.IsValid) { db.Entry(bus).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bus)); }
public ActionResult Edit([Bind(Include = "ClientID,Name,Surname,Birthdate,Email")] Client client) { if (ModelState.IsValid) { db.Entry(client).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(client)); }
public ActionResult Edit([Bind(Include = "CityID,CityName")] City city) { if (ModelState.IsValid) { db.Entry(city).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(city)); }
public ActionResult Edit([Bind(Include = "SeatID,BusID")] Seat seat) { if (ModelState.IsValid) { db.Entry(seat).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(seat)); }
public ActionResult Edit([Bind(Include = "ID,Name,Brand,Color,Seats")] Bus bus) { if (ModelState.IsValid) { db.Entry(bus).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bus)); }
public ActionResult Edit([Bind(Include = "BookingID,ClientID,SeatID,BusID,TripID")] Booking booking) { if (ModelState.IsValid) { db.Entry(booking).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClientID = new SelectList(db.Clients, "ClientID", "Name", booking.ClientID); ViewBag.SeatID = new SelectList(db.Seats, "SeatID", "SeatID", booking.SeatID); ViewBag.TripID = new SelectList(db.Trips, "TripID", "TripID", booking.TripID); return(View(booking)); }
public ActionResult Edit([Bind(Include = "TripID,BusID,OriginID,DestinationID,Price,DateTimeTrip")] Trip trip) { if (ModelState.IsValid) { db.Entry(trip).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BusID = new SelectList(db.Buses, "BusID", "Company", trip.BusID); ViewBag.DestinationID = new SelectList(db.Cities, "CityID", "CityName", trip.DestinationID); ViewBag.OriginID = new SelectList(db.Cities, "CityID", "CityName", trip.OriginID); return(View(trip)); }
public ActionResult BusEdit(Bus bus) { db.Entry(bus).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("BusesList")); }