Пример #1
0
        public async Task <IActionResult> Index()
        {
            var allBranchesWithCriticalVehicleData = await this.branchesService.AllAsync();

            if (allBranchesWithCriticalVehicleData.Count() <= 0 || allBranchesWithCriticalVehicleData == null)
            {
                return(this.NotFound());
            }

            var expireViewModel = new List <ListExpireDataForAllBranchesViewModel>();

            foreach (var branch in allBranchesWithCriticalVehicleData)
            {
                var collectEpireData = new ListExpireDataForAllBranchesViewModel()
                {
                    BranchId    = branch.Id,
                    FullAddress = branch.FullAddress,
                    VehiclesWithExpirePolicy =
                        (await this.vehicleService.GetInsuranceExpireDataAsync(branch.Id)).ToList(),
                    VehiclesWithExpireVignettes =
                        (await this.vehicleService.GetVignetteExpireDataAsync(branch.Id)).ToList(),
                    VehiclesWithOilChangeDistance =
                        (await this.vehicleService.GetOilChangeExpireDataAsync(branch.Id)).ToList(),
                    VehiclesWithInspectionExpire =
                        (await this.vehicleService.GetInspectionSafetyCheckExpireDataAsync(branch.Id)).ToList()
                };

                expireViewModel.Add(collectEpireData);
            }

            //ViewData["NavMenuPage"] = "Index";

            return(View(expireViewModel));
        }
Пример #2
0
        public IActionResult ExpireOilChangeDistance(string branchFullAddress, IList <VehicleListingChangeOilServiceModel> vehicles)
        {
            if (branchFullAddress == null || vehicles == null)
            {
                return(this.BadRequest());
            }

            var vehiclesWithExprireData = new ListExpireDataForAllBranchesViewModel
            {
                FullAddress = branchFullAddress,
                VehiclesWithOilChangeDistance = vehicles,
                TypeOfExpire = OilCheckExpire
            };

            return(this.View(vehiclesWithExprireData));
        }
Пример #3
0
        public IActionResult ExpireInspectionSafetyCheck(string branchFullAddress, IList <VehicleListingInspectionSafetyCheckServiceModel> vehicles)
        {
            if (branchFullAddress == null || vehicles == null)
            {
                return(this.BadRequest());
            }

            var vehiclesWithExprireData = new ListExpireDataForAllBranchesViewModel
            {
                FullAddress = branchFullAddress,
                VehiclesWithInspectionExpire = vehicles,
                TypeOfExpire = InspectionCheckExpire
            };

            return(this.View(vehiclesWithExprireData));
        }
Пример #4
0
        public IActionResult ExpireVignettes(string branchFullAddress, IList <VehicleListExpireVignetteServiceModel> vehicles)
        {
            if (branchFullAddress == null || vehicles == null)
            {
                return(this.BadRequest());
            }

            var vehiclesWithExprireData = new ListExpireDataForAllBranchesViewModel
            {
                FullAddress = branchFullAddress,
                VehiclesWithExpireVignettes = vehicles,
                TypeOfExpire = VignetteExpire
            };

            return(this.View(vehiclesWithExprireData));
        }