Example #1
0
        private void PopulateListOfItemGroups(DisplayItemGroups List, string searchString)
        {
            List.Clear();
            List <ItemGroup> searchResults = _db.TableItemGroup.SearchItemGroups(searchString);

            foreach (ItemGroup searchResult in searchResults)
            {
                List.Add(searchResult);
            }
        }
Example #2
0
        public ItemGroupViewModel(IDatabaseService db, IMessageBox mb)
        {
            var dummyBool = true;

            CreateItemGroupCommand = new RelayCommand(createItemGroupHandler, () => dummyBool == true);
            DeleteItemGroupCommand = new RelayCommand(deleteItemGroupHandler, () => ListOfItemGroups.CurrentIndex >= 0);
            EditItemGroupCommand   = new RelayCommand(editItemGroupHandler,
                                                      () => ItemGroupName != "");
            SearchCommand = new RelayCommand(searchItemGroupHandler, () => dummyBool == true);

            _db              = db;
            _messageBox      = mb;
            ListOfItemGroups = new DisplayItemGroups();
            ComboBoxOptions  = new DisplayItemGroups();
            PopulateListOfItemGroups(ListOfItemGroups, "");
            PopulateListOfItemGroups(ComboBoxOptions, "");
            ComboBoxIndex = -1;
            ItemGroupName = "";
            SearchString  = "";
        }