public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } CarRentInformation = await _carRentInformationService.GetSingleById(id.Value); if (CarRentInformation == null) { return(NotFound()); } return(Page()); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { CarRentInformation = await _carRentInformationService.GetSingleById(CarRentInformationId); await LoadList(); return(Page()); } VehicleCheck.EmployeeId = 1; VehicleCheck.CarRentInformationId = CarRentInformationId; await _vehicleCheckService.Create(VehicleCheck); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } VehicleCheck = await _vehicleCheckService.GetSingleById(id.Value); if (VehicleCheck == null) { return(NotFound()); } CarRentInformation = VehicleCheck.CarRentInformation; await LoadList(); return(Page()); }