private void btnRandom_Click(object sender, EventArgs e) { ManageExam md = new ManageExam(); string type = cb2.SelectedItem.ToString(); 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("SumMit1")) { type = "SM1"; } list = md.GetrandomQuestion(type); MessageBox.Show("Load Cau hoi thanh cong"); btnCreate.Enabled = true; }
private void btnCheck_Click(object sender, EventArgs e) { string id = txtExamcode.Text; ManageExam mn = new ManageExam(); if (mn.CheckID(id) == false) { MessageBox.Show(" Examcode naay da ton tai"); } else { MessageBox.Show("Examcode nay dung dc"); } }
private void btnUpdate1_Click(object sender, EventArgs e) { string idExam = txtExamCode2.Text; string date = dateTimePicker2.Text; string status = cb3.Text; ManageExam mn = new ManageExam(); if (mn.UpdateExam(idExam, date, status)) { dataGridView2.DataSource = mn.getExam(); ResetGUI(); MessageBox.Show("Update Exam thanh cong ", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Update failed", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnCreate_Click(object sender, EventArgs e) { string examcode = txtExamcode.Text; string date = dtpdate.Text; ManageExam model = new ManageExam(); if (model.AddNewExam(examcode, date)) { foreach (var item in list) { model.AddExamDetail(examcode, item.ID); } MessageBox.Show("Add thanh cong"); } else { MessageBox.Show("Add that bai, xem lai"); } }