private void metroGrid3_CellClick(object sender, DataGridViewCellEventArgs e) { String name = metroGrid3.Rows[e.RowIndex].Cells[0].Value.ToString(); DataCon d2 = new DataCon(); String query = "delete from team where name like '" + name + "'"; d2.execInsert(query); String query2 = "SELECT name,size,aid,teamleader, studentid from applicant a, team t where a.teamid=t.name AND a.teamleader=1"; fillGrid(query2, 3, 2); }
private void metroGrid1_CellClick(object sender, DataGridViewCellEventArgs e) { String name = metroGrid1.Rows[e.RowIndex].Cells[0].Value.ToString(); DataCon d2 = new DataCon(); String query = "delete from unions where name like '" + name + "'"; d2.execInsert(query); String query2 = "select u.name, u.annual_fee,s1.name as 'president', s2.name as 'v. president', s3.name as 'secretary', s4.name as 'treasurer' from student s1, student s2, student s3, student s4, unions u where u.president=s1.admission_no AND u.v_president=s2.admission_no AND u.secretary = s3.admission_no AND u.treasurer = s4.admission_no"; fillGrid(query2, 1, 2); }
private void metroGrid2_CellClick(object sender, DataGridViewCellEventArgs e) { String aid = metroGrid2.Rows[e.RowIndex].Cells[0].Value.ToString(); DataCon d2 = new DataCon(); String query = "delete from applicant where aid like '" + aid + "'"; d2.execInsert(query); String query2 = "SELECT * FROM applicant"; fillGrid(query2, 2, 2); }
private void metroGrid1_CellClick(object sender, DataGridViewCellEventArgs e) { if (metroGrid1.Columns[e.ColumnIndex].Name == "deleteUsr") { String pid = metroGrid1.Rows[e.RowIndex].Cells[0].Value.ToString(); DataCon d2 = new DataCon(); String query = "delete from prize where prizeid like '" + pid + "'"; d2.execInsert(query); String query2 = "SELECT * FROM prize"; fillGrid2(query2); } }
private void metroGrid4_CellClick(object sender, DataGridViewCellEventArgs e) { if (metroGrid4.Columns[e.ColumnIndex].Name == "deleteUsr") { String cid = metroGrid4.Rows[e.RowIndex].Cells[0].Value.ToString(); DataCon d2 = new DataCon(); String query = "delete from competition where compid like '" + cid + "'"; d2.execInsert(query); String query2 = "SELECT * FROM competition"; fillGrid(query2, 4, 2); } }
private void metroButton6_Click(object sender, EventArgs e) { if (!((String.IsNullOrEmpty(metroTextBox1.Text) || (String.IsNullOrEmpty(metroTextBox3.Text)) || (String.IsNullOrEmpty(metroTextBox4.Text) || (String.IsNullOrEmpty(metroTextBox7.Text)) || (String.IsNullOrEmpty(metroTextBox2.Text)))))) { DataCon d3 = new DataCon(); String command = "UPDATE exam_result set marks='" + Convert.ToInt32(metroTextBox3.Text) + "', class_id = '" + metroTextBox2.Text + "' where exam_id='" + metroTextBox1.Text + "' AND exam_subject = '" + metroTextBox7.Text + "' AND admission_no='" + metroTextBox4.Text + "'"; d3.execInsert(command); fillGrid("SELECT exam_id, exam_subject, class_id, admission_no, marks from exam_marks", 1, 1); } else { MessageBox.Show("Invalid or Incomplete field values. please complete and try again!"); } }
private void metroGrid1_CellClick(object sender, DataGridViewCellEventArgs e) { if (metroGrid1.Columns[e.ColumnIndex].Name == "deleteUsr") { String ex_id = metroGrid1.Rows[e.RowIndex].Cells[0].Value.ToString(); String ex_sub = metroGrid1.Rows[e.RowIndex].Cells[1].Value.ToString(); String ad = metroGrid1.Rows[e.RowIndex].Cells[3].Value.ToString(); DataCon d2 = new DataCon(); String query = "delete from exam_marks where exam_id like '" + ex_id + " AND exam_subject like '" + ex_sub + "' AND admission_no like '" + ad + "'"; d2.execInsert(query); String query2 = "SELECT exam_id, exam_subject, class_id, admission_no, marks FROM exam_marks"; fillGrid(query2, 1, 2); } }
private void metroButton7_Click(object sender, EventArgs e) { if (!((String.IsNullOrEmpty(metroTextBox1.Text) || (String.IsNullOrEmpty(metroTextBox3.Text)) || (String.IsNullOrEmpty(metroTextBox4.Text) || (String.IsNullOrEmpty(metroTextBox5.Text)))))) { DataCon d3 = new DataCon(); String command = "UPDATE prize set name='" + metroTextBox3.Text + "', price='" + Convert.ToDouble(metroTextBox5.Text) + "', sponsor = '" + metroTextBox4.Text + "' where prizeid ='" + metroTextBox1.Text + "'"; d3.execInsert(command); fillGrid2("SELECT * FROM prize"); } else { MessageBox.Show("Invalid or Inccomplete fields. please correct them and try again!"); } }
public ManageExtraCurricular() { dc = new DataCon(); InitializeComponent(); }
public ManagePerformance() { dc = new DataCon(); InitializeComponent(); }
public ManageAwardsPrizes() { dc = new DataCon(); InitializeComponent(); }