Beispiel #1
0
 public Addition(WhichForm whichForm, Displayer displayer)
 {
     InitializeComponent();
     this.whichForm = whichForm;
     this.displayer = displayer;
     Design();
 }
Beispiel #2
0
 public Deleting(WhichForm whichForm, CaseDisplay caseDisplay)
 {
     InitializeComponent();
     this.whichForm   = whichForm;
     this.caseDisplay = caseDisplay;
     Design();
 }
Beispiel #3
0
        /// <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();
            }
        }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 /// <summary>
 /// Обычный вывод
 /// </summary>
 public Displayer(WhichForm whichForm)
 {
     InitializeComponent();
     this.whichForm = whichForm;
     Design();
 }