Ejemplo n.º 1
0
 public override void SetUp()
 {
     base.SetUp();
     helper    = new ReceivedBatchTestHelper(operatorSource);
     viewModel = new ReceivingManagementViewModel(validator, colorList, receivingSource, operatorSource, inventorySource);
     command   = new RemoveReceivableBatchFromSessionLedgerCommand(viewModel);
 }
        public ReceivingManagementViewModel(
            IBatchNumberValidator validator,
            IColorList colorList,
            IReceivedBatchSource receivingSource,
            IBatchOperatorSource operatorSource,
            IActiveInventorySource inventorySource)
        {
            this.receivingSource = receivingSource;
            this.operatorSource  = operatorSource;
            this.inventorySource = inventorySource;
            this.colorList       = colorList;
            batchNumberValidator = validator;

            this.operatorSource.FindAllBatchOperators();
            ReceivedBatchRepository                     = this.receivingSource.ReceivedBatchRepository;
            BatchOperatorRepository                     = this.operatorSource.OperatorRepository;
            SessionLedger                               = new ObservableCollection <ReceivedBatch>();
            SessionLedgerSelectedIndex                  = -1;
            ReceivedBatch                               = new ReceivedBatch();
            ReceivingDate                               = DateTime.Today;
            AddBatchToSessionLedgerCommand              = new AddReceivedBatchToReceivingSessionLedgerCommand(this);
            RemoveSelectedItemFromSessionLedgerCommand  = new RemoveReceivableBatchFromSessionLedgerCommand(this);
            CommitSessionLedgerToReceivingLedgerCommand = new CommitReceivingSessionLedgerToDataSourceCommand(this);
        }