Esempio n. 1
0
        public Boolean EnrolStudent(StudentEnrollment studentEnr)
        {
            GradeSectionLogic    gsl        = new GradeSectionLogic();
            StudentService       ss         = new StudentService();
            StudentEnrollmentBDO studentBDO = new StudentEnrollmentBDO();

            string message = string.Empty;

            List <GradeSectionBDO> sections = new List <GradeSectionBDO>();
            string grade = studentEnr.GradeLevel;

            sections = (gsl.GetAllSectionsofGrade(grade));

            int div = studentEnr.Rank / 20;

            div++;
            int index = sections.FindIndex(item => item.Class == div);

            studentEnr.GradeSectionCode = (int?)sections[index].GradeSectionCode;
            TranslatEnrolToEnrolBDO(studentEnr, studentBDO);
            if (sel.RegisterStudent(studentBDO, ref message))
            {
                string section = String.Empty;
                studentBDO.GradeSectionCode = studentEnr.GradeSectionCode;
                index   = sections.FindIndex(item => item.GradeSectionCode == studentEnr.GradeSectionCode);
                section = sections[index].Section;
                ss.UpdateStudent(studentEnr.StudentId, studentEnr.GradeLevel, studentEnr.Rank, section);
                ControlStudentCharacters(studentBDO);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
 public List <GradeSection> GetAllSectionsForGrade(string gradeLevel)
 {
     return(ToGradeSectionList(gsLogic.GetAllSectionsofGrade(gradeLevel)));
 }