private void PopulateFieldData(OrgUnitSearchResultDto location, Field field)
        {
            //Handle Dynamic Column Data
            if (field.FieldName.StartsWith(Constants.DynamicColumnPrefix))
            {
                var dynamicColumnFieldName = field.FieldName.Replace(Constants.DynamicColumnPrefix, string.Empty);
                var dynamicColumn = _dynamicColumnData.FirstOrDefault(c => c.FieldName == dynamicColumnFieldName);
                if (dynamicColumn != null && _dynamicColumnDefinitions.Any(c => c.Name == dynamicColumnFieldName))
                    field.Value = dynamicColumn.FieldValue;
                else
                    field.Value = string.Empty;
            }
            //Handle Standard Column Data
            else
            {
                switch (field.FieldName)
                {
                    case "Services":
                        field.Values = location.ServicesDescription.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(s => s).Cast<object>().ToList();
                        break;
                    case "LocationNameLink":
                        field.Value = location.Name;
                        field.URL = _view.CalculateLocationUrl(location.Id, _baseDetailPageUrl);
                        break;
                    case "LocationName":
                        field.Value = location.Name;
                        break;
                    case "LocationDescription":
                        field.Value = location.Description;
                        break;
                    case "LocationCity":
                        field.Value = location.City;
                        break;
                    case "LocationState":
                        field.Value = location.StateName;
                        break;
                    case "LocationPostalCode":
                        field.Value = location.PostalCode;
                        break;
                    case "LocationFax":
                        field.Value = location.Fax;
                        break;
                    case "LocationPhone":
                        field.Value = location.Phone;
                        break;
                    case "LocationAddress":
                        field.Value = location.CompleteAddress;
                        break;
                    case "LocationAddress1":
                        field.Value = location.Address1;
                        break;
                    case "LocationAddress2":
                        field.Value = location.Address2;
                        break;
                    case "LocationImage":
                        if (!string.IsNullOrEmpty(location.ImageUrl))
                            field.URL = location.ImageUrl;
                        else
                            field.URL = _view.DefaultLocationImageUrl;

                        field.Value = location.Name;
                        break;
                    case "Custom1":
                        field.Value = location.Custom1;
                        break;
                    case "Custom2":
                        field.Value = location.Custom2;
                        break;
                    case "Custom3":
                        field.Value = location.Custom3;
                        break;
                    case "Distance":
                        if (location.OrgUnitDistance.HasValue)
                            field.Value = Decimal.Round((Decimal)location.OrgUnitDistance.Value, 2) + " Miles";
                        else
                            field.Value = null;
                        break;
                    case "ConditionalField":
                        if (string.IsNullOrEmpty(field.ConditionalSettings.ConditionalField) ||
                        string.IsNullOrEmpty(field.ConditionalSettings.ConditionalValue) ||
                        string.IsNullOrEmpty(field.ConditionalSettings.ConditionOperation))
                            return;

                        var conditionalField = _viewSettings.AvailableFields.First(f => f.FieldName == field.ConditionalSettings.ConditionalField);
                        PopulateFieldData(location, conditionalField);

                        Field fieldToShow = null;
                        if (!string.IsNullOrEmpty(field.ConditionalSettings.FieldToShow))
                        {
                            fieldToShow = _viewSettings.AvailableFields.First(f => f.FieldName == field.ConditionalSettings.FieldToShow);
                            PopulateFieldData(location, fieldToShow);
                        }

                        CommonUtils.PopulateConditionalFieldValue(field, conditionalField, fieldToShow);
                        break;
                }
            }
        }
        private MapItem BuildMapItem(OrgUnitSearchResultDto location, int locationNumber)
        {
            var mapItem = new MapItem()
            {
                Title = location.Name,
                LocationNumber = locationNumber,
                LocationAddress = string.Format("{0}, {1}, {2} {3}", location.Address1, location.City, location.StateName, location.PostalCode),
                LocationPhoneNum = location.Phone,
                DirectUrl = _view.CalculateLocationUrl(location.Id, _baseDetailPageUrl),
                HasCustomCoordinates = location.HasCustomCoordinates,
                Latitude = location.Latitude.HasValue ? location.Latitude.ToString() : null,
                Longitude = location.Longitude.HasValue ? location.Longitude.ToString() : null,
                ImageUrl = location.ImageUrl
            };

            return mapItem;
        }