public IActionResult OnGetDecrease(long id) { var decrease = new DecreaseInventory { InventoryId = id }; return(Partial("Decrease", decrease)); }
public IActionResult OnGetDecrement(long id) { var decreaseInventory = new DecreaseInventory() { InventoryId = id }; return(Partial("Decrement", decreaseInventory)); }
public IActionResult OnPostDecrement(DecreaseInventory command) { var operationResult = new OperationResult(); if (ModelState.IsValid) { operationResult = _inventoryApplication.Decrease(command); } return(new JsonResult(operationResult)); }
public OperationResult Decrease(DecreaseInventory command) { var operationResult = new OperationResult(); var inventory = _inventoryRepository.Get(command.InventoryId); if (inventory == null) { return(operationResult.Failed(QueryValidationMessage.NotFound)); } inventory.Decrease(command.Count, 1, command.Description, 0); _inventoryRepository.SaveChanges(); return(operationResult.Succeeded()); }
public OperationResult Decrease(DecreaseInventory command) { var operation = new OperationResult(); var inventory = _inventoryRepository.Get(command.InventoryId); if (inventory == null) { return(operation.Failed(ApplicationMessages.RecordNotFound)); } var operatorId = _authHelper.CurrentAccountId(); inventory.Decrease(command.Count, operatorId, command.Description, 0); _inventoryRepository.SaveChanges(); return(operation.Succedded()); }
public JsonResult OnPostDecrease(DecreaseInventory command) { var result = _inventoryApplication.Decrease(command); return(new JsonResult(result)); }