public SubjectAssignmentBDO GetScheduleInfo(int sAi) { SchoolYearDAO syd = new SchoolYearDAO(); currentSY = syd.CurrentSY(); SubjectAssignment schedInfo = new SubjectAssignment(); SubjectAssignmentBDO saBDO = new SubjectAssignmentBDO(); try { using (var DCEnt = new DCFIEntities()) { schedInfo = (from sched in DCEnt.SubjectAssignments where sched.Deactivated == false && sched.SY.Equals(currentSY) && sched.SubjectAssignmentsID == sAi select sched).FirstOrDefault <SubjectAssignment>(); ConvertSubjectAssignmentToSubjectAssignmentBDO(schedInfo, saBDO); } } 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(saBDO); }
public List <SubjectAssignmentBDO> GetAllSchedulesbySection(int iGradeSection) { SchoolYearDAO syd = new SchoolYearDAO(); currentSY = syd.CurrentSY(); List <SubjectAssignment> saList = new List <SubjectAssignment>(); List <SubjectAssignmentBDO> sabdoList = new List <SubjectAssignmentBDO>(); try{ using (var DCEnt = new DCFIEntities()) { var allSchedule = (from sched in DCEnt.SubjectAssignments where sched.Deactivated == false && sched.SY.Equals(currentSY) && sched.GradeSectionCode == iGradeSection select sched).ToList <SubjectAssignment>(); saList = allSchedule; foreach (SubjectAssignment sa in saList) { SubjectAssignmentBDO saBDO = new SubjectAssignmentBDO(); ConvertSubjectAssignmentToSubjectAssignmentBDO(sa, saBDO); sabdoList.Add(saBDO); } } } 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(sabdoList); }
public List<SubjectAssignmentBDO> GetAllSchedules() { SchoolYearDAO syd = new SchoolYearDAO(); currentSY = syd.CurrentSY(); List<SubjectAssignment> saList = new List<SubjectAssignment>(); List<SubjectAssignmentBDO> sabdoList = new List<SubjectAssignmentBDO>(); try { using (var DCEnt = new DCFIEntities()) { var allSchedule = (from sched in DCEnt.SubjectAssignments where sched.Deactivated == false && sched.SY.Equals(currentSY) select sched).ToList<SubjectAssignment>(); saList = allSchedule; foreach (SubjectAssignment sa in saList) { SubjectAssignmentBDO saBDO = new SubjectAssignmentBDO(); ConvertSubjectAssignmentToSubjectAssignmentBDO(sa, saBDO); sabdoList.Add(saBDO); } } } 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 sabdoList; }
public SubjectAssignmentBDO GetScheduleInfo(int sAi) { SchoolYearDAO syd = new SchoolYearDAO(); currentSY = syd.CurrentSY(); SubjectAssignment schedInfo = new SubjectAssignment(); SubjectAssignmentBDO saBDO = new SubjectAssignmentBDO(); try { using (var DCEnt = new DCFIEntities()) { schedInfo = (from sched in DCEnt.SubjectAssignments where sched.Deactivated == false && sched.SY.Equals(currentSY) && sched.SubjectAssignmentsID == sAi select sched).FirstOrDefault<SubjectAssignment>(); ConvertSubjectAssignmentToSubjectAssignmentBDO(schedInfo, saBDO); } } 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 saBDO; }