示例#1
0
        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());
        }
示例#2
0
        // 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"));
        }
示例#3
0
        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());
        }