// Edit ExamCode private void MBtnSaveEditExamCode_Click(object sender, EventArgs e) { if (bsListExamCode.Count > 0) { if (!rqEditNumberOfQuestions.IsValid || !rgEditNumberOfQuestions.IsValid) { if (!rqEditNumberOfQuestions.IsValid) { rqEditNumberOfQuestions.ControlToValidate.Focus(); } else { rgEditNumberOfQuestions.ControlToValidate.Focus(); } return; } var examCode = (ExamCodeListViewModel)mGridListExamCode.SelectedRows[0].DataBoundItem; if (examCode.NumberOfQuestions == EditExamCodeQuestionIds.Count()) { SaveEditExamCode?.Invoke(examCode, null); } else { MessageBox.Show("Số lượng câu hỏi phải đúng với số câu hỏi đã quy định!"); } } }
private void MToggleEditExamCodeIsPracticeExam_CheckedChanged(object sender, EventArgs e) { if (bsListExamCode.Count > 0 && mTabExamCode.SelectedTab == mTabEditExamCode && mToggleEditExamCodeIsPracticeExam.Checked == false) { MessageBox.Show("Danh sách câu hỏi đã có sẽ được xoá để cập nhật lại câu hỏi theo đúng đề thi thật!", "Thay đổi", MessageBoxButtons.OK, MessageBoxIcon.Warning); EditExamCodeQuestionIds.Clear(); } }
private void MCbbEditExamCodeSubject_SelectedIndexChanged(object sender, EventArgs e) { if (mCbbEditExamCodeSubject.SelectedItem != null) { if (mTabExamCode.SelectedTab == mTabEditExamCode) { MessageBox.Show("Danh sách câu hỏi đã có sẽ được xoá để cập nhật lại theo đúng môn học!", "Thay đổi", MessageBoxButtons.OK, MessageBoxIcon.Warning); EditExamCodeQuestionIds.Clear(); } var subject = mCbbEditExamCodeSubject.SelectedItem as Subject; mTxtEditExamCodeSubjectId.Text = subject.SubjectId.ToString(); mTxtEditExamCodeGradeId.Text = subject.GradeId.ToString(); } }