Ejemplo n.º 1
0
        public DataResponse GetResponse()
        {
            DataResponse response = new DataResponse {
                Days      = Days,
                LineChart = LineChartBlock.GetBlock(this)
            };

            switch (Type)
            {
            case DataQueryType.Page:
                response.AddBlock(VisitsBlock.GetBlock(this));
                response.AddBlock(DevicesBlock.GetBlock(this));
                response.Page = new {
                    id  = PageId,
                    url = PageUrl
                };
                break;

            case DataQueryType.Site:
                response.AddBlock(VisitsBlock.GetBlock(this));
                response.AddBlock(PopularBlock.GetBlock(this, max: 5));
                response.AddBlock(DevicesBlock.GetBlock(this));
                break;
            }

            return(response);
        }