Exemple #1
0
        private DataTable GetDataTable()
        {
            int top         = TopRecordsDropDownList1.SelectedId;
            int assetTypeId = AssetTypeDropDownList1.SelectedId;
            int brandId     = BrandDropDownList.SelectedId;

            TimeFrame timeframe = EnumUtils.GetEnumFromValue <TimeFrame>(TimeFrameDropDownList1.SelectedId);
            DateRange dateRange = SiteUtils.GetDateRangeFromTimeFrame(timeframe);

            DataTable dt = AssetReportMapper.Instance.GetPopularAssetList(top, assetTypeId, brandId, dateRange);

            dt.DefaultView.Sort = AssetRepeater.GetSortExpressions()[0].ToString();

            return(dt);
        }
        private void PopulateActivitySummary()
        {
            //------------------------------------
            // Also populate the activity summary
            //------------------------------------
            TimeFrame timeframe = EnumUtils.GetEnumFromValue <TimeFrame>(TimeFrameDropDownList1.SelectedId);
            DateRange dateRange = SiteUtils.GetDateRangeFromTimeFrame(timeframe);
            DataRow   row       = AssetReportMapper.Instance.GetAssetReportSummary(BrandDropDownList.SelectedId, dateRange);

            //------------------------------------
            // Get data from row
            //------------------------------------
            int uploads            = Convert.ToInt32(row["Uploads"]);
            int totalUploads       = Convert.ToInt32(row["TotalUploads"]);
            int downloads          = Convert.ToInt32(row["Downloads"]);
            int totalDownloads     = Convert.ToInt32(row["TotalDownloads"]);
            int orderRequests      = Convert.ToInt32(row["OrderRequests"]);
            int totalOrderRequests = Convert.ToInt32(row["TotalOrderRequests"]);
            int views                = Convert.ToInt32(row["Views"]);
            int totalViews           = Convert.ToInt32(row["TotalViews"]);
            int searchHits           = Convert.ToInt32(row["SearchHits"]);
            int totalSearchHits      = Convert.ToInt32(row["TotalSearchHits"]);
            int addedToCart          = Convert.ToInt32(row["AddedToCart"]);
            int totalAddedToCart     = Convert.ToInt32(row["TotalAddedToCart"]);
            int addedToLightbox      = Convert.ToInt32(row["AddedToLightbox"]);
            int totalAddedToLightbox = Convert.ToInt32(row["TotalAddedToLightbox"]);

            //------------------------------------
            // Update the UI
            //------------------------------------
            SiteUtils.PopulateCell(UploadsCell, uploads, totalUploads);
            SiteUtils.PopulateCell(DownloadsCell, downloads, totalDownloads);
            SiteUtils.PopulateCell(OrderRequestsCell, orderRequests, totalOrderRequests);
            SiteUtils.PopulateCell(ViewsCell, views, totalViews);
            SiteUtils.PopulateCell(SearchHitsCell, searchHits, totalSearchHits);
            SiteUtils.PopulateCell(AddToCartCell, addedToCart, totalAddedToCart);
            SiteUtils.PopulateCell(AddToLightboxCell, addedToLightbox, totalAddedToLightbox);

            //------------------------------------
            // Update the chart headers
            //------------------------------------
            ChartBrandHeaderLabel.Text = (BrandDropDownList.SelectedId > 0) ? BrandDropDownList.SelectedItem.Text : "All Brands";
        }
        protected override AssetFinder GetFinderFromForm()
        {
            AuditAssetHistoryFinder finder = new AuditAssetHistoryFinder();

            if (UploadedCheckBox.Checked)
            {
                finder.IncludeActionsList.Add(AuditAssetAction.UploadedAsset);
            }

            if (DownloadedCheckBox.Checked)
            {
                finder.IncludeActionsList.Add(AuditAssetAction.DownloadedAssetFile);
            }

            if (OrderRequestsCheckBox.Checked)
            {
                finder.IncludeActionsList.Add(AuditAssetAction.Ordered);
            }

            if (ViewsCheckBox.Checked)
            {
                finder.IncludeActionsList.Add(AuditAssetAction.ViewedAssetDetail);
            }

            if (SearcHitsCheckBox.Checked)
            {
                finder.IncludeActionsList.Add(AuditAssetAction.ReturnedInSearch);
            }

            if (CartCheckBox.Checked)
            {
                finder.IncludeActionsList.Add(AuditAssetAction.AddedToCart);
            }

            if (LightboxCheckBox.Checked)
            {
                finder.IncludeActionsList.Add(AuditAssetAction.AddedToLightbox);
            }

            finder.BrandId = BrandDropDownList.SelectedId;

            TimeFrame timeframe = EnumUtils.GetEnumFromValue <TimeFrame>(TimeFrameDropDownList1.SelectedId);
            DateRange dateRange = SiteUtils.GetDateRangeFromTimeFrame(timeframe);

            finder.StartDate = dateRange.StartDate;
            finder.EndDate   = dateRange.EndDate;

            // Initialise the asset finder
            AssetFinder assetFinder = new AssetFinder();

            assetFinder.SortExpressions.AddRange(AssetRepeater.GetSortExpressions());

            // Give the asset finder, so it only finds assets in the
            // asset audit history matching the specified criteria
            // Caution: If the AuditAssetHistoryFinder is using any values
            // causing the constructed SQL query to use the parameter list
            // (eg. by setting @properties), this will fail.
            assetFinder.AuditAssetHistoryFinder = finder;

            return(assetFinder);
        }
