private ListRefinerView BuildAdminSettingsView(ModuleInstanceView parent, ListRefinerView settingsData) { settingsData.AvailableFields.Clear(); settingsData.AvailableFields.Add(new Field("Event Topics", "Event Topics", FieldTypes.Filter, null) { FilterSettings = CreateTestFilterSettings("EventTopicId") }); //Org Unit Types var orgUnitTypes = parent.ProcessRequest<ListOrgUnitTypesResponse>(new ListOrgUnitTypesRequest() { IsEnabled = true, ExcludeOutsideOrgUnit = true }).OrgUnitTypes; foreach (var type in orgUnitTypes.Where(t => t.Name != Constants.Locations.LocationTypePrintableProviderDirectory)) { settingsData.AvailableFields.Add(new Field(type.Name, type.Name, FieldTypes.Filter, null) { FilterSettings = CreateTestFilterSettings("LocationId") }); } //Dynamic Columns var dynamicColumns = CommonUtils.GetDynamicColumnInstances(parent, Constants.EventDynamicColumnEntityId); foreach (var col in dynamicColumns.Where(c => c.DataType != "contentEditor" && c.DataType != "datetime")) { settingsData.AvailableFields.Add(new Field(Constants.DynamicColumnPrefix + col.FormLabel, col.FormLabel, FieldTypes.Filter, null) { FilterSettings = CreateTestFilterSettings(Constants.DynamicColumnPrefix + col.Name) }); } settingsData.AvailableFields = settingsData.AvailableFields.OrderBy(f => f.DisplayName).ToList(); // Add admin-only settings LocationContextHelper.AddLocationSettingsGroup(parent, settingsData); return settingsData; }
private ListRefinerView BuildPublicSettingsView(ModuleInstanceView parent, ListRefinerView settingsData, IDictionary<string, string> parameters) { // Establish correct search results page URL settingsData.UpdateSettingValue("SearchResultsPageUrl", EventUtils.CalculateSearchResultsUrl(settingsData, parent.SearchSettings.SearchResultsPageUrl)); var searchRequest = BuildRequest(parent, settingsData, parameters); var searchResponse = parent.ProcessRequest<ListSearchFiltersResponse>(searchRequest); PopulateSearchFilterValues(searchResponse.FilterTypes, settingsData, parameters); return settingsData; }
public static string ReadEventOccurrencSummary(ModuleInstanceView parent, IDictionary<string, string> parameters) { var request = new ReadEventOccurrenceSummaryRequest(); request.EventOccurrenceId = int.Parse(parameters["EventOccurrenceId"]); var occurrence = parent.ProcessRequest<ReadEventOccurrenceSummaryResponse>(request).EventOccurrenceSummary; var occurrenceSummary = new EventOccurrenceSummaryModel() { Id = occurrence.Id, EventTitle = occurrence.EventTitle, EventImageUrl = occurrence.EventImagePath, EventSpecialInstructions = occurrence.EventSpecialInstructions, AvailableSeats = occurrence.AvailableSeats, Description = occurrence.EventSummaryDescription, OccurrenceSpecialInstructions = occurrence.SpecialInstructions, IsGuestDemographicInfoRequired = occurrence.IsGuestDemographicInfoRequired, LocationName = occurrence.EffectiveLocationName, StartDate = occurrence.StartDate.HasValue ? occurrence.StartDate.Value.ToString("M/d/yy h:mm tt") : "Open", LeadManagementBusinessUnitId = occurrence.BrightWhistleBusinessUnitId }; return CommonUtils.JsonSerialize(occurrenceSummary); }