예제 #1
0
        public IActionResult OnGetIncrease(long id)
        {
            var model = new IncreaseInventoryVM()
            {
                InventoryId = id,
            };

            return(Partial("Increase", model));
        }
        public OperationResult Increase(IncreaseInventoryVM command)
        {
            OperationResult result = new OperationResult();

            var inventory = _inventoryRepository.Get(command.InventoryId);

            if (inventory == null)
            {
                return(result.Failed(ValidateMessage.IsExist));
            }

            var operatorId = _authHelper.GetUserId();

            inventory.Increase(command.Count, operatorId, command.Description);
            _inventoryRepository.SaveChanges();

            return(result.Succeeded());
        }
예제 #3
0
        public IActionResult OnPostIncrease(IncreaseInventoryVM command)
        {
            var result = _inventoryApplication.Increase(command);

            return(new JsonResult(result));
        }