Example #1
0
 public List<StudentSubject> GetStudentGrades(string StudentId, string sy)
 {
     List<StudentSubject> eval = new List<StudentSubject>();
     List<StudentSubjectBDO> evalBdoList = new List<StudentSubjectBDO>();
     evalBdoList = gradeLogic.GetStudentGradeReport(StudentId, sy);
     foreach (StudentSubjectBDO ssb in evalBdoList)
     {
         StudentSubject ss = new StudentSubject();
         rs.TranslateStuSubjectsBDOToStuSubjects(ssb, ss);
         eval.Add(ss);
     }
     return eval;
 }
Example #2
0
 public List<StudentSubject> GetClassList(string SubjectAssignments)
 {
     List<StudentSubject> classList = new List<StudentSubject>();
     List<StudentSubjectBDO> classBdoList = new List<StudentSubjectBDO>();
     classBdoList = gradeLogic.GetClassList(SubjectAssignments);
     foreach (StudentSubjectBDO ssb in classBdoList)
     {
         StudentSubject ss = new StudentSubject();
         rs.TranslateStuSubjectsBDOToStuSubjects(ssb, ss);
         classList.Add(ss);
     }
     return classList;
 }
Example #3
0
 public List<StudentSubject> GetClassGrades(string SubjectAssignments)
 {
     List<StudentSubject> greport1 = new List<StudentSubject>();
     List<StudentSubjectBDO> greportBdoList = new List<StudentSubjectBDO>();
     greportBdoList = gradeLogic.GetClassGradeReport(SubjectAssignments);
     foreach (StudentSubjectBDO ssb in greportBdoList)
     {
         StudentSubject ss = new StudentSubject();
         rs.TranslateStuSubjectsBDOToStuSubjects(ssb, ss);
         greport1.Add(ss);
     }
     return greport1;
 }
Example #4
0
        public void TranslateStudentSubjectToStudentSubjectBDO(StudentSubject ss, StudentSubjectBDO ssbdo)
        {
            ssbdo.FirstEntered = ss.FirstEntered;
            ssbdo.FirstLocked = ss.FirstLocked;
            ssbdo.FirstPeriodicRating = ss.FirstPeriodicRating;
            ssbdo.FourthEntered = ss.FourthEntered;
            ssbdo.FourthLocked = ss.FourthLocked;
            ssbdo.FourthPeriodicRating = ss.FourthPeriodicRating;
            ssbdo.LockFirst = ss.LockFirst;
            ssbdo.LockFourth = ss.LockFourth;
            ssbdo.LockSecond = ss.LockSecond;
            ssbdo.LockThird = ss.LockThird;
            ssbdo.Remarks = ss.Remarks;
            ssbdo.SecondEntered = ss.SecondEntered;
            ssbdo.SecondLocked = ss.SecondLocked;
            ssbdo.SecondPeriodicRating = ss.SecondPeriodicRating;
            ssbdo.ThirdEntered = ss.ThirdEntered;
            ssbdo.ThirdLocked = ss.ThirdLocked;
            ssbdo.ThirdPeriodicRating = ss.ThirdPeriodicRating;
            ssbdo.StudentEnrSubCode = ss.StudentEnrSubCode;

            ssbdo.StudentEnrSubCode = ss.StudentEnrSubCode;
            ssbdo.StudentSubjectsID = ss.StudentSubjectsID;
            ssbdo.StudentSY = ss.StudentSY;
            ssbdo.SubjectAssignments = ss.SubjectAssignments;
            ssbdo.SubjectCode = ss.SubjectCode;


        }
Example #5
0
        public void TranslateStudentSubjectBDOToStudentSubject(StudentSubjectBDO ssbdo, StudentSubject ss)
        {
            SubjectService s = new SubjectService();
            Subject sub = new Subject();
            s.TranslateSubjectBDOToSubject(ssbdo.Subject, sub);


            RegistrationService r = new RegistrationService();
            StudentEnrollment se = new StudentEnrollment();
            r.TranslatEnrolBDOToEnrol(ssbdo.StudentEnrollment, se);
            ss.StudentEnr = se;

            ss.Description = sub.Description;
            ss.FirstPeriodicRating = ssbdo.FirstPeriodicRating;
            ss.SecondPeriodicRating = ssbdo.SecondPeriodicRating;
            ss.ThirdPeriodicRating = ssbdo.ThirdPeriodicRating;
            ss.FourthPeriodicRating = ssbdo.FourthPeriodicRating;

            ss.FirstEntered = ssbdo.FirstEntered;
            ss.SecondEntered = ssbdo.SecondEntered;
            ss.ThirdEntered = ssbdo.ThirdEntered;
            ss.FourthEntered = ssbdo.FourthEntered;

            ss.LockFirst = (bool)ssbdo.LockFirst;
            ss.LockFourth = (bool)ssbdo.LockFourth;
            ss.LockSecond = (bool)ssbdo.LockSecond;
            ss.LockThird = (bool)ssbdo.LockThird;

            ss.FirstLocked = ssbdo.FirstLocked;
            ss.SecondLocked = ssbdo.SecondLocked;
            ss.ThirdLocked = ssbdo.ThirdLocked;
            ss.FourthLocked = ssbdo.FourthLocked;

            ss.Remarks = ssbdo.Remarks;

            ss.StudentEnrSubCode = ssbdo.StudentEnrSubCode;

            ss.StudentEnrSubCode = ssbdo.StudentEnrSubCode;
            ss.StudentSubjectsID = ssbdo.StudentSubjectsID;
            ss.StudentSY = ssbdo.StudentSY;
            ss.SubjectCode = ssbdo.SubjectCode;


            ss.StudentId = se.StudentId;
            ss.StudentName = se.StudentName;

        }
