public async Task <IActionResult> OnPostUpdate(List <DateTime> dateTo, List <TimeSpan> actualArrival, List <TimeSpan> startLoading, List <TimeSpan> endLoading, List <string> id) { var counter = 0; foreach (var GuidID in id) { var bookingToUpdate = await bookingDataService.GetBookingById(Guid.Parse(GuidID)); bookingToUpdate.ActualArrival = new DateTime(dateTo[counter].Year, dateTo[counter].Month, dateTo[counter].Day, actualArrival[counter].Hours, actualArrival[counter].Minutes, 0); bookingToUpdate.StartLoading = new DateTime(dateTo[counter].Year, dateTo[counter].Month, dateTo[counter].Day, startLoading[counter].Hours, startLoading[counter].Minutes, 0); bookingToUpdate.EndLoading = new DateTime(dateTo[counter].Year, dateTo[counter].Month, dateTo[counter].Day, endLoading[counter].Hours, endLoading[counter].Minutes, 0); var response = await bookingDataService.UpdateBooking(CreateUpdateBookingCommand(bookingToUpdate)); counter++; } return(new RedirectToPageResult("BookingOverview")); }
public async Task OnGetAsync(string id) { Booking = new BookingViewModel(); Booking = await bookingDataService.GetBookingById(Guid.Parse(id)); Booking = BookingUtil.RemoveDates(Booking); ArrivalHour = Booking.ActualArrival.Hour; ArrivalMinute = Booking.ActualArrival.Minute; StartMinute = Booking.StartLoading.Minute; EndMinute = Booking.EndLoading.Minute; StartHour = Booking.StartLoading.Hour; EndHour = Booking.EndLoading.Hour; }
public async Task OnGet() { Booking = await _bookingDataService.GetBookingById(Guid.Parse("3f6793b9-fa5e-4e94-aebb-04eb4e4d6cb8")); }
public async Task OnGetAsync(string id) { Booking = await _bookingDataService.GetBookingById(Guid.Parse(id)); }