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; }
public override void SetUp() { sqliteHelper = new SQLiteDatabaseHelper(); sqliteHelper.CreateTestDatabase(); SQLiteStoreContext context = new SQLiteStoreContext(sqliteHelper.DatabaseFile); inventorySource = new SQLiteActiveInventorySource(context); receivedBatchSource = new SQLiteReceivedBatchSource(context, inventorySource); implementedBatchSource = new SQLiteImplementedBatchSource(context, inventorySource); operatorSource = new SQLiteBatchOperatorSource(context); viewModel = new MainWindowViewModel(inventorySource, receivedBatchSource, implementedBatchSource, operatorSource); command = new UndoImplementedBatchCommand(viewModel); base.SetUp(); }