示例#1
0
        } //---------------------------------

        //################################################END TEXTBOX txtAmount EVENTS########################################################

        //################################################LINKBUTTON lnkEnroll EVENTS#########################################################
        //event is raised when the link is clicked
        private void lnkEnrollLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                using (StudentSearchOnTextboxList frmSearch = new StudentSearchOnTextboxList(_userInfo, _specialManager, _dateStart, _dateEnd))
                {
                    frmSearch.AdoptGridSize = false;
                    frmSearch.ShowDialog(this);

                    if (frmSearch.HasSelected)
                    {
                        CommonExchange.StudentEnrolmentLevel studentEnrolmentLevelInfo = _specialManager.GetDetailsByStudentIdStudentInformation(frmSearch.PrimaryId);

                        if (_specialManager.IsAlreadyEnrolled(studentEnrolmentLevelInfo.StudentEnrolmentCourseInfo.StudentInfo.StudentId))
                        {
                            MessageBox.Show("The student is already enrolled in the special class.", "Error",
                                            MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            this.dgvEnrolled.DataSource = _specialManager.EnrollSpecialClassLoad(studentEnrolmentLevelInfo);
                        }
                    }

                    _specialManager.SetSelectedDataTableToNull();
                }
            }
            catch (Exception ex)
            {
                RemoteClient.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Student Search Module");
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        } //---------------------------------