public List <StudentBDO> GetAllScholars() { StudentDAO sd = new StudentDAO(); List <Student> scholars = null; List <StudentBDO> sbdoList = new List <StudentBDO>(); try { using (var DCEnt = new DCFIEntities()) { scholars = (from s in DCEnt.Students select s).ToList <Student>(); } foreach (Student s in scholars) { StudentBDO studentBDO = new StudentBDO(); sd.ConvertStudentToStudentBDO(s, studentBDO); sbdoList.Add(studentBDO); } } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } } return(sbdoList); }
public void ConvertStuSubjectsToStuSubjectsBDO(StudentSubject s, StudentSubjectBDO sbdo) { StudentEnrolmentDAO sed = new StudentEnrolmentDAO(); StudentEnrollmentBDO sedb = new StudentEnrollmentBDO(); sed.ConvertEnrolToEnrolBDO(s.StudentEnrollment, sedb); sbdo.StudentEnrollment = sedb; StudentDAO sd = new StudentDAO(); StudentBDO sb = new StudentBDO(); sd.ConvertStudentToStudentBDO(s.StudentEnrollment.Student, sb); sbdo.StudentEnrollment.Student = sb; SubjectDAO subd = new SubjectDAO(); SubjectBDO sbo = new SubjectBDO(); subd.ConvertSubjectToSubjectBDO(s.Subject, sbo); sbdo.Subject = sbo; sbdo.StudentSY = s.StudentSY; sbdo.SubjectCode = s.SubjectCode; sbdo.StudentSubjectsID = s.StudentSubjectsID; sbdo.StudentEnrSubCode = s.StudentEnrSubCode; sbdo.Remarks = s.Remarks; sbdo.FirstPeriodicRating = s.FirstPeriodicRating; sbdo.SecondPeriodicRating = s.SecondPeriodicRating; sbdo.ThirdPeriodicRating = s.ThirdPeriodicRating; sbdo.FourthPeriodicRating = s.FourthPeriodicRating; sbdo.StudentEnrSubCode = s.StudentEnrSubCode; sbdo.SubjectAssignments = s.SubjectAssignments; sbdo.FirstEntered = s.FirstEntered; sbdo.SecondEntered = s.SecondEntered; sbdo.FourthEntered = s.FourthEntered; sbdo.ThirdEntered = s.ThirdEntered; sbdo.LockFirst = s.LockFirst; sbdo.LockSecond = s.LockSecond; sbdo.LockThird = s.LockThird; sbdo.LockFourth = s.LockFourth; sbdo.FirstLocked = s.FirstLocked; sbdo.SecondLocked = s.SecondLocked; sbdo.ThirdLocked = s.ThirdLocked; sbdo.FourthLocked = s.FourthLocked; }
public void ConvertEnrolToEnrolBDO(StudentEnrollment se, StudentEnrollmentBDO seb) { StudentDAO sd = new StudentDAO(); StudentBDO stu = new StudentBDO(); stu = sd.GetStudentBDO(se.StudentId); seb.StudentSY = se.StudentSY; seb.StudentId = se.StudentId; seb.SY = se.SY; seb.GradeLevel = se.GradeLevel; seb.GradeSectionCode = se.GradeSectionCode; seb.Dismissed = se.Dismissed; seb.Stat = se.Stat; seb.DiscountId = se.DiscountId; seb.Student = stu; seb.StudentEnrollmentsID = se.StudentEnrollmentsID; }
public List<StudentBDO> GetAllScholarsofScholarship(int scholarshipCode) { StudentDAO sd = new StudentDAO(); List<Student> scholars = null; List<StudentBDO> sbdoList = new List<StudentBDO>(); try { using (var DCEnt = new DCFIEntities()) { scholars = (from s in DCEnt.Students where s.ScholarshipDiscountId == scholarshipCode select s).ToList<Student>(); } foreach (Student s in scholars) { StudentBDO studentBDO = new StudentBDO(); sd.ConvertStudentToStudentBDO(s, studentBDO); sbdoList.Add(studentBDO); } } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { Trace.TraceInformation("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } } return sbdoList; }