private PersonContact LocalMapForContacts(PM.Contacts c) { return(new Common.PersonContact { Address = new DataType.AddressData(c.PersonAddress), Identity = new DataType.IdentifyData(c.PersonIdentify), Name = new DataType.NameData(c.PersonName), Occupation = new DataType.OccupationData(c.PersonOccupation), TELData = new DataType.TELData(c.PersonTel) }); }
private AgencyItem LocalMap(PM.Agency agency) { AgencyItem item = new AgencyItem(); item.AgencyAlias = agency.AgencyAlias; item.AgencyId = agency.AgencyID; item.AgencyName = agency.AgencyName; int temp = 0; int.TryParse(agency.AgencyStatus, out temp); item.AgencyStatus = temp; item.IsHQ = agency.IsHQ; item.Address = new DataType.AddressData(agency.Address); PM.Contacts c = agency.Children <PM.Contacts>().FirstOrDefault(x => x.ContentType.Alias == PM.Contacts.ModelTypeAlias); item.Contacts = LocalMapForContacts(c); PM.Principal p = agency.Children <PM.Principal>().FirstOrDefault(x => x.ContentType.Alias == PM.Principal.ModelTypeAlias); item.Principal = LocalMapForPricipal(p); item.AccreditationName = agency.AccreditationType; return(item); }