public async Task <IActionResult> GetInventoryObjectSystemsAndPartsPartialInspection(int id) { string apiUrl = $"api/inventory/systems/byTypeId/{id}"; var httpClient = await _facilityManagementHttpClient.GetClient(); var response = await httpClient.GetAsync(apiUrl).ConfigureAwait(false); if (response.IsSuccessStatusCode) { var responseAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var compressorSystemsViewModel = new SystemsViewModel { InventoryObjectTypeId = id, Systems = JsonConvert.DeserializeObject <ICollection <InventoryObjectSystemDTO> >(responseAsString) }; return(PartialView("_SystemsPartialInspection", compressorSystemsViewModel)); } else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized || response.StatusCode == System.Net.HttpStatusCode.Unauthorized) { return(RedirectToAction("AccessDenied", "Authorization")); } throw new Exception($"A problem happened while calling the API: {response.ReasonPhrase}"); }
public DebuggerMainWindowViewModel(IDockingTabManager docking, SystemsViewModel systemsVM, ComponetsViewModel componetsVM) { OpenSceneInWindow = new WpfActionCommand(OnOpenSceneInWindow); ShowHideOctreeBoxesCommand = new WpfActionCommand(OnShowHideOctreeBoxes); Docking = docking; Systems = systemsVM; Componets = componetsVM; subscriber = new ViewportSubscriber(this); systemsVM.SetCurrentRenderUpdater(this); componetsVM.SetCurrentRenderUpdater(this); }