Exemplo n.º 1
0
        public IActionResult OnGetReduce(long id)
        {
            var command = new ReduceInventory
            {
                InventoryId = id
            };

            return(Partial("Reduce", command));
        }
Exemplo n.º 2
0
        public IActionResult OnGetReduse(long id)
        {
            var Reduse = new ReduceInventory()
            {
                InventoryId = id
            };

            return(Partial("./Reduse", Reduse));
        }
Exemplo n.º 3
0
        public OperationResult Reduce(ReduceInventory command)
        {
            var operation = new OperationResult();
            var inventory = _inventoryRepository.Get(command.InventoryId);

            if (inventory == null)
            {
                return(operation.Failed(ApplicationMessages.RecordNotFound));
            }
            var operatorId = 1;

            inventory.Reduce(command.Count, operatorId, command.Description, 0);
            _inventoryRepository.SaveChanges();
            return(operation.Succedded());
        }
Exemplo n.º 4
0
        public OperationResult Reduce(ReduceInventory command)
        {
            var operationResult = new OperationResult();
            var inventory       = _inventoryRepo.Get(command.InventoryId);

            if (inventory == null)
            {
                return(operationResult.Failed(ApplicationMessage.recordNotFound));
            }

            const long OperationId = 1;

            inventory.Reduce(command.Count, OperationId, command.Description, 0);
            _inventoryRepo.Save();
            return(operationResult.Succeeded());
        }
Exemplo n.º 5
0
        public JsonResult OnPostReduce(ReduceInventory command)
        {
            var result = _inventoryApplication.Reduce(command);

            return(new JsonResult(result));
        }