private void add_btn_Click(object sender, EventArgs e) { switch (comboBox1.GetItemText(this.comboBox1.SelectedItem)) { case "Clients": Add_Client_form form2 = new Add_Client_form(); form2.Show(); break; case "Invoices": Add_Invoice invoice_form = new Add_Invoice(); invoice_form.Show(); break; case "Drinks": Add_Drink drinks_form = new Add_Drink(); drinks_form.Show(); break; case "Invoice Items": Add_InvoiceItem1 form = new Add_InvoiceItem1(); form.Show(); break; case "Distributors": Add_Distributor distributor_form = new Add_Distributor(); distributor_form.Show(); break; } }
public Edit_Invoice_Item() { InitializeComponent(); Add_InvoiceItem1 obj = new Add_InvoiceItem1(); CB_Drink.DataSource = obj.getDrinks(); CB_Drink.ValueMember = "ID"; CB_Drink.DisplayMember = "name"; CB_id_invoice.DataSource = obj.getIDs(); CB_id_invoice.ValueMember = "ID"; CB_id_invoice.DisplayMember = "name"; UpdateFields(); }