Example #6
0
        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;
          
        }
    }
Example #7
0
        private void loadSched()
        {
            IRegistrationService registrationService = new RegistrationService();
            string message = String.Empty;

            EnrolMe.StudentSY = controlStudentId + SY;
            int prev = Int32.Parse(SY.Substring(0, 4));
            prev--;
            int sy = Int32.Parse(SY.Substring(5, 4));
            sy--;
            string prevSY = prev.ToString() + "-" + sy.ToString();

            string prevRecord = controlStudentId + prevSY;

            gvAllSchedules.DataSource = null;
            gvSchedule.DataSource = null;
            gvFail.DataSource = null;
        
            ExistingSchedRemove.Clear();

            FailedSubjects = new List<StudentSubject>(registrationService.GetFailedSubjects(prevRecord));
            StudentSubs = new List<StudentSubject>(registrationService.GetStudentSubjects(EnrolMe.StudentSY));
            Schedules = new List<StudentSchedule>(registrationService.GetSubjectSchedules(SY));

            if (StudentSubs.Count > 0)
            {
                ExistingSchedule = new List<StudentSchedule>(registrationService.GetStudentExistingSchedule(StudentSubs, SY));
            }

            if (ExistingSchedule.Count > 0)
            {
                foreach (StudentSchedule ss in ExistingSchedule)
                {
                    int index = Schedules.FindIndex(item => item.SubjectAssignments == ss.SubjectAssignments);
                    Schedules.RemoveAt(index);
                }
            }


            gvFail.DataSource = FailedSubjects;
            gvAllSchedules.DataSource = Schedules;

            if (ControlStudent.UnitsFailedLastYear == 0 && StudentSubs.Count == 0)
            {
              //  int sectionCode = (int)cbSection.SelectedValue;
                Schedule = new List<StudentSchedule>(registrationService.GetSubjectsOfSection(gradeSectionCode, SY));
                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;
            }
            else if (StudentSubs.Count > 0)
            {
                GlobalClass.gvDatasource = 2;
                ControlSchedule = ExistingSchedule;
                gvAllSchedules.ReadOnly = false;
                gvSchedule.ReadOnly = false;
                gvSchedule.DataSource = ControlSchedule;
            }
            else if (ControlStudent.UnitsFailedLastYear > 0)
            {
                GlobalClass.gvDatasource = 3;
                gvAllSchedules.ReadOnly = false;
                gvSchedule.ReadOnly = false;
            }
        }
Example #8
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            List<StudentSchedule> ss = new List<StudentSchedule>();
            gvAllSchedules.DataSource = ss;
            gvSchedule.DataSource = ss;

            Schedules.AddRange(AddFromAll);

            List<StudentSchedule> selControlledTrue = AddFromAll.FindAll(item => item.Selected == true);

            IGradingService gradingService = new GradingService();
            listStSub = gradingService.GetStudentGrades(controlStudentId, SY);
            
            foreach (StudentSchedule sche in selControlledTrue) {
                if (listStSub != null)
                    stSubj = listStSub.Find(item => item.StudentSY == controlStudentId + SY && item.SubjectCode == sche.SubjectCode);

                if (stSubj != null)
                {
                    if (stSubj.FirstPeriodicRating > 0 || stSubj.SecondPeriodicRating > 0 || stSubj.ThirdPeriodicRating > 0 || stSubj.FourthPeriodicRating > 0 || stSubj.FinalRating > 0)
                    {
                        MessageBox.Show("Cannot remove " + stSubj.Description + ", already has grade/s inputted", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        int i = ControlSchedule.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        ControlSchedule[i].Selected = false;

                        int i3 = ExistingSchedRemove.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        ExistingSchedRemove.RemoveAt(i3);
                    }
                    else
                    {
                        int i = ControlSchedule.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        ControlSchedule.RemoveAt(i);

                        int i2 = Schedules.FindIndex(item => item.SubjectAssignments == sche.SubjectAssignments);
                        Schedules[i2].Selected = false;

                    }
                }
            }

                  
            gvAllSchedules.DataSource = Schedules;
            gvSchedule.DataSource = ControlSchedule;
            AddFromAll.Clear();
        }
