private ICollection <TeacherEducationalBackground> ToEducationalBackList(List <TeacherEducationalBackgroundBDO> tcl) { ICollection <TeacherEducationalBackground> ebList = new List <TeacherEducationalBackground>(); foreach (TeacherEducationalBackgroundBDO tc in tcl) { TeacherEducationalBackground eb = new TeacherEducationalBackground(); ConvertTeacherEducationalBackgroundBDOToTeacherEducationalBackground(tc, eb); ebList.Add(eb); } return(ebList); }
public void ConvertTeacherEducationalBackgroundBDOToTeacherEducationalBackground(TeacherEducationalBackgroundBDO tc, TeacherEducationalBackground eb, string teacherId) { eb.Course = tc.Course; eb.Deactivated = tc.Deactivated; eb.EducLevel = tc.EducLevel; eb.HonorsReceived = tc.HonorsReceived; eb.NameOfSchool = tc.NameOfSchool; eb.TeacherId = teacherId; eb.TEBId = tc.TEBId; eb.TEBYearFrom = tc.TEBYearFrom; eb.TEBYearTo = tc.TEBYearTo; }
public void ConvertTeacherEducationalBackgroundToTeacherEducationalBackgroundBDO(TeacherEducationalBackground tc, TeacherEducationalBackgroundBDO eb) { eb.Course = tc.Course; eb.Deactivated = tc.Deactivated; eb.EducLevel = tc.EducLevel; eb.HonorsReceived = tc.HonorsReceived; eb.NameOfSchool = tc.NameOfSchool; eb.TeacherId = tc.TeacherId; eb.TEBId = tc.TEBId; eb.TEBYearFrom = (DateTime)tc.TEBYearFrom; eb.TEBYearTo = (DateTime)tc.TEBYearTo; }
public Boolean CreateTeacherEducationalBackground(List <TeacherEducationalBackgroundBDO> tcbdo, string teacherId) { Boolean ret = true; foreach (TeacherEducationalBackgroundBDO t in tcbdo) { TeacherEducationalBackground te = new TeacherEducationalBackground(); ConvertTeacherEducationalBackgroundBDOToTeacherEducationalBackground(t, te, teacherId); using (var DCEnt = new DCFIEntities()) { DCEnt.TeacherEducationalBackgrounds.Attach(te); int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; } } } return(ret); }
public Boolean CreateTeacherEducationalBackground(List<TeacherEducationalBackgroundBDO> tcbdo, string teacherId) { Boolean ret = true; try { foreach (TeacherEducationalBackgroundBDO t in tcbdo) { TeacherEducationalBackground te = new TeacherEducationalBackground(); ConvertTeacherEducationalBackgroundBDOToTeacherEducationalBackground(t, te, teacherId); using (var DCEnt = new DCFIEntities()) { DCEnt.TeacherEducationalBackgrounds.Attach(te); int num = DCEnt.SaveChanges(); if (num != 1) ret = false; } } } 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 ret; }
private ICollection<TeacherEducationalBackground> ToEducationalBackList(List<TeacherEducationalBackgroundBDO> tcl) { ICollection<TeacherEducationalBackground> ebList = new List<TeacherEducationalBackground>(); foreach (TeacherEducationalBackgroundBDO tc in tcl) { TeacherEducationalBackground eb = new TeacherEducationalBackground(); ConvertTeacherEducationalBackgroundBDOToTeacherEducationalBackground(tc, eb); ebList.Add(eb); } return ebList; }
public Boolean CreateTeacherEducationalBackground(List<TeacherEducationalBackgroundBDO> tcbdo, string teacherId) { Boolean ret = true; foreach (TeacherEducationalBackgroundBDO t in tcbdo) { TeacherEducationalBackground te = new TeacherEducationalBackground(); ConvertTeacherEducationalBackgroundBDOToTeacherEducationalBackground(t, te, teacherId); using (var DCEnt = new DCFIEntities()) { DCEnt.TeacherEducationalBackgrounds.Attach(te); int num = DCEnt.SaveChanges(); if (num != 1) ret = false; } } return ret; }