コード例 #1
0
        public async Task <IActionResult> Index()
        {
            var model = new CustomerManagementViewModel
            {
                Customers = await _customerManagementAPI.GetCustomers()
            };

            return(View(model));
        }
コード例 #2
0
 public async Task <IActionResult> Index()
 {
     return(await _resiliencyHelper.ExecuteResilient(async() =>
     {
         var model = new CustomerManagementViewModel
         {
             Customers = await _customerManagementAPI.GetCustomers()
         };
         return View(model);
     }, View("Offline", new CustomerManagementOfflineViewModel())));
 }
コード例 #3
0
 public async Task <IActionResult> Index()
 {
     return(await ExecuteWithFallback(async() =>
     {
         var model = new CustomerManagementViewModel
         {
             Customers = await _customerManagementAPI.GetCustomers()
         };
         return View(model);
     }));
 }
コード例 #4
0
        public async Task <IActionResult> Edit(string licenseNumber)
        {
            return(await _resiliencyHelper.ExecuteResilient(async() =>
            {
                // get customerlist
                var customers = await _customerManagementAPI.GetCustomers();

                Vehicle vehicle = await _vehicleManagementAPI.GetVehicleByLicenseNumber(licenseNumber);
                Customer customer = await _customerManagementAPI.GetCustomerById(vehicle.OwnerId);

                var model = new VehicleManagementEditViewModel
                {
                    Vehicle = vehicle,
                    SelectedCustomerId = customer.CustomerId,
                    Customers = customers.Select(c => new SelectListItem {
                        Value = c.CustomerId, Text = c.Name
                    })
                };
                return View(model);
            }, View("Offline", new VehicleManagementOfflineViewModel())));
        }
コード例 #5
0
        public async Task <IActionResult> New()
        {
            return(await ExecuteWithFallback(async() =>
            {
                // get customerlist
                var customers = await _customerManagementAPI.GetCustomers();

                var model = new VehicleManagementNewViewModel
                {
                    Vehicle = new Vehicle(),
                    Customers = customers.Select(c => new SelectListItem {
                        Value = c.CustomerId, Text = c.Name
                    })
                };
                return View(model);
            }));
        }
コード例 #6
0
        public async Task <IActionResult> New()
        {
            return(await _resiliencyHelper.ExecuteResilient(async() =>
            {
                // get customerlist
                var customers = await _customerManagementAPI.GetCustomers();

                var model = new VehicleManagementNewViewModel
                {
                    Vehicle = new Vehicle(),
                    Customers = customers.Select(c => new SelectListItem {
                        Value = c.CustomerId, Text = c.Name
                    })
                };
                return View(model);
            }, View("Offline", new VehicleManagementOfflineViewModel())));
        }
コード例 #7
0
 public async Task <List <Customer> > GetCustomers()
 {
     return(await _restClient.GetCustomers());
 }