Пример #1
0
        }//---------------------------

        //#############################################END COMBOBOX cboYearSemester EVENTS#################################################

        //##############################################BUTTON btnSearchSubject EVENTS####################################################
        //event is raised when the button is clicked
        private void btnSearchSubjectClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                using (SubjectSearchOnTextboxList frmSearch = new SubjectSearchOnTextboxList(_userInfo, _scheduleManager, 0))
                {
                    frmSearch.AdoptGridSize = true;
                    frmSearch.ShowDialog(this);

                    if (frmSearch.HasSelected)
                    {
                        CommonExchange.SubjectInformation subjectInfo = _scheduleManager.GetDetailsSubjectInformation(frmSearch.PrimaryId);

                        _schedInfo.SubjectInfo.SubjectSysId = subjectInfo.SubjectSysId;
                        _schedInfo.SubjectInfo.CourseGroupInfo.IsSemestral   = subjectInfo.CourseGroupInfo.IsSemestral;
                        _schedInfo.SubjectInfo.DepartmentInfo.DepartmentName = subjectInfo.DepartmentInfo.DepartmentName;
                        _schedInfo.SubjectInfo.SubjectCode                 = subjectInfo.SubjectCode;
                        _schedInfo.SubjectInfo.DescriptiveTitle            = subjectInfo.DescriptiveTitle;
                        _schedInfo.SubjectInfo.DepartmentInfo.DepartmentId = subjectInfo.DepartmentInfo.DepartmentId;
                        _schedInfo.SubjectInfo.LectureUnits                = subjectInfo.LectureUnits;
                        _schedInfo.SubjectInfo.LabUnits = subjectInfo.LabUnits;
                        _schedInfo.SubjectInfo.NoHours  = subjectInfo.NoHours;

                        lblSysIdSubject.Text           = subjectInfo.SubjectSysId;
                        lblSubjectCodeDescription.Text = subjectInfo.SubjectCode + " - " + subjectInfo.DescriptiveTitle;
                        lblSubjectDepartment.Text      = subjectInfo.DepartmentInfo.DepartmentName;
                        lblUnitsLabHours.Text          = _scheduleManager.GetSubjectUnitsHours(subjectInfo.LectureUnits, subjectInfo.LabUnits, subjectInfo.NoHours);

                        _scheduleManager.InitializeSchoolYearSemesterCombo(cboYearSemester, subjectInfo.CourseGroupInfo.IsSemestral);

                        this.cboYearSemester.Enabled = this.tabSchedule.Enabled = this.lnkAddDetails.Enabled = true;

                        this.btnSearchSubject.Visible = false;
                    }
                }

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