Example #1
0
 public SQLiteImplementedBatchSource(SQLiteStoreContext sqliteStore, IActiveInventorySource inventorySource)
 {
     this.sqliteStore           = sqliteStore;
     this.inventorySource       = inventorySource;
     ImplementedBatchLedger     = new ObservableCollection <LoggedBatch>();
     ImplementedBatchIdMappings = new Dictionary <int, int>();
 }
Example #2
0
 public ReceivedPurchaseOrderEditorViewModel(
     EditablePurchaseOrder purchaseOrder,
     IColorList colorList,
     IBatchNumberValidator batchNumberValidator,
     IBatchOperatorSource operatorSource,
     IActiveInventorySource inventorySource,
     IReceivedBatchSource receivedBatchSource,
     IImplementedBatchSource implementedBatchSource
     )
 {
     this.purchaseOrder          = purchaseOrder;
     this.operatorSource         = operatorSource;
     this.inventorySource        = inventorySource;
     this.receivedBatchSource    = receivedBatchSource;
     this.implementedBatchSource = implementedBatchSource;
     receivedBatches             = new ObservableCollection <ReceivedBatch>();
     ReceivedBatch = new ReceivedBatch();
     ImportPurchaseOrderInformation();
     UpdateReceivedBatchCommand    = new UpdatePurchaseOrderReceivingRecordCommand(this);
     UpdatePurchaseOrderCommand    = new UpdatePurchaseOrderHeaderCommand(this);
     DeleteReceivingRecordCommand  = new DeletePurchaseOrderReceivingRecordCommand(this);
     ReceivedBatchSelectionChanged = new ReceivedBatchForEditingSelectionChangedCommand(this);
     UpdateText                   = "Save Item";
     this.colorList               = colorList;
     this.batchNumberValidator    = batchNumberValidator;
     SelectedColorIndex           = 0;
     ReceivedBatchesSelectedIndex = -1;
 }
Example #3
0
 public ReceivingHistoryViewModel(
     IReceivedBatchSource receivedBatchSource,
     IActiveInventorySource inventorySource,
     IBatchOperatorSource operatorSource,
     IImplementedBatchSource implementedBatchSource,
     ReceivingManagementViewModel viewModel)
 {
     this.receivedBatchSource            = receivedBatchSource;
     this.inventorySource                = inventorySource;
     this.operatorSource                 = operatorSource;
     this.implementedBatchSource         = implementedBatchSource;
     receivingManagementViewModel        = viewModel;
     RetreivedRecordsLedgerSelectedIndex = -1;
     VisibilityManager = new SearchCriteriaVisibilityManager();
     SelectedPurchaseOrderReceivedBatches = new ObservableCollection <ReceivedBatch>();
     RetreivedRecordsLedger      = new ObservableCollection <ReceivedPurchaseOrder>();
     SearchCriteriaSelectedIndex = 0;
     DatePeriodSelectedIndex     = 0;
     DateRangeStartingDate       = DateTime.Today;
     DateRangeEndingDate         = DateTime.Today;
     SpecificDate = DateTime.Today;
     PopulateRetreivedRecordsLedgerFromSearchCriteria = new ListReceivingRecordsByDateRangeCommand(this);
     ListBatchesFromReceivedPurchaseOrder             = new ListBatchesFromReceivedPurchaseOrderCommand(this);
     ChangeSearchCriteriaPanelVisibility = new ChangeSearchCriteriaPanelVisibilityCommand(this);
     OpenPurchaseOrderEditorCommand      = new OpenPurchaseOrderEditorCommand(this);
     PurchaseOrderEditorViewer           = new ReceivedPurchaseOrderEditorViewer(this);
     ReceivingSessionViewer = new BatchReceivingManagementViewer(receivingManagementViewModel);
 }
