Exemplo n.º 1
0
        public StoreLiquidResult GetActivityIndexPage(PageDesign pageDesign, List <Activity> activities)
        {
            var result = new StoreLiquidResult();

            result.PageDesingName = pageDesign.Name;
            var dic = new Dictionary <String, String>();

            result.LiquidRenderedResult = dic;
            dic.Add(StoreConstants.PageOutput, "");

            try
            {
                var items = new List <ActivitiesLiquid>();
                foreach (var item in activities)
                {
                    var i = new ActivitiesLiquid(item, ImageWidth, ImageHeight);
                    items.Add(i);
                }


                object anonymousObject = new
                {
                    activities = LiquidAnonymousObject.GetActivitiesEnumerable(items)
                };


                var indexPageOutput = LiquidEngineHelper.RenderPage(pageDesign, anonymousObject);


                dic[StoreConstants.PageOutput] = indexPageOutput;
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
            return(result);
        }