예제 #1
0
 public Contact Map(ContactDTO dto)
 {
     if (dto == null) return null;
     Contact contact =  Mapper.Map<ContactDTO, Contact>(dto);
     contact.MStatus = MaritalStatas.Single;// _maritalStatusRepository.GetById(dto.MaritalStatusMasterId);
     contact.ContactType = _contactTypeRepository.GetById(dto.ContactTypeMasterId);
     return contact;
 }
 private ContactDTO Map(tblContact tbl)
 {
     var dto = new ContactDTO
                   {
                       MasterId = tbl.id,
                       DateCreated = tbl.IM_DateCreated,
                       DateLastUpdated = tbl.IM_DateLastUpdated,
                       StatusId = tbl.IM_Status,
                       Firstname = tbl.Firstname,
                       Lastname = tbl.Lastname,
                       BusinessPhone = tbl.BusinessPhone,
                       Fax = tbl.Fax,
                       MobilePhone = tbl.MobilePhone,
                       PhysicalAddress = tbl.PhysicalAddress,
                       PostalAddress = tbl.PostalAddress,
                       SpouseName = tbl.SpouseName,
                       Email = tbl.Email,
                       Company = tbl.Company,
                       JobTitle = tbl.JobTitle,
                       HomeTown = tbl.HomeTown,
                       HomePhone = tbl.HomePhone,
                       WorkExtPhone = tbl.WorkExtPhone,
                       ChildrenNames = tbl.ChildrenNames,
                       City = tbl.City,
                       ContactTypeMasterId = tbl.ContactType ?? Guid.Empty,
                       ContactOwnerMasterId = tbl.CostCenterId,
                       MaritalStatusMasterId = tbl.MaritalStatusId ?? 0,
                       ContactClassificationId = tbl.ContactClassification ?? 0,
                       ContactOwnerType = tbl.ContactOwner,
                       DateOfBirth = tbl.DateOfBirth
                   };
     return dto;
 }