Exemple #1
0
        }//----------------------------

        //this procedure will initialize instructor information upon selected index in the treeview control
        private void InitializeInsturctorInfomation()
        {
            this.pbxIntructor.Image = null;

            if (!String.IsNullOrEmpty(_teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text)))
            {
                if (this.cboSemester.SelectedIndex >= 0)
                {
                    _teacherLoadingManager.InitializeSubjectServiceLoadListView(this.lsvSubjectServiceLoad, this.lstDeloadedSchedule,
                                                                                this.tblLoadedSchedule, this.tblDeloadedSchedule,
                                                                                _teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text),
                                                                                _teacherLoadingManager.GetSchoolYearYearId(this.cboYear.SelectedIndex),
                                                                                _teacherLoadingManager.GetSemesterSystemId(this.cboYear.SelectedIndex, this.cboSemester.SelectedIndex));

                    _teacherLoadingManager.SetInstructorInformationControls(_teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text),
                                                                            this.lblUnitsLabHoursLoaded, this.lblUnitsLabHoursDeloaded, _teacherLoadingManager.GetSchoolYearYearId(this.cboYear.SelectedIndex),
                                                                            _teacherLoadingManager.GetSemesterSystemId(this.cboYear.SelectedIndex, this.cboSemester.SelectedIndex));

                    this.lblPreperation.Text = _teacherLoadingManager.GetNumberOfPreperation(_teacherLoadingManager.GetEmployeeScheduleSysId(
                                                                                                 this.trvEmployee.SelectedNode.Text),
                                                                                             _teacherLoadingManager.GetSchoolYearYearId(this.cboYear.SelectedIndex),
                                                                                             _teacherLoadingManager.GetSemesterSystemId(this.cboYear.SelectedIndex, this.cboSemester.SelectedIndex)).ToString();
                }
                else
                {
                    _teacherLoadingManager.InitializeSubjectServiceLoadListView(this.lsvSubjectServiceLoad, this.lstDeloadedSchedule,
                                                                                this.tblLoadedSchedule, this.tblDeloadedSchedule,
                                                                                _teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text),
                                                                                _teacherLoadingManager.GetSchoolYearYearId(this.cboYear.SelectedIndex), String.Empty);

                    _teacherLoadingManager.SetInstructorInformationControls(_teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text),
                                                                            this.lblUnitsLabHoursLoaded, this.lblUnitsLabHoursDeloaded, _teacherLoadingManager.GetSchoolYearYearId(this.cboYear.SelectedIndex), String.Empty);

                    this.lblPreperation.Text = _teacherLoadingManager.GetNumberOfPreperation(_teacherLoadingManager.GetEmployeeScheduleSysId(
                                                                                                 this.trvEmployee.SelectedNode.Text),
                                                                                             _teacherLoadingManager.GetSchoolYearYearId(this.cboYear.SelectedIndex), String.Empty).ToString();
                }

                _teacherLoadingManager.InitializeSpecialClassLoadedWithdrawnListView(this.lstSpecialClass, this.lblSpecialClass, this.tblSpecialClass,
                                                                                     _teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text), false);
                _teacherLoadingManager.InitializeSpecialClassLoadedWithdrawnListView(this.lstWithdrawnSpecialClass,
                                                                                     this.lblWithdrawn, this.tblWithdrawnSpecialClass, _teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text), true);

                CommonExchange.Employee empInfo = _teacherLoadingManager.GetEmployeeInformation(_userInfo,
                                                                                                _teacherLoadingManager.GetEmployeeScheduleSysId(this.trvEmployee.SelectedNode.Text));

                this.lblEmpId.Text      = empInfo.EmployeeId;
                this.lblInstructor.Text = RemoteClient.ProcStatic.GetCompleteNameFullMiddleName(empInfo.PersonInfo.LastName, empInfo.PersonInfo.FirstName,
                                                                                                empInfo.PersonInfo.MiddleName);
                this.lblStatusType.Text    = empInfo.SalaryInfo.EmployeeStatusInfo.StatusDescription + " - " + empInfo.SalaryInfo.EmploymentTypeInfo.TypeDescription;
                this.lblEmpDepartment.Text = empInfo.SalaryInfo.DepartmentInfo.DepartmentName;

                if (!String.IsNullOrEmpty(empInfo.PersonInfo.PersonImagesFolder(Application.StartupPath) + empInfo.PersonInfo.PersonSysId))
                {
                    if (File.Exists(empInfo.PersonInfo.PersonImagesFolder(Application.StartupPath) + empInfo.PersonInfo.PersonSysId + ".jpg"))
                    {
                        this.pbxIntructor.Image = Image.FromFile(empInfo.PersonInfo.PersonImagesFolder(Application.StartupPath) + empInfo.PersonInfo.PersonSysId + ".jpg");
                    }
                }
            }

            this.tabScheduleDetails.Enabled = true;

            this.btnPrintTeacherLoad.Enabled = this.lsvSubjectServiceLoad.Items.Count == 0 ? false : true;

            if (RemoteServerLib.ProcStatic.IsSystemAccessAdmin(_userInfo) || RemoteServerLib.ProcStatic.IsSystemAccessOfficeUser(_userInfo))
            {
                this.btnLoadScheduleDetails.Enabled = !_isRecordLocked ? true : false;
            }
        }//-------------------------------