Example #1
0
        public override void Process(ReportProcessorArgs args)
        {
            IElementDictionary <IElementCustomerLookup> entries = GetElementDictionary(args);

            IList <KeyValuePair <string, IElementCustomerLookup> > companyInfoList =
                new List <KeyValuePair <string, IElementCustomerLookup> >();

            companyInfoList = (from key in entries.Keys
                               select
                               new KeyValuePair <string, IElementCustomerLookup>(key,
                                                                                 new ReadonlyElementCustomerLookup(entries[key]))
                               into kvp
                               orderby kvp.Key
                               select kvp).ToList();


            var resultTable = CompanyInfoHelper.CreateCompanyDataTable("CompanyInfo");

            foreach (var companies in companyInfoList)
            {
                DataRow dataRow = resultTable.NewRow();
                resultTable.Rows.Add(CompanyInfoHelper.FillCompanyDataTable(dataRow, companies.Value));
            }

            args.QueryResult = resultTable;
        }
Example #2
0
 public static TElement GetSafely <TElement>(this IElementDictionary <TElement> dict, string key)
     where TElement : class, Sitecore.Analytics.Model.Framework.IElement
 {
     return(dict.Contains(key) ? dict[key] : null);
 }