private void btnDelete_Click(object sender, EventArgs e) { string id = txtIdQuestionEdit.Text; DataProcess dt = new DataProcess(); if (dt.DeleteQuestion(id) == true) { dataGridView1.DataSource = dt.GetQuestions(); ResetGUI(); MessageBox.Show("DELETE QUESTION SUCCESS", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("DELETE QUESTION FAIL"); } }
private void btnUpdate_Click(object sender, EventArgs e) { string id = txtIdQuestionEdit.Text; string level = cbLevelEdit.Text; string content = rtContentEdit.Text; string correct = txtCorrect.Text; string a = rtAEdit.Text; string b = rtBEdit.Text; string c = rtCEdit.Text; string d = rtDEdit.Text; DataProcess dt = new DataProcess(); if (dt.UpdateQuestion(id, level, content, correct, a, b, c, d) == true) { dataGridView1.DataSource = dt.GetQuestions(); ResetGUI(); MessageBox.Show("UPDATE QUESTION SUCCESSFULLY", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("UPDATE FAIL"); } }
private void btnViewall_Click(object sender, EventArgs e) { DataProcess dt = new DataProcess(); dataGridView1.DataSource = dt.GetQuestions(); }