Пример #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Load Categories
            List <Category> categories = sql.getCategoriesAll();

            categories.Sort();

            comboBox_CategoriesAddModel.ItemsSource       = categories;
            comboBox_CategoriesAddModel.DisplayMemberPath = "NameCategory";
            comboBox_CategoriesAddModel.SelectedIndex     = 0;
            if (device != null)
            {
                comboBox_CategoriesAddModel.Text = device.Category;
            }


            //Load BrandsByCategory
            List <Brand> brands = sql.getBrandsByCategoryAll(comboBox_CategoriesAddModel.Text);

            brands.Sort();

            comboBox_BrandsAddModel.ItemsSource       = brands;
            comboBox_BrandsAddModel.DisplayMemberPath = "NameBrand";
            comboBox_BrandsAddModel.SelectedIndex     = 0;
            if (device != null)
            {
                comboBox_BrandsAddModel.Text = device.Brand;
            }
        }
Пример #2
0
        public void LoadCategories()
        {
            comboBox_CategoriesEditModel.ItemsSource = null;
            //Load Categories
            List <Category> categories = sql.getCategoriesAll();

            categories.Sort();

            comboBox_CategoriesEditModel.ItemsSource       = categories;
            comboBox_CategoriesEditModel.DisplayMemberPath = "NameCategory";
            comboBox_CategoriesEditModel.SelectedIndex     = 0;
            //    if (device != null) comboBox_CategoriesAddRepair.Text = device.Category;
            categories = null;
        }
Пример #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Load Categories
            List <Category> categories = sql.getCategoriesAll();

            categories.Sort();

            comboBox_CategoriesAddBrand.ItemsSource   = categories;
            comboBox_CategoriesAddBrand.SelectedIndex = 0;
            if (device != null)
            {
                comboBox_CategoriesAddBrand.Text = device.Category;
            }
        }