public IActionResult OnGetDecrease(long id) { var decrease = new InventoryDecrease { InventoryId = id }; return(Partial("./Decrease", decrease)); }
public OperationResult Decrease(InventoryDecrease decrease) { var operation = new OperationResult(); var inventory = _inventoryRepository.GetById(decrease.InventoryId); if (inventory == null) { return(operation.Fail(ApplicationMessages.NotFoundRecord)); } const long operatorId = 0; inventory.Decrease(decrease.Count, operatorId, decrease.Description, 0); _inventoryRepository.SaveChanges(); return(operation.Success()); }
public JsonResult OnPostDecrease(InventoryDecrease decrease) { var result = _inventoryApplication.Decrease(decrease); return(new JsonResult(result)); }