public TeacherEntity(DataAccessLogic.tblTeacher teacher) { this.ID = teacher.ID; this.Fullname = teacher.Fullname; this.MotherName = teacher.MotherName; this.BirthDate = teacher.BirthDate; this.PhoneNumber = teacher.PhoneNumber; this.Email = teacher.Email; this.FieldOfStudy = teacher.FieldOfStudy; this.YearOfExperience = teacher.YearOfExperience; this.SkillDescription = teacher.SkillDescription; this.HouseNo = teacher.HouseNo; this.HiredDate = teacher.HiredDate; this.Status = teacher.Status; this.Campus = new CampusEntity(teacher.tblCampu); this.Department = new DepartmentEntity(teacher.tblDepartment); this.Gender = new GenderEntity(teacher.tblGender); this.MaritalStatus = new MaritalStatusEntity(teacher.tblMaritalStatu); this.Region = new RegionEntity(teacher.tblRegion); this.SubCity = new SubCityEntity(teacher.tblSubCity); this.Woreda = new WoredaEntity(teacher.tblWoreda); this.CreatedBy = teacher.CreatedBy; this.CreatedDate = teacher.CreatedDate; this.UpdatedBy = teacher.UpdatedBy; this.UpdatedDate = teacher.UpdatedDate; }
public T MapToModel <T>() where T : class { DataAccessLogic.tblTeacher teacher = new DataAccessLogic.tblTeacher(); teacher.ID = this.ID; teacher.Fullname = this.Fullname; teacher.MotherName = this.MotherName; teacher.BirthDate = this.BirthDate; teacher.PhoneNumber = this.PhoneNumber; teacher.Email = this.Email; teacher.FieldOfStudy = this.FieldOfStudy; teacher.YearOfExperience = this.YearOfExperience; teacher.SkillDescription = this.SkillDescription; teacher.HouseNo = this.HouseNo; teacher.HiredDate = this.HiredDate; teacher.Status = this.Status; teacher.CampusID = this.Campus.ID; teacher.DepartmentID = this.Department.ID; teacher.GenderID = this.Gender.ID; teacher.MaritalStatusID = this.MaritalStatus.ID; teacher.RegionID = this.Region.ID; teacher.SubCityID = this.SubCity.ID; teacher.WoredaID = this.Woreda.ID; teacher.CreatedBy = this.CreatedBy; teacher.CreatedDate = this.CreatedDate; teacher.UpdatedBy = this.UpdatedBy; teacher.UpdatedDate = this.UpdatedDate; return(teacher as T); }