Exemple #1
0
        public override EmployerStudentCategory TranslateToModel(EMPLOYER_STUDENT_CATEGORY entity)
        {
            try
            {
                EmployerStudentCategory model = null;
                if (entity != null)
                {
                    model                 = new EmployerStudentCategory();
                    model.Id              = entity.Employer_Student_Category_Id;
                    model.Person          = _personTranslator.Translate(entity.EMPLOYER.PERSON);
                    model.StudentCategory = _studentCategoryTranslator.Translate(entity.STUDENT_CATEGORY);
                    model.TeacherType     = _teacherTypeTranslator.Translate(entity.TEACHER_TYPE);
                    model.NoOfStudent     = entity.No_Of_Student;
                }

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #2
0
        public override Teacher TranslateToModel(TEACHER entity)
        {
            try
            {
                Teacher model = null;
                if (entity != null)
                {
                    model                    = new Teacher();
                    model.Person             = _personTranslator.Translate(entity.PERSON);
                    model.Type               = _teacherTypeTranslator.Translate(entity.TEACHER_TYPE);
                    model.Rating             = _ratingTranslator.Translate(entity.RATING);
                    model.VerificationStatus = _teacherVerificationStatusTranslator.Translate(entity.TEACHER_VERIFICATION_STATUS);
                    model.AvailabilityStatus = _teacherAvailabilityStatusTranslator.Translate(entity.TEACHER_AVAILABILITY_STATUS);

                    model.Sex          = _sexTranslator.TranslateToModel(entity.SEX);
                    model.ImageFileUrl = entity.Image_File_Url;
                    model.DateOfBirth  = entity.Date_Of_Birth;
                    model.HomeTown     = entity.Home_Town;
                    model.HomeAddress  = entity.Home_Address;

                    model.YearOfBirth = new Value()
                    {
                        Id = model.DateOfBirth.Year
                    };
                    model.MonthOfBirth = new Value()
                    {
                        Id = model.DateOfBirth.Month
                    };
                    model.DayOfBirth = new Value()
                    {
                        Id = model.DateOfBirth.Day
                    };

                    //if (model.DateOfBirth.HasValue)
                    //{
                    //    model.YearOfBirth = new Value() { Id = model.DateOfBirth.Value.Year };
                    //    model.MonthOfBirth = new Value() { Id = model.DateOfBirth.Value.Month };
                    //    model.DayOfBirth = new Value() { Id = model.DateOfBirth.Value.Day };
                    //}

                    if (entity.PERSON != null && entity.PERSON.PERSON_LOGIN != null)
                    {
                        model.LoginDetail = loginDetalTranslator.Translate(entity.PERSON.PERSON_LOGIN);
                    }
                    if (entity.TEACHER_EDUCATIONAL_QUALIFICATION != null && entity.TEACHER_EDUCATIONAL_QUALIFICATION.Count > 0)
                    {
                        model.EducationalQualifications = _teacherEducationalQualificationTranslator.Translate(entity.TEACHER_EDUCATIONAL_QUALIFICATION.ToList());
                    }
                    if (entity.TEACHER_STUDENT_CATEGORY != null && entity.TEACHER_STUDENT_CATEGORY.Count > 0)
                    {
                        model.StudentCategories = _teacherStudentCategoryTranslator.Translate(entity.TEACHER_STUDENT_CATEGORY.ToList());
                    }
                    if (entity.TEACHER_EMPLOYMENT_HISTORY != null && entity.TEACHER_EMPLOYMENT_HISTORY.Count > 0)
                    {
                        model.EmploymentHistories = _teacherEmploymentHistoryTranslator.Translate(entity.TEACHER_EMPLOYMENT_HISTORY.ToList());
                    }
                }

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }