private void Design() { switch (whichForm) { case WhichForm.Defendant: { Text = "Defendant addition"; defendant = new Defendant(); break; } case WhichForm.Judge: { Text = "Judge addition"; judge = new Judge(); break; } case WhichForm.Plaintiff: { Text = "Plaintiff addition"; plaintiff = new Plaintiff(); break; } default: { MessageBox.Show("NO FORM SELECTED"); Close(); break; } } }
/// <summary> /// Дизайн формы /// </summary> private void Design() { switch (whichForm) { case WhichForm.Defendant: { defendant = new Defendant(); Connection.Connector(dataGridView1, defendant.Display(), cantDisp); break; } case WhichForm.Judge: { judge = new Judge(); Connection.Connector(dataGridView1, judge.Display(), cantDisp); break; } case WhichForm.Plaintiff: { plaintiff = new Plaintiff(); Connection.Connector(dataGridView1, plaintiff.Display(), cantDisp); break; } default: { MessageBox.Show("NO FORM SELECTED"); Close(); break; } } HelpFac.Text = whichForm.ToString(); DisplayAll.Text = "Display all " + whichForm.ToString().ToLower(); EditSelected.Text = "Edit selected " + whichForm.ToString().ToLower(); DeleteSelected.Text = "Delete selected " + whichForm.ToString().ToLower(); }