partial void OnHandle(CheckInItemsToInventoryCommand command)
        {
            InventoryItem item = UnitOfWork.Get <InventoryItem>(command.Rsn);

            item.CheckIn(command.Count);
            UnitOfWork.Commit();
        }
Ejemplo n.º 2
0
        public HttpResponseMessage Post(Guid id, CheckInItemsToInventoryCommand checkInItemsToInventory)
        {
            _bus.Send(new CheckInItemsToInventory(id,
                                                  checkInItemsToInventory.Count
                                                  ));

            return(Request.CreateResponse(HttpStatusCode.Accepted));
        }
Ejemplo n.º 3
0
        public void Handle(CheckInItemsToInventoryCommand command)
        {
            var item = _repository.GetById(command.InventoryItemId);

            item.CheckIn(command.Count);

            _repository.Save(item, command.OriginalVersion);
        }
Ejemplo n.º 4
0
        public void Handle(CheckInItemsToInventoryCommand command)
        {
            var item = _repository.GetById(command.InventoryItemId);

            item.CheckIn(command.Count);

            _repository.Save(item, command.OriginalVersion);
        }
Ejemplo n.º 5
0
        partial void OnCheckIn(IServiceRequestWithData <ISingleSignOnToken, InventoryItemServiceCheckInParameters> serviceRequest, ref IServiceResponse results)
        {
            UnitOfWorkService.SetCommitter(this);
            InventoryItemServiceCheckInParameters item = serviceRequest.Data;

            // The use of Guid.Empty is simply because we use ints as ids
            var command = new CheckInItemsToInventoryCommand(item.rsn, item.count);

            CommandSender.Send(command);

            UnitOfWorkService.Commit(this);
            results = new ServiceResponse();
        }