Example #9
0
        private void cbEditor1_ValueChanged(object sender, EventArgs e)
        {
            StudentSchedule sa = new StudentSchedule();
            int i = gvAllSchedules.CurrentRow.Index;
            string subass = gvAllSchedules.Rows[i].Cells["SubjectAssignments"].Value.ToString();
            int index = Schedules.FindIndex(item => item.SubjectAssignments == subass);

            Schedules[index].Selected = false;
            sa = Schedules[index];

            RadCheckBoxEditor cbEditor1 = sender as RadCheckBoxEditor;
                StudentSubject ss = new StudentSubject()
                {
                    StudentSY = controlStudentId + SY,
                    SubjectCode = sa.SubjectCode,
                    SubjectAssignments = sa.SubjectAssignments,
                    StudentEnrSubCode = controlStudentId + SY + sa.SubjectCode,
                    LockFirst = false,
                    LockSecond = false,
                    LockThird = false,
                    LockFourth = false,
                    FirstPeriodicRating = 0.00,
                    SecondPeriodicRating = 0.00,
                    ThirdPeriodicRating = 0.00,
                    FourthPeriodicRating = 0.00
                };

                if ((Telerik.WinControls.Enumerations.ToggleState)cbEditor1.Value == Telerik.WinControls.Enumerations.ToggleState.On)
                {
                    sa.Selected = false;
                    AddFromControl.Add(sa);
                    subjects.Add(ss);
                    Schedules.Remove(sa);
                }
                else if ((Telerik.WinControls.Enumerations.ToggleState)cbEditor1.Value == Telerik.WinControls.Enumerations.ToggleState.Off)
                {
                    sa.Selected = false;
                    ControlSchedule.Remove(sa);
                    subjects.Remove(ss);
                    AddFromAll.Add(sa);
                }
            
        }
Example #10
0
        public List<StudentSubject> GetStudentSubjects(string studentIdSy)
        {
            List<StudentSubject> ss = new List<StudentSubject>();
            List<StudentSubjectBDO> ssbdo = new List<StudentSubjectBDO>();
            ssbdo = ssl.GetStudentSubjects(studentIdSy);
            foreach (StudentSubjectBDO s in ssbdo)
            {
                StudentSubject ssub = new StudentSubject();
                TranslateStuSubjectsBDOToStuSubjects(s, ssub);
                ss.Add(ssub);
            }
            return ss;

        }
Example #11
0
 public List<StudentSubject> GetFailedSubjects(string IDSy)
 {
     List<StudentSubject> subs = new List<StudentSubject>();
     List<StudentSubjectBDO> subsbdo = new List<StudentSubjectBDO>();
     subsbdo = ssl.GetFailedSubjects(IDSy);
     foreach (StudentSubjectBDO ssb in subsbdo)
     {
         StudentSubject ss = new StudentSubject();
         TranslateStuSubjectsBDOToStuSubjects(ssb, ss);
         subs.Add(ss);
     }
     return subs;
 }
Example #12
0
        public void TranslateStuSubjectsBDOToStuSubjects(StudentSubjectBDO sbdo, StudentSubject s)
        {
            SubjectService ss = new SubjectService();
            Subject sub = new Subject();

            ss.TranslateSubjectBDOToSubject(sbdo.Subject, sub);
            s.SubjectCode = sbdo.SubjectCode;
            s.Description = sub.Description;

            RegistrationService rs = new RegistrationService();
            StudentEnrollment se = new StudentEnrollment();
            rs.TranslatEnrolBDOToEnrol(sbdo.StudentEnrollment, se);
            s.StudentEnr = se;

            s.StudentSY = sbdo.StudentSY;

            s.StudentId = se.StudentId;
            s.StudentName = se.StudentName;

            s.StudentSubjectsID = sbdo.StudentSubjectsID;
            s.StudentEnrSubCode = sbdo.StudentEnrSubCode;
            s.Remarks = sbdo.Remarks;
            s.FirstPeriodicRating = sbdo.FirstPeriodicRating;
            s.SecondPeriodicRating = sbdo.SecondPeriodicRating;
            s.ThirdPeriodicRating = sbdo.ThirdPeriodicRating;
            s.FourthPeriodicRating = sbdo.FourthPeriodicRating;
            s.Description = sub.Description;
            s.SubjectAssignments = sbdo.SubjectAssignments;
            s.FirstEntered = sbdo.FirstEntered;
            s.FirstLocked = sbdo.FirstLocked;
            s.FourthEntered = sbdo.FourthEntered;
            s.FourthLocked = sbdo.FourthLocked;
            s.LockFirst = sbdo.LockFirst;
            s.LockFourth = sbdo.LockFourth;
            s.LockSecond = sbdo.LockSecond;
            s.LockThird = sbdo.LockThird;
            s.SecondEntered = sbdo.SecondEntered;
            s.SecondLocked = sbdo.SecondLocked;
            s.ThirdEntered = sbdo.ThirdEntered;
            s.ThirdLocked = sbdo.ThirdLocked;
            s.FinalRating = (double)sbdo.FourthPeriodicRating;

            if (s.FinalRating > 90)
                s.Proficiency = "O";
            else if (s.FinalRating >= 85)
                s.Proficiency = "VS";
            else if (s.FinalRating >= 80)
                s.Proficiency = "S";
            else if (s.FinalRating >= 75)
                s.Proficiency = "FS";
            else if (s.FinalRating <= 74)
                s.Proficiency = "D";

        }