public ActionResult InventoryDetails(int id) { ViewData["AssetsManagement"] = "active"; var viewModel = new InventoryDetailsViewModel() { Inventory = assetsManagementService.GetSiteInventory(id), InventoryItems = assetsManagementService.GetSiteInventoryItemsByInventoryId(id) }; return(View(viewModel)); }
public IHttpActionResult GetItemsByInventoryId(int inventoryId) { if (inventoryId <= 0) { return(BadRequest("inventory Id cannot be found in the request body")); } try { return(Ok(assetsManagementService.GetSiteInventoryItemsByInventoryId(inventoryId))); } catch (Exception ex) { return(InternalServerError(ex)); } }