コード例 #1
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();
            }
        }
コード例 #2
0
        void btnRebuildReports_Click(object sender, EventArgs e)
        {
            //Module m = new Module(moduleId);
            //if (m.SiteGuid != siteSettings.SiteGuid) { return; }
            //CommerceReport.DeleteByModule(m.ModuleGuid);
            //Order.EnsureSalesReportData(m.ModuleGuid, pageId, m.ModuleId);
            //SiteUser.UpdateTotalRevenue();
            if (store != null)
            {
                CommerceReport.DeleteByModule(store.ModuleGuid);
                Order.EnsureSalesReportData(store.ModuleGuid, pageId, moduleId);
                SiteUser.UpdateTotalRevenue();
            }

            WebUtils.SetupRedirect(this, Request.RawUrl);
        }