private void button5_Click(object sender, EventArgs e) { DataProcess db = new DataProcess(); dataGridView1.DataSource = db.GetQs().DefaultView; ResetData(); }
private void button2_Click(object sender, EventArgs e) { string id = txtManaQSid.Text; string type = cbBSu.Text; if (type.Equals("Top Notch 1")) { type = "TN1"; } if (type.Equals("Top Notch 2")) { type = "TN2"; } if (type.Equals("Top Notch 3")) { type = "TN3"; } if (type.Equals("Summit 1")) { type = "S1"; } string content = rtbContent.Text; string a = txtA.Text; string b = txtB.Text; string c = txtC.Text; string d = txtD.Text; string ans = ""; if (rdA.Checked) { ans = "_a"; } if (rdB.Checked) { ans = "_b"; } if (rdC.Checked) { ans = "_c"; } if (rdD.Checked) { ans = "_d"; } DataProcess dt = new DataProcess(); if (dt.UpdateQuestion(id, type, content, a, b, c, d, ans)) { MessageBox.Show("Update Success!!"); dataGridView1.DataSource = dt.GetQs().DefaultView; ResetData(); } else { MessageBox.Show("Update Faild!!"); } }
private void button3_Click(object sender, EventArgs e) { string id = txtManaQSid.Text; DataProcess dtb = new DataProcess(); if (dtb.DeleteQuestion(id)) { dataGridView1.DataSource = dtb.GetQs(); ResetData(); MessageBox.Show("Delete Success!!"); } else { MessageBox.Show("Faild"); } }