public override Request TranslateToModel(REQUEST entity) { try { Request model = null; if (entity != null) { model = new Request(); model.Id = entity.Request_Id; model.FromPerson = _personTranslator.Translate(entity.PERSON); model.ToPerson = _personTranslator.Translate(entity.PERSON1); model.RequestMessage = _messageTranslator.Translate(entity.MESSAGE); model.ReplyMessage = _messageTranslator.Translate(entity.MESSAGE1); model.ServiceCharge = _serviceChargeTranslator.Translate(entity.SERVICE_CHARGE); model.Status = _requestStatusTranslator.Translate(entity.REQUEST_STATUS); model.Date = entity.Request_Date; model.ReplyDate = entity.Reply_Date; } return(model); } catch (Exception) { throw; } }
public override LoginDetail TranslateToModel(PERSON_LOGIN entity) { try { LoginDetail model = null; if (entity != null) { model = new LoginDetail(); model.Person = _personTranslator.Translate(entity.PERSON); //model.Username = entity.Username; model.Password = entity.Password; model.SecurityQuestion = _securityQuestionTranslator.Translate(entity.SECURITY_QUESTION); model.SecurityAnswer = entity.Security_Answer; model.Role = _roleTranslator.Translate(entity.ROLE); model.IsActivated = entity.Is_Activated; model.IsLocked = entity.Is_Locked; model.IsFirstLogon = entity.Is_First_Login; model.FirstLogonDate = entity.First_Login_Date; model.LastLogonDate = entity.Last_Login_Date; } return(model); } catch (Exception) { throw; } }
public override Employer TranslateToModel(EMPLOYER entity) { try { Employer model = null; if (entity != null) { model = new Employer(); model.Person = _personTranslator.Translate(entity.PERSON); model.Name = entity.Employer_Name; model.Website = entity.Website; model.Sex = _sexTranslator.Translate(entity.SEX); if (entity.PERSON != null && entity.PERSON.PERSON_LOGIN != null) { model.LoginDetail = _loginDetalTranslator.Translate(entity.PERSON.PERSON_LOGIN); } if (entity.PERSON != null && entity.PERSON.PAYMENT != null && entity.PERSON.PAYMENT.Count > 0) { model.Payments = _paymentTranslator.Translate(entity.PERSON.PAYMENT.ToList()); } } return(model); } catch (Exception) { throw; } }
public override Payment TranslateToModel(PAYMENT entity) { try { Payment model = null; if (entity != null) { model = new Payment(); model.Id = entity.Payment_Id; model.Person = _personTranslator.Translate(entity.PERSON); model.Mode = _paymentModeTranslator.Translate(entity.PAYMENT_MODE); model.ServiceCharge = _serviceChargeTranslator.Translate(entity.SERVICE_CHARGE); model.SerialNumber = entity.Serial_Number; model.InvoiceNumber = entity.Invoice_Number; model.DateEntered = entity.Date_Entered; model.Paid = entity.Paid; model.DatePaid = entity.Date_Paid; } return(model); } catch (Exception) { throw; } }
public override TeacherStudentCategory TranslateToModel(TEACHER_STUDENT_CATEGORY entity) { try { TeacherStudentCategory model = null; if (entity != null) { model = new TeacherStudentCategory(); model.Id = entity.Teacher_Student_Category_Id; model.Person = _personTranslator.Translate(entity.TEACHER.PERSON); model.StudentCategory = _studentCategoryTranslator.Translate(entity.STUDENT_CATEGORY); } return(model); } catch (Exception) { throw; } }
public override TeacherAvailability TranslateToModel(TEACHER_AVAILABILITY entity) { try { TeacherAvailability model = null; if (entity != null) { model = new TeacherAvailability(); model.Id = entity.Teacher_Availability_Id; model.Person = _personTranslator.Translate(entity.TEACHER.PERSON); model.WeekDay = _weekDayTranslator.Translate(entity.WEEK_DAY); model.Period = _periodTranslator.Translate(entity.PERIOD); } return(model); } catch (Exception) { throw; } }
public override TeacherAward TranslateToModel(TEACHER_AWARD entity) { try { TeacherAward model = null; if (entity != null) { model = new TeacherAward(); model.Id = entity.Teacher_Award_Id; model.Person = _personTranslator.Translate(entity.TEACHER.PERSON); model.AwardBody = entity.Award_Body; model.AwardName = entity.Award_Name; model.YearAwarded = entity.Year_Awarded; } return(model); } catch (Exception) { throw; } }
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; } }
public override Referee TranslateToModel(TEACHER_REFEREE entity) { try { Referee model = null; if (entity != null) { model = new Referee(); model.Person = personTranslator.Translate(entity.TEACHER.PERSON); model.Name = entity.Referee_Name; model.ContactAddress = entity.Referee_Contact_Address; model.MobilePhone = entity.Referee_Mobile_Phone; model.Email = entity.Referee_Email_Address; } return(model); } catch (Exception) { throw; } }
public override TeacherEmploymentHistory TranslateToModel(TEACHER_EMPLOYMENT_HISTORY entity) { try { TeacherEmploymentHistory model = null; if (entity != null) { model = new TeacherEmploymentHistory(); model.Id = entity.Teacher_Employment_History_Id; model.Person = _personTranslator.Translate(entity.TEACHER.PERSON); model.Employer = entity.Employer; model.LastPositionHeld = entity.Last_Position_Held; model.StartYear = entity.Start_Year; model.EndYear = entity.End_Year; } return(model); } catch (Exception) { throw; } }
public override TeacherOLevelResult TranslateToModel(TEACHER_O_LEVEL_RESULT entity) { try { TeacherOLevelResult oLevelResult = null; if (entity != null) { oLevelResult = new TeacherOLevelResult(); oLevelResult.Id = entity.Teacher_O_Level_Result_Id; oLevelResult.Person = personTranslator.Translate(entity.TEACHER.PERSON); oLevelResult.ExamNumber = entity.Exam_Number; oLevelResult.ExamYear = entity.Exam_Year; oLevelResult.Sitting = oLevelExamSittingTranslator.Translate(entity.O_LEVEL_EXAM_SITTING); oLevelResult.Type = oLevelTypeTranslator.Translate(entity.O_LEVEL_TYPE); } return(oLevelResult); } catch (Exception) { throw; } }
public override TeacherEducationalQualification TranslateToModel(TEACHER_EDUCATIONAL_QUALIFICATION entity) { try { TeacherEducationalQualification model = null; if (entity != null) { model = new TeacherEducationalQualification(); model.Id = entity.Teacher_Educational_Qualification_Id; model.Person = _personTranslator.Translate(entity.TEACHER.PERSON); model.School = entity.School; model.SchoolType = _schoolTypeTranslator.Translate(entity.SCHOOL_TYPE); model.YearOfAdmission = entity.Year_Of_Admission; model.YearOfGraduation = entity.Year_Of_Graduation; model.Qualification = _qualificationTranslator.Translate(entity.QUALIFICATION); } return(model); } catch (Exception) { throw; } }
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; } }