public override TEACHER TranslateToEntity(Teacher model) { try { TEACHER entity = null; if (model != null) { entity = new TEACHER(); entity.Person_Id = model.Person.Id; entity.Teacher_Type_Id = model.Type.Id; entity.Rating_Id = model.Rating.Id; entity.Verification_Status_Id = model.VerificationStatus.Id; entity.Availability_Status_Id = model.AvailabilityStatus.Id; entity.Sex_Id = model.Sex.Id; entity.Image_File_Url = model.ImageFileUrl; entity.Date_Of_Birth = model.DateOfBirth; entity.Home_Town = model.HomeTown; entity.Home_Address = model.HomeAddress; entity.PERSON = _personTranslator.TranslateToEntity(model.Person); entity.TEACHER_REFEREE = _refereeTranslator.TranslateToEntity(model.Referee); entity.TEACHER_EDUCATIONAL_QUALIFICATION = _teacherEducationalQualificationTranslator.Translate(model.EducationalQualifications); if (model.EmploymentHistories != null && model.EmploymentHistories.Count > 0) { entity.TEACHER_EMPLOYMENT_HISTORY = _teacherEmploymentHistoryTranslator.Translate(model.EmploymentHistories); } entity.TEACHER_STUDENT_CATEGORY = _teacherStudentCategoryTranslator.Translate(model.StudentCategories); entity.TEACHER_AVAILABILITY = _teacherAvailabilityTranslator.Translate(model.TeacherAvailabilities); if (model.TeacherAwards != null && model.TeacherAwards.Count > 0) { entity.TEACHER_AWARD = _teacherAwardTranslator.Translate(model.TeacherAwards); } if (model.LoginDetail != null && model.LoginDetail.Person != null) { entity.PERSON.PERSON_LOGIN = loginDetalTranslator.Translate(model.LoginDetail); } } return(entity); } catch (Exception) { throw; } }
public override RequestForEmploymentTeacherAvailability TranslateToModel(REQUEST_FOR_EMPLOYMENT_TEACHER_AVAILABILITY entity) { try { RequestForEmploymentTeacherAvailability model = null; if (entity != null) { model = new RequestForEmploymentTeacherAvailability(); model.Id = entity.Request_For_Employment_Teacher_Availability_Id; model.CostImplication = _requestForEmploymentCostImplicationTranslator.Translate(entity.REQUEST_FOR_EMPLOYMENT_COST_IMPLICATION); model.TeacherAvailability = _teacherAvailabilityTranslator.Translate(entity.TEACHER_AVAILABILITY); model.TeachingCost = _teachingCostTranslator.Translate(entity.TEACHING_COST); } return(model); } catch (Exception) { throw; } }