Exemplo n.º 1
0
//when user selects a product in the product list, populate suppliers list
        private void cboProdList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboProdList.SelectedIndex < 00000000)
            {
                selectedProduct   = null;
                product.ProductId = selectedProduct;
            }
            else
            {
                newProdSup           = new ProdSupplier();
                newProdSup.ProductId = Convert.ToInt32(cboProdList.Text);


                // return list of suppliers based on product ID from GetProdSuppliersBasedOnProductId


                cboSupplierList.DataSource    = ProdSuppliersDB.GetProdSuppliersBasedOnProductId(newProdSup);
                cboSupplierList.DisplayMember = "SupplierId";
                cboSupplierList.ValueMember   = "ProductSupplierId";
            }
        }