private void button1_Click(object sender, EventArgs e) { bool flagEntryCombobox = false; for (int i = 0; i < clientsCB.Items.Count; i++) { flagEntryCombobox = (clientsCB.Text == clientsCB.Items[i].ToString()) ? true : false; if (flagEntryCombobox == true) { break; } } if ((flagEntryCombobox == true) || (clientsCB.SelectedIndex == -1)) { Form4NewOrgOrClient newClientForm = new Form4NewOrgOrClient((int)organizationsCB.SelectedValue, clientsCB.Text); newClientForm.FormClosed += new FormClosedEventHandler(newClientForm_FormClosed); //Прикрепляем событие newClientForm.ShowDialog(); } else { Form4NewOrgOrClient newClientForm = new Form4NewOrgOrClient((int)organizationsCB.SelectedValue, ""); newClientForm.FormClosed += new FormClosedEventHandler(newClientForm_FormClosed); //Прикрепляем событие newClientForm.ShowDialog(); } }
private void editClientBtn_Click(object sender, EventArgs e) { if (clientsCB.SelectedIndex == -1 | clientsCB.SelectedValue == null | organizationsCB.SelectedValue == null) { return; } Form4NewOrgOrClient editClientForm = new Form4NewOrgOrClient((int)clientsCB.SelectedValue); editClientForm.FormClosed += new FormClosedEventHandler(editClientForm_FormClosed); tempClientIndex = clientsCB.SelectedIndex; editClientForm.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { if (clientsCB.SelectedIndex == -1) { Form4NewOrgOrClient newClientForm = new Form4NewOrgOrClient((int)organizationsCB.SelectedValue, clientsCB.Text); newClientForm.FormClosed += new FormClosedEventHandler(newClientForm_FormClosed); //Прикрепляем событие newClientForm.ShowDialog(); } else { Form4NewOrgOrClient newClientForm = new Form4NewOrgOrClient((int)organizationsCB.SelectedValue, ""); newClientForm.FormClosed += new FormClosedEventHandler(newClientForm_FormClosed); newClientForm.ShowDialog(); } }
private void добавитьОрганизациюToolStripMenuItem_Click(object sender, EventArgs e) { Form4NewOrgOrClient newOrgForm = new Form4NewOrgOrClient(); newOrgForm.ShowDialog(); }