예제 #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Stream            = null;
            OutputContentType = "image/png";
            ETag = string.Empty;

            SalesSummary summary = new SalesSummary(MTApp.CurrentStore.Id);

            GenerateChart(summary.GetWeeklySummary(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, MTApp.CurrentStore.Settings.TimeZone), MTApp.OrderServices),
                          "Sales This Week", 600, 200);
            RenderChart();
        }
예제 #2
0
        private void LoadSummary()
        {
            SalesSummary  manager = new SalesSummary(MyPage.MTApp.CurrentStore.Id);
            WeeklySummary summary = manager.GetWeeklySummary(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, MyPage.MTApp.CurrentStore.Settings.TimeZone), MyPage.MTApp.OrderServices);

            if (summary == null)
            {
                return;
            }

            this.litM.Text    = summary.Monday.ToString("c");
            this.litT.Text    = summary.Tuesday.ToString("c");
            this.litW.Text    = summary.Wednesday.ToString("c");
            this.litR.Text    = summary.Thursday.ToString("c");
            this.litF.Text    = summary.Friday.ToString("c");
            this.litS.Text    = summary.Saturday.ToString("c");
            this.litY.Text    = summary.Sunday.ToString("c");
            this.litWeek.Text = summary.Week.ToString("c");

            this.litML.Text    = summary.MondayLast.ToString("c");
            this.litTL.Text    = summary.TuesdayLast.ToString("c");
            this.litWL.Text    = summary.WednesdayLast.ToString("c");
            this.litRL.Text    = summary.ThursdayLast.ToString("c");
            this.litFL.Text    = summary.FridayLast.ToString("c");
            this.litSL.Text    = summary.SaturdayLast.ToString("c");
            this.litYL.Text    = summary.SundayLast.ToString("c");
            this.litWeekL.Text = summary.WeekLast.ToString("c");

            this.litMC.Text    = FormatPercent(summary.MondayChange);
            this.litTC.Text    = FormatPercent(summary.TuesdayChange);
            this.litWC.Text    = FormatPercent(summary.WednesdayChange);
            this.litRC.Text    = FormatPercent(summary.ThursdayChange);
            this.litFC.Text    = FormatPercent(summary.FridayChange);
            this.litSC.Text    = FormatPercent(summary.SaturdayChange);
            this.litYC.Text    = FormatPercent(summary.SundayChange);
            this.litWeekC.Text = FormatPercent(summary.WeekChange);
        }