Ejemplo n.º 1
0
        private void prodNameComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            // get the list of suppliers applicable with the selected product ID
            using (travelexpertsDataContext db = new travelexpertsDataContext())
            {
                supNameComboBox.DataSource = TravelExpertsQueryManager.GetSuppliersByProductID(db, Convert.ToInt32(prodNameComboBox.SelectedValue));


                DisplayProdSupId();
            }
        }
Ejemplo n.º 2
0
        // Whenever the user selects a product from the dropdown, update the suppliers dropdown with appropriate data [Eric]
        private void productIdComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (travelexpertsDataContext db = new travelexpertsDataContext())
            {
                // If the user has selected the option to filter suppliers
                if (checkBoxFilterSuppliers.Checked == true)
                {
                    // Get the list of suppliers applicable with the selected product ID
                    supplierIdComboBox.DataSource = TravelExpertsQueryManager.GetSuppliersByProductID(db, Convert.ToInt32(productIdComboBox.SelectedValue));

                    // Make top option of suppliers dropdown selected
                    supplierIdComboBox.SelectedIndex = 0;
                }
                else
                {
                    supplierIdComboBox.DataSource = db.Suppliers; // get supplier data for suppliers details dropbox

                    // Make top option of suppliers dropdown selected
                    supplierIdComboBox.SelectedIndex = 0;
                }
            }
        }