Пример #1
0
        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();
            }
        }
Пример #2
0
        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();
        }
Пример #3
0
 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();
     }
 }
Пример #4
0
        private void добавитьОрганизациюToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form4NewOrgOrClient newOrgForm = new Form4NewOrgOrClient();

            newOrgForm.ShowDialog();
        }