private async Task MailTemplatesList_ListSearch(ComponentListSearchEventArgs e) { // Don't need this in the export if (!wim.IsExportMode_XLS) { wim.ListDataColumns.Add(new ListDataColumn("Name", nameof(Data.MailTemplateList._IsSelected), ListDataColumnType.HighlightPresent) { Alignment = Align.Left, Type = ListDataColumnType.Checkbox, ColumnWidth = 45, EditConfiguration = new ListDataEditConfiguration() { Type = ListDataEditConfigurationType.Checkbox, PropertyToSet = "_IsSelected", } }); } wim.ListDataColumns.Add(new ListDataColumn("ID", nameof(Data.MailTemplate.ID), ListDataColumnType.UniqueIdentifier)); wim.ListDataColumns.Add(new ListDataColumn("Name", nameof(Data.MailTemplate.Name))); wim.ListDataColumns.Add(new ListDataColumn("Identifier", nameof(Data.MailTemplate.Identifier))); wim.ListDataColumns.Add(new ListDataColumn("Has published version", nameof(Data.MailTemplate.HasPublishedVersion))); wim.ListDataColumns.Add(new ListDataColumn("Is current published", nameof(Data.MailTemplate.IsPublished))); var items = await _mailTemplateListRepository.FetchAllAsync(FilterText); wim.ListDataAdd(items); }
private async Task DefaultValues_List_ListSearch(ComponentListSearchEventArgs e) { if (!wim.IsSearchListMode) { var idQueryString = Request.Query["item"].ToString(); int.TryParse(idQueryString, out int id); var mailTemplate = await _mailTemplateRepository.FetchSingleAsync(id); var list = await _defaultValuePlaceholderRepository.FetchAllByMailTemplateAsync(mailTemplate.Identifier); var subjectPlaceholders = Logic.PlaceholderLogic.GetPlaceholderTags(mailTemplate.Subject); var bodyPlaceholders = Logic.PlaceholderLogic.GetPlaceholderTags(mailTemplate.Body); var tmpID = -1; list.AddRange(subjectPlaceholders.Where(x => list.All(defaultValue => defaultValue.Placeholder != x)).Select(x => new Data.DefaultValuePlaceholder { Placeholder = x, ID = tmpID-- })); list.AddRange(bodyPlaceholders.Where(x => list.All(defaultValue => defaultValue.Placeholder != x)).Select(x => new Data.DefaultValuePlaceholder { Placeholder = x, ID = tmpID-- })); wim.SearchResultItemPassthroughParameterProperty = nameof(Data.DefaultValuePlaceholder.ID); wim.ListDataColumns.Add(new ListDataColumn("ID", nameof(Data.DefaultValuePlaceholder.ID), ListDataColumnType.UniqueHighlightedIdentifier)); wim.ListDataColumns.Add(new ListDataColumn("Placeholder", nameof(Data.DefaultValuePlaceholder.Placeholder))); wim.ListDataColumns.Add(new ListDataColumn("Value", nameof(Data.DefaultValuePlaceholder.Value)) { Alignment = Align.Left, Type = ListDataColumnType.Default, EditConfiguration = new ListDataEditConfiguration() { Type = ListDataEditConfigurationType.TextField, PropertyToSet = nameof(Data.DefaultValuePlaceholder.Value), Width = 580 }, }); wim.SearchListCanClickThrough = false; wim.ListDataAdd(list); } }