public void ConvertTeacherEligibilityToTeacherEligibilityBDO(TeacherEligibility tc, TeacherEligibilityBDO telig) { telig.DateOfExam = (DateTime)tc.DateOfExam; telig.Eligibility = tc.Eligibility; telig.EligibilityId = tc.EligibilityId; telig.IssueDate = (DateTime)tc.IssueDate; telig.LicenseNumber = tc.LicenseNumber; telig.PlaceOfExam = tc.PlaceOfExam; telig.Rating = tc.Rating; telig.TeacherId = tc.TeacherId; }
private ICollection <TeacherEligibility> ToEligibilityList(List <TeacherEligibilityBDO> tcl) { ICollection <TeacherEligibility> teList = new List <TeacherEligibility>(); foreach (TeacherEligibilityBDO tc in tcl) { TeacherEligibility telig = new TeacherEligibility(); ConvertTeacherEligibilityBDOToTeacherEligibility(tc, telig); teList.Add(telig); } return(teList); }
public Boolean CreateTeacherEligibilities(List <TeacherEligibilityBDO> tcbdo, string teacherId) { Boolean ret = true; foreach (TeacherEligibilityBDO t in tcbdo) { TeacherEligibility te = new TeacherEligibility(); ConvertTeacherEligibilityBDOToTeacherEligibility(t, te, teacherId); using (var DCEnt = new DCFIEntities()) { DCEnt.TeacherEligibilities.Attach(te); int num = DCEnt.SaveChanges(); if (num != 1) { ret = false; } } } return(ret); }
public Boolean CreateTeacherEligibilities(List<TeacherEligibilityBDO> tcbdo, string teacherId) { Boolean ret = true; try { foreach (TeacherEligibilityBDO t in tcbdo) { TeacherEligibility te = new TeacherEligibility(); ConvertTeacherEligibilityBDOToTeacherEligibility(t, te, teacherId); using (var DCEnt = new DCFIEntities()) { DCEnt.TeacherEligibilities.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<TeacherEligibility> ToEligibilityList(List<TeacherEligibilityBDO> tcl) { ICollection<TeacherEligibility> teList = new List<TeacherEligibility>(); foreach (TeacherEligibilityBDO tc in tcl) { TeacherEligibility telig = new TeacherEligibility(); ConvertTeacherEligibilityBDOToTeacherEligibility(tc, telig); teList.Add(telig); } return teList; }
private void ConvertTeacherEligibilityBDOToTeacherEligibility(TeacherEligibilityBDO tc, TeacherEligibility telig) { telig.DateOfExam = tc.DateOfExam; telig.Eligibility = tc.Eligibility; telig.EligibilityId = tc.EligibilityId; telig.IssueDate = tc.IssueDate; telig.LicenseNumber = tc.LicenseNumber; telig.PlaceOfExam = tc.PlaceOfExam; telig.Rating = tc.Rating; telig.TeacherId = tc.TeacherId; }
public Boolean CreateTeacherEligibilities(List<TeacherEligibilityBDO> tcbdo, string teacherId) { Boolean ret = true; foreach (TeacherEligibilityBDO t in tcbdo) { TeacherEligibility te = new TeacherEligibility(); ConvertTeacherEligibilityBDOToTeacherEligibility(t, te, teacherId); using (var DCEnt = new DCFIEntities()) { DCEnt.TeacherEligibilities.Attach(te); int num = DCEnt.SaveChanges(); if (num != 1) ret = false; } } return ret; }