Example #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;
        }
Example #2
0
        public bool EnrolIrregStudent(StudentEnrollment studentEnr)
        {
            GradeSectionLogic gsl = new GradeSectionLogic();
            StudentService ss = new StudentService();
            StudentEnrollmentBDO studentBDO = new StudentEnrollmentBDO();
            TranslatEnrolToEnrolBDO(studentEnr, studentBDO);
            string message = string.Empty;
            if (sel.RegisterStudent(studentBDO, ref message))
            {
                string section = String.Empty;
                int gsc = (int)studentEnr.GradeSectionCode;
                section = gsl.GetSection(gsc);
                ss.UpdateStudent(studentEnr.StudentId, studentEnr.GradeLevel, studentEnr.Rank, section);
                ControlStudentCharacters(studentBDO);
                return true;
            }

            else return false;
        }