private void MBtnEditExamCodeQuestions_Click(object sender, EventArgs e) { if (bsListExamCode.Count > 0) { var examCode = (ExamCodeListViewModel)mGridListExamCode.SelectedRows[0].DataBoundItem; var frmEditExamCodeQuestions = new frmTeacherEditExamCodeQuestions(CurrentUser.TeacherId, examCode, EditExamCodeQuestionIds); frmEditExamCodeQuestions.ShowDialog(); } }
private void MBtnAddExamCodeQuestions_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(mTxtAddExamCodeNumberOfQuestions.Text)) { var examCode = new ExamCodeListViewModel { NumberOfQuestions = int.Parse(mTxtAddExamCodeNumberOfQuestions.Text), SubjectId = mTxtAddExamCodeSubjectId.Text, GradeId = int.Parse(mTxtAddExamCodeGradeId.Text), IsPracticeExam = mToggleAddExamCodeIsPracticeExam.Checked }; var frmEditExamCodeQuestions = new frmTeacherEditExamCodeQuestions(CurrentUser.TeacherId, examCode, AddExamCodeQuestionIds); frmEditExamCodeQuestions.ShowDialog(); } else { MessageBox.Show("Chưa đủ dữ liệu!"); } }