Example #4
0
 public SQLiteReceivedBatchSource(SQLiteStoreContext sqliteStore, IActiveInventorySource inventorySource)
 {
     this.sqliteStore        = sqliteStore;
     this.inventorySource    = inventorySource;
     ReceivedBatchRepository = new ObservableCollection <ReceivedBatch>();
     ReceivedBatchIdMappings = new Dictionary <int, int>();
 }
        public MainWindowViewModel(
            IActiveInventorySource inventorySource,
            IReceivedBatchSource receivedBatchSource,
            IImplementedBatchSource implementedBatchSource,
            IBatchOperatorSource operatorSource
            )
        {
            this.inventorySource        = inventorySource;
            this.receivedBatchSource    = receivedBatchSource;
            this.implementedBatchSource = implementedBatchSource;
            this.operatorSource         = operatorSource;

            AssociateCollectionsAndRepositories();
            InitializeBatchImplementationSettings();

            LaunchReceivingManagementSessionViewerCommand     = new OpenReceivingManagementSessionViewCommand(this);
            LaunchBatchOperatorManagementSessionViewerCommand = new OpenBatchOperatorManagementViewCommand(this);
            LaunchBatchHistoryViewerCommand = new OpenBatchHistoryViewerCommand(this);
            LaunchBatchHistoryViewerWithBatchNumberCommand    = new OpenBatchHistoryViewerWithBatchNumberCommand(this);
            LaunchReceivingHistorySessionViewerCommand        = new OpenReceivingHistorySessionViewCommand(this);
            LaunchConnectedBatchInquiryViewerCommand          = new OpenConnectedBatchInquiryViewCommand(this);
            CommitInventoryBatchToImplementationLedgerCommand = new CommitBatchToImplementationLedgerCommand(this);
            UndoSelectedImplementedBatchCommand = new UndoImplementedBatchCommand(this);
            AutoBackupToggleCommand             = new AutoBackupToggleCommand();
            AutoBackupToggleState = Properties.Settings.Default.AutoDatabaseBackup;
        }
Example #6
0
        void PrepareMainWindowViewModel()
        {
            SQLiteStoreContext sqliteStore = new SQLiteStoreContext(Settings.Default.AttachedDatabase);

            operatorSource         = new SQLiteBatchOperatorSource(sqliteStore);
            inventorySource        = new SQLiteActiveInventorySource(sqliteStore);
            receivedBatchSource    = new SQLiteReceivedBatchSource(sqliteStore, inventorySource);
            implementedBatchSource = new SQLiteImplementedBatchSource(sqliteStore, inventorySource);

            mainWindowViewModel = new MainWindowViewModel(inventorySource, receivedBatchSource, implementedBatchSource, operatorSource);
        }
 public void SetUp()
 {
     dbHelper = new SQLiteDatabaseHelper();
     dbHelper.CreateTestDatabase();
     sqliteStore            = new SQLiteStoreContext(dbHelper.DatabaseFile);
     operatorSource         = new SQLiteBatchOperatorSource(sqliteStore);
     inventorySource        = new SQLiteActiveInventorySource(sqliteStore);
     receivedBatchSource    = new SQLiteReceivedBatchSource(sqliteStore, inventorySource);
     implementedBatchSource = new SQLiteImplementedBatchSource(sqliteStore, inventorySource);
     operatorHelper         = new BatchOperatorTestHelper(operatorSource);
     viewModel     = new MainWindowViewModel(inventorySource, receivedBatchSource, implementedBatchSource, operatorSource);
     batchOperator = operatorHelper.GetJaneDoeOperator();
 }
 public BatchHistoryViewModel(
     IBatchNumberValidator validator,
     IActiveInventorySource inventorySource,
     IReceivedBatchSource receivedBatchSource,
     IImplementedBatchSource implementedBatchSource)
 {
     this.validator              = validator;
     this.inventorySource        = inventorySource;
     this.receivedBatchSource    = receivedBatchSource;
     this.implementedBatchSource = implementedBatchSource;
     AmountInInventory           = "0";
     BatchNumber = string.Empty;
     RetrieveBatchDataHistoryCommand = new DisplayBatchHistoryFromBatchNumberCommand(this);
 }
        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);
        }