public async Task <IActionResult> Edit(int id, [Bind("Id,TypeOfTransport,CarrierName,ConfirmationNumber,DepartureAddress,DepartureSuburb,DepartureCity,DepartureRegion,DeparturePostcode,DepartureCountry,DepartureDate,DepartureTime,ArrivalDate,ArrivalTime,ArrivalAddress,ArrivalSuburb,ArrivalCity,ArrivalRegion,ArrivalPostcode,ArrivalCountry,TripId")] OtherTransportation otherTransportation) { if (id != otherTransportation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(otherTransportation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OtherTransportationExists(otherTransportation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Details", new { otherTransportation.Id })); } return(View(otherTransportation)); }
public async Task <IActionResult> Create([Bind("Id,TypeOfTransport,CarrierName,ConfirmationNumber,DepartureAddress,DepartureSuburb,DepartureCity,DepartureRegion,DeparturePostcode,DepartureCountry,DepartureDate,DepartureTime,ArrivalDate,ArrivalTime,ArrivalAddress,ArrivalSuburb,ArrivalCity,ArrivalRegion,ArrivalPostcode,ArrivalCountry,TripId")] OtherTransportation otherTransportation) { if (ModelState.IsValid) { _context.Add(otherTransportation); await _context.SaveChangesAsync(); return(RedirectToAction("Details", new { otherTransportation.Id })); } return(View(otherTransportation)); }