예제 #1
0
        private void PopulateControls()
        {
            if (module == null)
            {
                return;
            }
            Title = SiteUtils.FormatPageTitle(siteSettings, module.ModuleTitle + " - " + Resource.SalesOverviewReportHeading);

            if (moduleGuid == Guid.Empty)
            {
                return;
            }
            if (salesByMonthData == null)
            {
                salesByMonthData = CommerceReport.GetSalesByYearMonthByModule(moduleGuid);
            }
            if (salesByMonthData == null)
            {
                return;
            }



            heading.Text            = Server.HtmlEncode(module.ModuleTitle);
            lnkThisPage.Text        = module.ModuleTitle;
            lnkAllItems.NavigateUrl = SiteRoot + "/Admin/SalesItemReport.aspx?m=" + moduleGuid.ToString();

            try
            {
                if (salesByYearData == null)
                {
                    salesByYearData = CommerceReport.GetSalesByYearByModule(moduleGuid);
                }
                grdSalesByYear.DataSource = salesByYearData;
                grdSalesByYear.DataBind();
            }
            catch
            {
                //this will throw an error until the upgrade script for 2.3.4.6 is enabled
                grdSalesByYear.Visible = false;
            }

            grdSales.DataSource = salesByMonthData;
            grdSales.DataBind();

            DataTable dt = CommerceReport.GetItemRevenueByModule(moduleGuid);

            grdTopItems.DataSource = dt;
            grdTopItems.DataBind();

            decimal allTimeRevenue = CommerceReport.GetAllTimeRevenueByModule(moduleGuid);

            litAllTimeRevenue.Text = string.Format(currencyCulture,
                                                   Resource.AllTimeRevenueFormatString, allTimeRevenue.ToString("c", currencyCulture));

            if (WebConfigSettings.DisableZedGraph)
            {
                BindBarChart();
            }
        }
예제 #2
0
        private void EnsureReportData()
        {
            if (store == null)
            {
                return;
            }
            if (pageId == -1)
            {
                return;
            }
            if (moduleId == -1)
            {
                return;
            }
            if (Page.IsPostBack)
            {
                return;
            }

            decimal storeRevenue  = Order.GetAllTimeRevenueTotal(store.Guid);
            decimal reportRevenue = CommerceReport.GetAllTimeRevenueByModule(store.ModuleGuid);

            if ((storeRevenue > 0) && (reportRevenue == 0))
            {
                CommerceReport.DeleteByModule(store.ModuleGuid);
                Order.EnsureSalesReportData(store.ModuleGuid, pageId, moduleId);
                SiteUser.UpdateTotalRevenue();
            }
        }
        private void PopulateControls()
        {
            if (module == null)
            {
                return;
            }
            if (moduleGuid == Guid.Empty)
            {
                return;
            }
            if (salesByMonthData == null)
            {
                salesByMonthData = CommerceReport.GetSalesByYearMonthByModule(moduleGuid);
            }
            if (salesByMonthData == null)
            {
                return;
            }

            Title = SiteUtils.FormatPageTitle(siteSettings, module.ModuleTitle + " - " + Resource.SalesOverviewReportHeading);

            litHeading.Text         = Server.HtmlEncode(module.ModuleTitle);
            lnkThisPage.Text        = module.ModuleTitle;
            lnkAllItems.NavigateUrl = SiteRoot + "/Admin/SalesItemReport.aspx?m=" + moduleGuid.ToString();

            grdSales.DataSource = salesByMonthData;
            grdSales.DataBind();

            DataTable dt = CommerceReport.GetItemRevenueByModule(moduleGuid);

            grdTopItems.DataSource = dt;
            grdTopItems.DataBind();

            decimal allTimeRevenue = CommerceReport.GetAllTimeRevenueByModule(moduleGuid);

            litAllTimeRevenue.Text = string.Format(currencyCulture,
                                                   Resource.AllTimeRevenueFormatString, allTimeRevenue.ToString("c", currencyCulture));
        }