예제 #1
0
        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);
        }