public async Task <IActionResult> Index(DateTime?planningDate)
        {
            return(await _resiliencyHelper.ExecuteResilient(async() =>
            {
                if (planningDate == null)
                {
                    planningDate = DateTime.Now.Date;
                }

                var model = new WorkshopManagementViewModel
                {
                    Date = planningDate.Value,
                    MaintenanceJobs = new List <MaintenanceJob>()
                };

                // get planning
                string dateStr = planningDate.Value.ToString("yyyy-MM-dd");
                WorkshopPlanning planning = await _workshopManagementAPI.GetWorkshopPlanning(dateStr);
                if (planning?.Jobs?.Count > 0)
                {
                    model.MaintenanceJobs.AddRange(planning.Jobs.OrderBy(j => j.StartTime));
                }

                return View(model);
            }, View("Offline", new WorkshopManagementOfflineViewModel())));
        }
Пример #2
0
 public async Task <IActionResult> Details(string id)
 {
     return(await _resiliencyHelper.ExecuteResilient(async() =>
     {
         var model = new CustomerManagementDetailsViewModel
         {
             Customer = await _customerManagementAPI.GetCustomerById(id)
         };
         return View(model);
     }, View("Offline", new CustomerManagementOfflineViewModel())));
 }
 public async Task <IActionResult> Index()
 {
     return(await resiliencyHelper.ExecuteResilient(async() =>
     {
         var model = new InventoryManagementViewModel
         {
             Inventories = await inventoryManagementAPI.GetInventory()
         };
         return View(model);
     }, View("Offline", new InventoryOfflineViewModel())));
 }
 public async Task <IActionResult> Index()
 {
     return(await _resiliencyHelper.ExecuteResilient(async() =>
     {
         var model = new VehicleManagementViewModel
         {
             Vehicles = await _vehicleManagementAPI.GetVehicles()
         };
         return View(model);
     }, View("Offline", new VehicleManagementOfflineViewModel())));
 }