private void RenderTargetList(IEnumerable <LocationReference> locations)
 {
     foreach (var location in locations)
     {
         string record  = GetStructuredLocations.GetRecord(null, location.NamedLocation, true, true);
         string display = GetStructuredLocations.GetRecord(null, location.NamedLocation, false, false);
         selTarget.Items.Add(new ListItem(display, record));
     }
 }
        private void SetDetailsFromMemberProfile()
        {
            if (_candidate == null)
            {
                return;
            }

            UserRelocationPreference = _candidate.RelocationPreference;
            if (_candidate.RelocationPreference != RelocationPreference.No)
            {
                hiddSelectedLocalities.Value = GetStructuredLocations.GetRecords(_candidate.RelocationLocations);
                RenderTargetList(_candidate.RelocationLocations);
            }
        }
        public static IList <LocationReference> GetSelectedLocations(Candidate candidate, string value)
        {
            var locations = new List <LocationReference>();

            if (string.IsNullOrEmpty(value))
            {
                return(locations);
            }

            // Parse the records for the named locations.

            IList <NamedLocation> namedLocations = GetStructuredLocations.ParseRecords(value);

            foreach (NamedLocation namedLocation in namedLocations)
            {
                locations.Add(new LocationReference(namedLocation));
            }

            return(locations);
        }