public void LoadCategories()
        {
            //Load Categories
            List <Category> categories = sql.getCategoriesAll();

            comboBox_Categories.DataSource    = categories;
            comboBox_Categories.DisplayMember = "nameCategory";
            comboBox_Categories.ValueMember   = "nameCategory";
            if (device != null)
            {
                comboBox_Categories.Text = device.Category;
            }
            categories = null;
        }
Exemple #2
0
        private void AddBrandForm_Load(object sender, EventArgs e)
        {
            //Load Categories
            List <Category> categories = new List <Category>();

            categories = sql.getCategoriesAll();
            comboBox_Categories.DataSource    = categories;
            comboBox_Categories.DisplayMember = "nameCategory";
            comboBox_Categories.ValueMember   = "nameCategory";
            if (device != null)
            {
                comboBox_Categories.Text = device.Category;
            }
        }
        private void AddModelForm_Load(object sender, EventArgs e)
        {
            //Load Categories
            comboBox_Categories.DataSource    = sql.getCategoriesAll();
            comboBox_Categories.DisplayMember = "nameCategory";
            comboBox_Categories.ValueMember   = "nameCategory";
            if (device != null)
            {
                comboBox_Categories.Text = device.Category;
            }


            //Load BrandsByCategory
            comboBox_Brands.DataSource    = sql.getBrandsByCategoryAll(comboBox_Categories.Text);
            comboBox_Brands.DisplayMember = "nameBrand";
            comboBox_Brands.ValueMember   = "nameBrand";
            if (device != null)
            {
                comboBox_Brands.Text = device.Brand;
            }
        }