Exemple #4
0
        private void DisplayActivitySummary(Asset asset)
        {
            DateRange timeFrame = SiteUtils.GetDateRangeFromTimeFrame(EnumUtils.GetEnumFromValue <TimeFrame>(TimeFrameDropDownList1.SelectedId));
            DataRow   row       = AssetReportMapper.Instance.GetAssetStats(asset.AssetId.GetValueOrDefault(), timeFrame);

            int assetDownloads       = Convert.ToInt32(row["AssetDownloads"]);
            int totalDownloads       = Convert.ToInt32(row["TotalDownloads"]);
            int assetOrderRequests   = Convert.ToInt32(row["AssetOrderRequests"]);
            int totalOrderRequests   = Convert.ToInt32(row["TotalOrderRequests"]);
            int assetViews           = Convert.ToInt32(row["AssetViews"]);
            int totalViews           = Convert.ToInt32(row["TotalViews"]);
            int assetSearchHits      = Convert.ToInt32(row["AssetSearchHits"]);
            int totalSearchHits      = Convert.ToInt32(row["TotalSearchHits"]);
            int assetAddedToCart     = Convert.ToInt32(row["AssetAddedToCart"]);
            int totalAddedToCart     = Convert.ToInt32(row["TotalAddedToCart"]);
            int assetAddedToLightbox = Convert.ToInt32(row["AssetAddedToLightbox"]);
            int totalAddedToLightbox = Convert.ToInt32(row["TotalAddedToLightbox"]);

            SiteUtils.PopulateCell(DownloadsCell, assetDownloads, totalDownloads);
            SiteUtils.PopulateCell(OrderRequestsCell, assetOrderRequests, totalOrderRequests);
            SiteUtils.PopulateCell(ViewsCell, assetViews, totalViews);
            SiteUtils.PopulateCell(SearchHitsCell, assetSearchHits, totalSearchHits);
            SiteUtils.PopulateCell(AddToCartCell, assetAddedToCart, totalAddedToCart);
            SiteUtils.PopulateCell(AddToLightboxCell, assetAddedToLightbox, totalAddedToLightbox);

            // Register the FusionCharts javascript
            if (!Page.ClientScript.IsClientScriptIncludeRegistered("FusionCharts"))
            {
                Page.ClientScript.RegisterClientScriptInclude("FusionCharts", ResolveUrl("~/FusionCharts/FusionCharts.js"));
            }

            // Setup the XML for the chart
            XElement xml = new XElement("graph",
                                        new XAttribute("xaxisname", string.Empty),
                                        new XAttribute("yaxisname", "Count"),
                                        new XAttribute("hovercapbg", "dedebe"),
                                        new XAttribute("hovercapborder", "413189"),
                                        new XAttribute("rotateNames", 0),
                                        new XAttribute("numdivlines", 9),
                                        new XAttribute("canvasBaseDepth", 2),
                                        new XAttribute("canvasBgDepth", 2),
                                        new XAttribute("divLineColor", "cccccc"),
                                        new XAttribute("divLineAlpha", 80),
                                        new XAttribute("divLineThickness", 1),
                                        new XAttribute("decimalPrecision", 0),
                                        new XAttribute("showAlternateHGridColor", 1),
                                        new XAttribute("AlternateHGridAlpha", 30),
                                        new XAttribute("AlternateHGridColor", "cccccc"),
                                        new XAttribute("zeroPlaneShowBorder", 1),
                                        new XElement("categories",
                                                     new XAttribute("font", "Arial"),
                                                     new XAttribute("fontSize", 11),
                                                     new XAttribute("fontColor", "000000"),
                                                     new XElement("category", new XAttribute("name", "Downloads")),
                                                     new XElement("category", new XAttribute("name", "   Order&#10;Requests"), new XAttribute("hoverText", "Order Requests")),
                                                     new XElement("category", new XAttribute("name", "Views")),
                                                     new XElement("category", new XAttribute("name", "Search&#10;  Hits"), new XAttribute("hoverText", "Search Hits")),
                                                     new XElement("category", new XAttribute("name", "Added&#10;   To&#10; Cart"), new XAttribute("hoverText", "Added To Cart")),
                                                     new XElement("category", new XAttribute("name", " Added&#10;   To&#10;Lightbox"), new XAttribute("hoverText", "Added To Lightbox"))
                                                     ),
                                        new XElement("dataset",
                                                     new XAttribute("seriesname", "This Asset"),
                                                     new XAttribute("color", "413189"),
                                                     new XElement("set", new XAttribute("value", assetDownloads)),
                                                     new XElement("set", new XAttribute("value", assetOrderRequests)),
                                                     new XElement("set", new XAttribute("value", assetViews)),
                                                     new XElement("set", new XAttribute("value", assetSearchHits)),
                                                     new XElement("set", new XAttribute("value", assetAddedToCart)),
                                                     new XElement("set", new XAttribute("value", assetAddedToLightbox))
                                                     ),
                                        new XElement("dataset",
                                                     new XAttribute("seriesname", "All Assets"),
                                                     new XAttribute("color", "bcbbcb"),
                                                     new XElement("set", new XAttribute("value", totalDownloads)),
                                                     new XElement("set", new XAttribute("value", totalOrderRequests)),
                                                     new XElement("set", new XAttribute("value", totalViews)),
                                                     new XElement("set", new XAttribute("value", totalSearchHits)),
                                                     new XElement("set", new XAttribute("value", totalAddedToCart)),
                                                     new XElement("set", new XAttribute("value", totalAddedToLightbox))
                                                     )
                                        );

            // Setup the chart
            ChartLiteral.Text = FusionCharts.RenderChart(ResolveUrl("~/FusionCharts/FCF_MSColumn3D.swf"), string.Empty, xml.ToUnformattedXmlForFusionCharts(), "AssetInfoChart_" + ChartLiteral.ClientID, "550", "350", false, false);
        }