private PersonPrincipal LocalMapForPricipal(PM.Principal p) { return(new Common.PersonPrincipal { Address = new DataType.AddressData(p.PersonAddress), Identity = new DataType.IdentifyData(p.PersonIdentify), Name = new DataType.NameData(p.PersonName), TELData = new DataType.TELData(p.PersonTel), IsPartTime = p.IsPartTime }); }
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); }