public static bool AddProdToSupplier(int prodID, int supplierID) { Products_Suppliers pd = new Products_Suppliers(); pd.ProductId = prodID; pd.SupplierId = supplierID; return(SQLAdapter.SQLAdapter.InsertToDB <Products_Suppliers>(pd, new TravelExpertsDBCon())); }
private void btnAddProdtoSup_Click(object sender, EventArgs e) { Products_Suppliers ps = new Products_Suppliers(); ps.ProductId = products[cmbProducts.SelectedIndex].ProductId; ps.ProductSupplierId = suppliers[cboSuppliers.SelectedIndex].SupplierId; SQLAdapter.SQLAdapter.InsertToDB <Products_Suppliers>(ps, new TravelExpertsDBCon()); Application.Restart(); }