public AddNewItemViewModel(string connectionString) { AddItemCommand = new DelegateCommand(ExecuteAddItemCommand); CancelAddItemCommand = new DelegateCommand(ExecuteCancelAddItemCommand); _therapeuticClassProcessor = new TherapeuticClassProcessor(connectionString); _itemProcessor = new ItemProcessor(connectionString); _inventoryProcessor = new InventoryProcessor(connectionString); LoadTherapeuticClass(); InitializeValues(); }
public MainWindowViewModel() { //Initialize commands SalesSearchCommand = new DelegateCommand(ExecuteSalesSearchCommand, CanExecuteSalesSearchCommand); ShoppingListAddItemCommand = new DelegateCommand(ExecuteShoppingListAddItemCommand); ShoppingListConfirmCommand = new DelegateCommand(ExecuteShoppingListConfirmCommand); ShoppingListCancelCommand = new DelegateCommand(ExecuteShoppingListCancelCommand); InventorySearchCommand = new DelegateCommand(ExecuteInventorySearchCommand); AddInventoryItemCommand = new DelegateCommand(ExecuteAddInventoryItemCommand); AddNewItemCommand = new DelegateCommand(ExecuteAddNewItemCommand); //Initialize processors _itemProcessor = new ItemProcessor(_connectionString); _inventoryProcessor = new InventoryProcessor(_connectionString); _therapeuticClassProcessor = new TherapeuticClassProcessor(_connectionString); //Initialize values AddInventoryExpiryDate = DateTime.Now; AddInventoryManufacturingDate = DateTime.Now; ShoppingList = new ObservableCollection <Item>(); LoadAvailableTherapeuticClass(); }