Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 9
0
 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;
 }