コード例 #1
0
ファイル: frmControlSubjects.cs プロジェクト: RazenRyne/eSAR
        private void cbSection_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
            if (changed)
            {
            IRegistrationService registrationService = new RegistrationService();
                int index = cbSection.SelectedIndex;
            GradeSection s = sections[index];
            registrationService.DeleteExistingSubjects(ControlStudent.StudentId + SY);
            registrationService.UpdateStudentSection(ControlStudent.StudentId + SY, s.GradeSectionCode, s.Section);

            Schedule = registrationService.GetSubjectsOfSection(s.GradeSectionCode, SY);
            subjects.Clear();
            foreach (StudentSchedule sch in Schedule)
                {
                    StudentSubject ss = new StudentSubject()
                    {
                        StudentSY = controlStudentId + SY,
                        SubjectCode = sch.SubjectCode,
                        SubjectAssignments = sch.SubjectAssignments,
                        StudentEnrSubCode = controlStudentId + SY + sch.SubjectCode,
                        LockFirst = false,
                        LockSecond = false,
                        LockThird = false,
                        LockFourth = false,
                        FirstPeriodicRating = 0.00,
                        SecondPeriodicRating = 0.00,
                        ThirdPeriodicRating = 0.00,
                        FourthPeriodicRating = 0.00
                    };
                    subjects.Add(ss);
                }

            ControlSchedule = Schedule;
            GlobalClass.gvDatasource = 1;
            gvSchedule.DataSource = ControlSchedule;
            gvSchedule.ReadOnly = false;
          
        }
    }