// thi private void btnStartFakeExam_Click(object sender, EventArgs e) { if (gvFakeExams.SelectedRows.Count == 1) { Examination exam = gvFakeExams.SelectedRows[0].DataBoundItem as Examination; frmTracNghiem frm = new frmTracNghiem(my.idStudent, exam.idExamination); frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); } else { MessageBox.Show("Chọn 1 kì thi thử để bắt đầu thi!"); } }
private void BtnStartExam_Click(object sender, EventArgs e) { using (var db = new dbQLThiTracNghiemDataContext()) { var x = db.Results.Where(r => r.idExamination == 2 && r.idStudent == my.idStudent).Count(); if (x == 1) { MessageBox.Show("chưa có kì thi nào để thi!"); return; } } frmTracNghiem frm = new frmTracNghiem(my.idStudent, 2); frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); }