Example #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (CategotyListBox.SelectedItem == null)
            {
                return;
            }

            List <Item> tmp = new List <Item>();

            string category    = CategotyListBox.SelectedItem.ToString();
            string subcategory = (SubcategoryListBox.SelectedItem != null)?SubcategoryListBox.SelectedItem.ToString():String.Empty;

            foreach (var item in allitems)
            {
                if (item.Category == category && string.IsNullOrWhiteSpace(subcategory))
                {
                    tmp.Add(item.Clone() as Item);
                }

                if (item.Category == category && item.Subcategory == subcategory)
                {
                    tmp.Add(item.Clone() as Item);
                }
            }

            Hide();
            SearchItemWindow siw = new SearchItemWindow(tmp.ToArray());

            siw.ShowDialog();
            Close();
        }
Example #2
0
        private void ManList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selected = ManList.SelectedItem as Manufacturer;

            if (selected == null)
            {
                return;
            }

            List <Item> tmp = new List <Item>();

            foreach (var item in App.Db.GetItemList())
            {
                if (item.Manufacturer == selected.Name)
                {
                    tmp.Add(item);
                }
            }

            SearchItemWindow siw = new SearchItemWindow(tmp.ToArray());

            Hide();
            siw.ShowDialog();
            Close();
        }
Example #3
0
        private void Search()
        {
            SearchItemWindow siw = new SearchItemWindow(App.Db.GetItemList().ToArray());

            siw.ShowDialog();
        }