public Addition(WhichForm whichForm, Displayer displayer) { InitializeComponent(); this.whichForm = whichForm; this.displayer = displayer; Design(); }
public Deleting(WhichForm whichForm, CaseDisplay caseDisplay) { InitializeComponent(); this.whichForm = whichForm; this.caseDisplay = caseDisplay; Design(); }
/// <summary> /// Метод заполнения кейсбоксов /// </summary> public static void FillCB(string query, ComboBox comboBox, WhichForm whichForm) { using (var conn = new MySqlConnection(connStr)) { MySqlCommand com = new MySqlCommand(query, conn); try { conn.Open(); MySqlDataReader reader = com.ExecuteReader(); switch (whichForm) { case WhichForm.Defendant: { while (reader.Read()) { comboBox.Items.Add(reader["DefendantNumber"]); } break; } case WhichForm.Judge: { while (reader.Read()) { comboBox.Items.Add(reader["JudgeNumber"]); } break; } case WhichForm.Plaintiff: { while (reader.Read()) { comboBox.Items.Add(reader["PlaintiffNumber"]); } break; } case WhichForm.Case: { while (reader.Read()) { comboBox.Items.Add(reader["Id"]); } break; } } conn.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } conn.Close(); } }
public Editing(WhichForm whichForm, string id, Displayer displayer) { InitializeComponent(); this.whichForm = whichForm; this.displayer = displayer; Design(); IdCB.DropDownStyle = ComboBoxStyle.Simple; IdCB.Text = id; IdCB.Enabled = false; }
/// <summary> /// Обычный вывод /// </summary> public Displayer(WhichForm whichForm) { InitializeComponent(); this.whichForm = whichForm; Design(); }