コード例 #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;
            }
        }//------------------------
コード例 #2
0
        //############################################CLASS SubjectScheduleDetails EVENTS#######################################################
        //event is raised when the class is loaded
        protected virtual void ClassLoad(object sender, EventArgs e)
        {
            if (_scheduleManager.MustOpenSchoolYearSemester())
            {
                RemoteClient.ProcStatic.ShowErrorDialog("Please open another school year / semester before creating a new subject schedule.",
                                                        "Error Creating A Subject Schedule");

                _hasErrors = true;

                this.Close();
            }

            _schedDetailsInfo = new CommonExchange.ScheduleInformationDetails();

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

            _schedDetailsInfo.ScheduleInfo.SubjectInfo.SubjectCode      = _schedInfo.SubjectInfo.SubjectCode;
            _schedDetailsInfo.ScheduleInfo.SubjectInfo.DescriptiveTitle = _schedInfo.SubjectInfo.DescriptiveTitle;
            _schedDetailsInfo.NoHours = this.hrmHours.SelectedHourMinute;
            _schedDetailsInfo.ScheduleInfo.ScheduleSysId = _schedInfo.ScheduleSysId;

            //if (_schedInfo.SubjectInfo.CourseGroupInfo.IsSemestral)
            //{
            //    this.optUnits.Enabled = this.optUnits.Checked = true;
            //    this.txtLecture.Enabled = true;
            //    this.txtLaboratory.Enabled = true;
            //}
            //else
            //{
            //    this.optHours.Enabled = this.optHours.Checked = true;
            //    this.hrmHours.Enabled = true;
            //}

            optTBA.Checked = true;
        }//------------------------