예제 #1
0
        protected void ResetForm()
        {
            LoadFaculty();
            LoadProgramGroup(null);
            LoadProgram(null);
            LoadProgramCourse(null);
            LoadProgramCourseLevel(null);

            LoadClassWeeks();
            LoadInstructor();
            LoadClassRoom();

            RadTimePickerStartMon.SelectedTime = null;
            RadTimePickerStartTue.SelectedTime = null;
            RadTimePickerStartWed.SelectedTime = null;
            RadTimePickerStartThu.SelectedTime = null;
            RadTimePickerStartFri.SelectedTime = null;

            RadTimePickerEndMon.SelectedTime = null;
            RadTimePickerEndTue.SelectedTime = null;
            RadTimePickerEndWed.SelectedTime = null;
            RadTimePickerEndThu.SelectedTime = null;
            RadTimePickerEndFri.SelectedTime = null;

            RadDatePickerStartDate.SelectedDate = null;
            RadDatePickerEndDate.SelectedDate   = null;

            RadTextBoxProgramClass.Text = string.Empty;
            RadTextBoxDescription.Text  = string.Empty;
            RadButtonActive.Checked     = true;

            RadToolBarProgramClass.FindItemByText("New").Enabled = false;
            if (RadToolBarProgramClass.FindItemByText("Update") != null)
            {
                RadToolBarProgramClass.FindItemByText("Update").Text = "Save";
            }
        }
예제 #2
0
        protected void GetProgramClass()
        {
            ResetForm();
            if (RadGridProgramClass.SelectedValue != null)
            {
                var c = new CProgramClass().Get(Convert.ToInt32(RadGridProgramClass.SelectedValue));
                if (c != null)
                {
                    var program = new CProgram().Get(c.ProgramId);
                    if (program != null)
                    {
                        if (program.ProgramGroupId != null)
                        {
                            var programGroup = new CProgramGroup().Get(Convert.ToInt32(program.ProgramGroupId));
                            if (programGroup != null)
                            {
                                RadComboBoxFaculty.SelectedValue = programGroup.FacultyId.ToString();
                                LoadProgramGroup(RadComboBoxFaculty.SelectedValue);
                            }
                            RadComboBoxProgramGroup.SelectedValue = program.ProgramGroupId.ToString();
                            LoadProgram(RadComboBoxProgramGroup.SelectedValue);
                        }
                        RadComboBoxProgram.SelectedValue = program.ProgramId.ToString();
                        LoadProgramCourse(RadComboBoxProgram.SelectedValue);

                        if (c.ProgramCourseId != null)
                        {
                            var programCourse = new CProgramCourse().Get((int)c.ProgramCourseId);
                            if (programCourse != null)
                            {
                                RadComboBoxProgramCourse.SelectedValue = programCourse.ProgramCourseId.ToString();
                                LoadProgramCourseLevel(RadComboBoxProgramCourse.SelectedValue);
                            }
                        }

                        if (c.ProgramCourseLevelId != null)
                        {
                            var programCourseLevel = new CProgramCourseLevel().Get((int)c.ProgramCourseLevelId);
                            if (programCourseLevel != null)
                            {
                                RadComboBoxProgramCourseLevel.SelectedValue = programCourseLevel.ProgramCourseLevelId.ToString();
                            }
                        }
                    }
                    RadComboBoxInstructor.SelectedValue = c.InstructorId.ToString();
                    RadTextBoxProgramClass.Text         = c.Name;
                    RadTextBoxDescription.Text          = c.Description;
                    RadButtonActive.Checked             = c.IsActive;

                    RadDatePickerStartDate.SelectedDate = c.StartDate;
                    RadDatePickerEndDate.SelectedDate   = c.EndDate;
                    RadComboBoxWeeks.SelectedValue      = c.ClassWeek.ToString();

                    RadTimePickerStartMon.SelectedTime = c.MondayStartTime;
                    RadTimePickerStartTue.SelectedTime = c.TuesdayStartTime;
                    RadTimePickerStartWed.SelectedTime = c.WednesdayStartTime;
                    RadTimePickerStartThu.SelectedTime = c.ThursdayStartTime;
                    RadTimePickerStartFri.SelectedTime = c.FridayStartTime;

                    RadTimePickerEndMon.SelectedTime = c.MondayEndTime;
                    RadTimePickerEndTue.SelectedTime = c.TuesdayEndTime;
                    RadTimePickerEndWed.SelectedTime = c.WednesdayEndTime;
                    RadTimePickerEndThu.SelectedTime = c.ThursdayEndTime;
                    RadTimePickerEndFri.SelectedTime = c.FridayEndTime;
                }

                SetClassTime();

                RadToolBarProgramClass.FindItemByText("New").Enabled = true;
                if (RadToolBarProgramClass.FindItemByText("Save") != null)
                {
                    RadToolBarProgramClass.FindItemByText("Save").Text = "Update";
                }
            }
        }