Exemple #1
0
        private void AddProductsWithSuppliers_Load(object sender, EventArgs e)
        {
            //// TODO: This line of code loads data into the 'travelExpertsDataSet.Products' table. You can move, or remove it, as needed.
            //this.productsTableAdapter.Fill(this.travelExpertsDataSet.Products);
            //// TODO: This line of code loads data into the 'travelExpertsDataSet.Products_Suppliers' table. You can move, or remove it, as needed.
            //this.products_SuppliersTableAdapter.Fill(this.travelExpertsDataSet.Products_Suppliers);
            //// TODO: This line of code loads data into the 'travelExpertsDataSet.Packages_Products_Suppliers' table. You can move, or remove it, as needed.
            //this.packages_Products_SuppliersTableAdapter.Fill(this.travelExpertsDataSet.Packages_Products_Suppliers);
            ProductBox.DataSource = jamesProductsDB.GetProducts();

            ProductBox.DisplayMember = "ProdName";
            ProductBox.ValueMember   = "ProductId";

            SuppliersBox.DataSource    = SuppliersFunctions.GetSuppliers();
            SuppliersBox.ValueMember   = "SupplierId";
            SuppliersBox.DisplayMember = "SupName";

            //((DataGridViewComboBoxCell)dgvRow.Cells[2]).Value =
            //            supplierIdPairs[indOfRightElement].SupplierId;
        }
        private void UpdateSuppliersAndProducts_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'travelExpertsDataSet.Products_Suppliers' table. You can move, or remove it, as needed.
            //this.products_SuppliersTableAdapter.Fill(this.travelExpertsDataSet.Products_Suppliers);

            //DISPLAYS THE DATA IN TEH FORM
            relationshipInitial.DataSource    = SuppliersFunctions.GetRelations();
            relationshipInitial.DisplayMember = "ProductSupplierId";
            relationshipInitial.ValueMember   = "ProductSupplierId";

            productNew.DataSource    = jamesProductsDB.GetProducts();
            productNew.DisplayMember = "ProdName";
            productNew.ValueMember   = "ProductId";

            supplierNew.DataSource    = SuppliersFunctions.GetSuppliers();
            supplierNew.ValueMember   = "SupplierId";
            supplierNew.DisplayMember = "SupName";

            //productCurrent.Source = SuppliersFunctions.GetRelations();
            //productCurrent.Text =

            //supplierCurrent.Text =
        }