Exemplo n.º 1
0
 private void comboBoxTables_SelectedIndexChanged(object sender, EventArgs e)
 {
     buttonSave.Enabled = false;
     try
     {
         string table = comboBoxTables.SelectedItem.ToString();
         if (table == "Контракты")
         {
             dataGridViewDBTable.DataSource = SQL_DB.SelectFromTable("Select * from Contract");
         }
         else if (table == "Руководители")
         {
             dataGridViewDBTable.DataSource = SQL_DB.SelectFromTable("Select * from Ruk");
         }
         else if (table == "Вспомогательный персонал")
         {
             dataGridViewDBTable.DataSource = SQL_DB.SelectFromTable("Select * from VspomPers");
         }
         else if (table == "ППС")
         {
             dataGridViewDBTable.DataSource = SQL_DB.SelectFromTable("Select * from PPS");
             buttonSave.Enabled             = true;
         }
         else if (table == "Дисциплины")
         {
             dataGridViewDBTable.DataSource = SQL_DB.SelectFromTable("Select * from Dscp");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ошибка при открытии БД", "Информация", MessageBoxButtons.OK);
     }
 }
Exemplo n.º 2
0
        private void buttonAddVP_Click(object sender, EventArgs e)
        {
            FormAdd addVPForm = new FormAdd();

            addVPForm.ShowDialog();
            if (!addVPForm.isCancel)
            {
                SQL_DB.AddVP();
            }
        }
Exemplo n.º 3
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     //BindingSource bs = (BindingSource)dataGridViewDBTable.DataSource; // Se convierte el DataSource
     //DataTable tCxC = (DataTable)bs.DataSource;
     SQL_DB.ModifyDB(dataGridViewDBTable.DataSource as DataTable);
 }
Exemplo n.º 4
0
 private void buttonShowDoct_Click(object sender, EventArgs e)
 {
     dataGridViewDBTable.DataSource = SQL_DB.SelDegree("'Доктор'");
 }
Exemplo n.º 5
0
 private void buttonShowCand_Click(object sender, EventArgs e)
 {
     dataGridViewDBTable.DataSource = SQL_DB.SelDegree("'Кандидат'");
 }
Exemplo n.º 6
0
 private void buttonShowYoung_Click(object sender, EventArgs e)
 {
     dataGridViewDBTable.DataSource = SQL_DB.SelAge("<=");
 }
Exemplo n.º 7
0
 private void buttonSelPPS_Click(object sender, EventArgs e)
 {
     dataGridViewDBTable.DataSource = SQL_DB.SelPPS();
 }