public RegisterBillOfLadingCommand Build()
        {
            CheckValidState();

            _command.Rows = _rows.ToArray();
            var cmd = _command;
            _command = null;
            return cmd;
        }
Beispiel #2
0
        public RegisterBillOfLadingCommand Build()
        {
            CheckValidState();

            _command.Rows = _rows.ToArray();
            var cmd = _command;

            _command = null;
            return(cmd);
        }
        public void RegisterBillOfLading(RegisterBillOfLadingCommand command)
        {
            _debug.Debug("[purchases] Handling registration of new Bill of lading");
            var bol = new BillOfLading(command.Id, command.Number,command.IssueDate,DateTime.Today);
            
            bol.SetSupplier(command.SupplierCompanyName, command.SupplierAddress);
            foreach (var row in command.Rows)
            {
                bol.AddDetail(row.ItemId, row.Sku, row.Description, row.Quantity);
            }

            bol.Confirm();
            
            _repository.Save(bol, command.Id);
            _debug.Debug("[purchases] Bill of lading confirmed");
        }
 public RegisterBillOfLadingCommandBuilder(Guid commandId)
 {
     _command = new RegisterBillOfLadingCommand(commandId);
     _rows = new List<RegisterBillOfLadingCommand.Row>();
 }
Beispiel #5
0
 public RegisterBillOfLadingCommandBuilder(Guid commandId)
 {
     _command = new RegisterBillOfLadingCommand(commandId);
     _rows    = new List <RegisterBillOfLadingCommand.Row>();
 }