private async Task <VehicleVM> listChosen(string token, VehicleModelMVC vehicleModelMVC)
        {
            var customers = await _customerServiceApiClient.GetAll(token);

            var makes = await _makeServiceApiClient.GetAll(token);

            var models = await _modelServiceApiClient.GetAll(token);

            var appusers = await _userServiceApiClient.GetAll(token);

            vehicleModelMVC.CustomerVMs = customers;
            vehicleModelMVC.MakeVMs     = makes;
            vehicleModelMVC.ModelVMs    = models;
            vehicleModelMVC.AppUserVMs  = appusers.Select(x => x.appUserVM).ToList();
            return(vehicleModelMVC);
        }
Пример #2
0
        public async Task <IActionResult> index()
        {
            string token       = HttpContext.Session.GetString("token_access");
            var    customerVMs = await _customerServiceApiClient.GetAll(token);

            var vehicleVMs = await _vehicleServiceApiClient.GetAllNotBuy(token);

            var userVMs = await _userServiceApiClient.GetAll(token);

            var dashboard = new DashBoardModelMVC
            {
                ListAppuserVM  = userVMs.Select(x => x.appUserVM).ToList(),
                ListCustomerVM = customerVMs,
                ListVehicleVM  = vehicleVMs
            };

            if (TempData["SuccessResult"] != null)
            {
                ViewBag.SuccessMsg = TempData["SuccessResult"];
            }
            return(View(dashboard));
        }