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); } }
private void buttonAddVP_Click(object sender, EventArgs e) { FormAdd addVPForm = new FormAdd(); addVPForm.ShowDialog(); if (!addVPForm.isCancel) { SQL_DB.AddVP(); } }
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); }
private void buttonShowDoct_Click(object sender, EventArgs e) { dataGridViewDBTable.DataSource = SQL_DB.SelDegree("'Доктор'"); }
private void buttonShowCand_Click(object sender, EventArgs e) { dataGridViewDBTable.DataSource = SQL_DB.SelDegree("'Кандидат'"); }
private void buttonShowYoung_Click(object sender, EventArgs e) { dataGridViewDBTable.DataSource = SQL_DB.SelAge("<="); }
private void buttonSelPPS_Click(object sender, EventArgs e) { dataGridViewDBTable.DataSource = SQL_DB.SelPPS(); }