public void Save(StudentPackage stPkg, Exception ex)
        {
            var student = stPkg.student;
            student.SchoolName = stPkg.school.Name;

            Save(new StudentErrorDto(student, stPkg.teacher, ex));
        }
        public void Save(StudentPackage stPkg)
        {
            var student = stPkg.student;
            student.SchoolName = stPkg.school.Name;
            student.TeacherId = stPkg.teacher.Id;

            Save(new StudentDownloadDto(student, stPkg.teacher));
        }
示例#3
0
        private static void saveStudent(StudentPackage stPkg, IStudentDownloadRepository repo,
                                        IStudentErrorRepository errorRepo)
        {
            try
            {
                repo.Save(stPkg);
            }

            catch (Exception  ex)
                    {
                        errorRepo.Save(stPkg, ex);
                    }
        }
        private StudentPackage getStudentFromRow(XElement row)
        {
            var pkg = new StudentPackage();
            var elements = row.Elements("td");
            var arr = elements.ToArray();
            var s = new StudentDto();
            s.FirstName = arr[0].Value;
            s.LastName = arr[1].Value;
            s.AmountFromWebsite = arr[5].Value.CastToDecimal();
            s.Address1 = arr[8].Value;
            s.Address2 = arr[9].Value;
            s.City = arr[10].Value;
            s.State = arr[11].Value;
            s.Zip = arr[12].Value;
            s.Phone = arr[13].Value;
            var school = new SchoolDto() {Name = correctSchoolName(arr[14].Value)};
            var teacher = new ContactDto() { LastName = arr[15].Value, Title = "Teacher" };

            s.Grade = arr[16].Value;
            pkg.school = school;
            pkg.teacher = teacher;
            pkg.student = s;
            return pkg;
        }