예제 #1
0
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     ID_Uroka = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
     MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[1].Value.ToString(), comboBox3);
     MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[2].Value.ToString(), comboBox4);
     MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[3].Value.ToString(), comboBox5);
     button2.Visible = true;
     button1.Visible = false;
 }
예제 #2
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Fakultativy fakultativy = new Fakultativy(MySqlQueries, MySqlOperations);

            MySqlOperations.Search_In_ComboBox(MySqlOperations.Select_Text(MySqlQueries.Select_FIO_Prepod, ID_Prepoda), fakultativy.comboBox3);
            fakultativy.comboBox3.Enabled = false;
            MySqlOperations.Search_In_ComboBox(MySqlOperations.Select_Text(MySqlQueries.Select_Predmet_Prepoda, ID_Prepoda), fakultativy.comboBox1);
            fakultativy.comboBox1.Enabled       = false;
            fakultativy.dateTimePicker1.Value   = DateTime.Now;
            fakultativy.dateTimePicker1.MinDate = DateTime.Now;
            fakultativy.button1.Visible         = true;
            fakultativy.button3.Visible         = false;
            fakultativy.AcceptButton            = fakultativy.button1;
            fakultativy.Fakultativy_Closed     += Load_Fakultativy;
            fakultativy.Show();
        }
예제 #3
0
 private void Update_String()
 {
     foreach (DataGridViewRow row in dataGridView1.SelectedRows)
     {
         if (identify == "auditorii")
         {
             Auditorii auditorii = new Auditorii(MySqlQueries, MySqlOperations, row.Cells[0].Value.ToString());
             auditorii.textBox1.Text     = row.Cells[1].Value.ToString();
             auditorii.button3.Visible   = true;
             auditorii.button1.Visible   = false;
             auditorii.AcceptButton      = auditorii.button3;
             auditorii.Auditorii_Closed += аудиторииToolStripMenuItem_Click;
             auditorii.Show();
         }
         if (identify == "predmety")
         {
             Predmety predmety = new Predmety(MySqlQueries, MySqlOperations, row.Cells[0].Value.ToString());
             predmety.textBox1.Text     = row.Cells[1].Value.ToString();
             predmety.button3.Visible   = true;
             predmety.button1.Visible   = false;
             predmety.AcceptButton      = predmety.button3;
             predmety.Auditorii_Closed += предметыToolStripMenuItem_Click;
             predmety.Show();
         }
         if (identify == "fakultativy")
         {
             Fakultativy fakultativy = new Fakultativy(MySqlQueries, MySqlOperations, row.Cells[0].Value.ToString());
             MySqlOperations.Search_In_ComboBox(row.Cells[1].Value.ToString(), fakultativy.comboBox1);
             fakultativy.dateTimePicker1.Value   = DateTime.Parse(row.Cells[2].Value.ToString());
             fakultativy.dateTimePicker1.MinDate = fakultativy.dateTimePicker1.Value;
             MySqlOperations.Search_In_ComboBox(row.Cells[3].Value.ToString(), fakultativy.comboBox2);
             MySqlOperations.Search_In_ComboBox(row.Cells[4].Value.ToString(), fakultativy.comboBox3);
             fakultativy.dateTimePicker2.Value = DateTime.Parse(row.Cells[5].Value.ToString());
             fakultativy.dateTimePicker3.Value = DateTime.Parse(row.Cells[6].Value.ToString());
             fakultativy.button3.Visible       = true;
             fakultativy.button1.Visible       = false;
             fakultativy.AcceptButton          = fakultativy.button3;
             fakultativy.Fakultativy_Closed   += факультативыToolStripMenuItem_Click;
             fakultativy.Show();
         }
         if (identify == "klassy")
         {
             Klassy klassy = new Klassy(MySqlQueries, MySqlOperations, row.Cells[0].Value.ToString());
             klassy.numericUpDown1.Value = int.Parse(row.Cells[1].Value.ToString().Split(' ')[0]);
             MySqlOperations.Search_In_ComboBox(row.Cells[1].Value.ToString().Split(' ')[1], klassy.comboBox1);
             klassy.numericUpDown2.Value = int.Parse(row.Cells[2].Value.ToString());
             klassy.button3.Visible      = true;
             klassy.button1.Visible      = false;
             klassy.AcceptButton         = klassy.button3;
             klassy.Klassy_Closed       += классыToolStripMenuItem_Click;
             klassy.Show();
         }
         if (identify == "prepod")
         {
             Prepod prepod = new Prepod(MySqlQueries, MySqlOperations, row.Cells[0].Value.ToString());
             prepod.textBox1.Text = row.Cells[1].Value.ToString().Split(' ')[0];
             prepod.textBox2.Text = row.Cells[1].Value.ToString().Split(' ')[1];
             prepod.textBox3.Text = row.Cells[1].Value.ToString().Split(' ')[2];
             MySqlOperations.Search_In_ComboBox(row.Cells[2].Value.ToString(), prepod.comboBox1);
             prepod.textBox4.Text   = row.Cells[3].Value.ToString();
             prepod.textBox5.Text   = row.Cells[4].Value.ToString();
             prepod.button3.Visible = true;
             prepod.button1.Visible = false;
             prepod.AcceptButton    = prepod.button3;
             prepod.Prepod_Closed  += преподавателиToolStripMenuItem_Click;
             prepod.Show();
         }
         if (identify == "ucheniki")
         {
             Ucheniki ucheniki = new Ucheniki(MySqlQueries, MySqlOperations, row.Cells[0].Value.ToString());
             ucheniki.textBox1.Text = row.Cells[1].Value.ToString().Split(' ')[0];
             ucheniki.textBox2.Text = row.Cells[1].Value.ToString().Split(' ')[1];
             ucheniki.textBox3.Text = row.Cells[1].Value.ToString().Split(' ')[2];
             MySqlOperations.Search_In_ComboBox(row.Cells[2].Value.ToString(), ucheniki.comboBox1);
             ucheniki.textBox4.Text    = row.Cells[3].Value.ToString();
             ucheniki.textBox5.Text    = row.Cells[4].Value.ToString();
             ucheniki.button3.Visible  = true;
             ucheniki.button1.Visible  = false;
             ucheniki.AcceptButton     = ucheniki.button3;
             ucheniki.Ucheniki_Closed += ученикиToolStripMenuItem_Click;
             ucheniki.Show();
         }
         if (identify == "raspisanie")
         {
             Raspisanie raspisanie = new Raspisanie(MySqlQueries, MySqlOperations, row.Cells[0].Value.ToString());
             MySqlOperations.Search_In_ComboBox(row.Cells[1].Value.ToString(), raspisanie.comboBox1);
             MySqlOperations.Search_In_ComboBox(row.Cells[2].Value.ToString(), raspisanie.comboBox2);
             raspisanie.groupBox1.Visible = true;
             MySqlOperations.Select_DataGridView(MySqlQueries.Select_Uroki_Raspisaniya, raspisanie.dataGridView1, row.Cells[0].Value.ToString());
             raspisanie.dataGridView1.Columns[0].Visible = false;
             raspisanie.button5.Visible    = true;
             raspisanie.button4.Visible    = false;
             raspisanie.AcceptButton       = raspisanie.button3;
             raspisanie.Raspisanie_Closed += расписаниеToolStripMenuItem_Click;
             raspisanie.Show();
         }
     }
 }