// GET: Assets public ActionResult Inventory() { ViewData["AssetsManagement"] = "active"; var inventories = assetsManagementService.GetSiteInventories(); return(View(inventories)); }
public IHttpActionResult PostInventory(SiteInventory inventory) { if (inventory == null) { return(BadRequest("inventory must be passed to the body of the http request")); } try { inventory.CreatedDate = DateTime.Now; assetsManagementService.CreateSiteInventory(inventory); var inventories = assetsManagementService.GetSiteInventories(); var html = Helpers.RenderPartial("~/Views/Shared/Partial/Assets/InventoryList.cshtml", inventories); return(Ok(html)); } catch (Exception ex) { return(InternalServerError(ex)); } }