public IActionResult OnGetDecrease(long id) { var model = new DecreaseInventoryVM() { Id = id }; return(Partial("Decrease", model)); }
public OperationResult Decrease(DecreaseInventoryVM command) { OperationResult result = new OperationResult(); var inventory = _inventoryRepository.Get(command.Id); if (inventory == null) { return(result.Failed(ValidateMessage.IsExist)); } var operatorId = _authHelper.GetUserId(); inventory.Decrease(command.Count, operatorId, command.OrderId, command.Description); _inventoryRepository.SaveChanges(); return(result.Succeeded()); }
public IActionResult OnPostDecrease(DecreaseInventoryVM command) { var result = _inventoryApplication.Decrease(command); return(new JsonResult(result)); }