Example #1
0
        private void BindDaySaleTotalStatistics()
        {
            DataTable table = SubsiteSalesHelper.GetDaySaleTotal(dayYear, dayMonth, dayType);

            if (radioDayForSaleType.SelectedValue == SaleStatisticsType.SaleCounts)
            {
                grdDaySaleTotalStatistics.Columns[1].Visible    = true;
                grdDaySaleTotalStatistics.Columns[1].HeaderText = radioDayForSaleType.SelectedItem.Text;
                grdDaySaleTotalStatistics.Columns[2].Visible    = false;
            }
            else
            {
                grdDaySaleTotalStatistics.Columns[1].Visible    = false;
                grdDaySaleTotalStatistics.Columns[2].Visible    = true;
                grdDaySaleTotalStatistics.Columns[2].HeaderText = radioDayForSaleType.SelectedItem.Text;
            }
            grdDaySaleTotalStatistics.DataSource = table;
            grdDaySaleTotalStatistics.DataBind();
            TableOfDay          = table;
            lblDayAllTotal.Text = string.Format("总{0}:", radioDayForSaleType.SelectedItem.Text);
            decimal money = SubsiteSalesHelper.GetMonthSaleTotal(dayYear, dayMonth, dayType);

            if (radioDayForSaleType.SelectedValue == SaleStatisticsType.SaleCounts)
            {
                litDayAllTotal.Text = money.ToString();
            }
            else
            {
                litDayAllTotal.Text = Globals.FormatMoney(money);
            }
            lblDayMaxTotal.Text = string.Format("最高峰{0}:", radioDayForSaleType.SelectedItem.Text);
            decimal num2 = 0M;

            foreach (DataRow row in table.Rows)
            {
                if (((decimal)row["SaleTotal"]) > num2)
                {
                    num2 = (decimal)row["SaleTotal"];
                }
            }
            if (radioDayForSaleType.SelectedValue == SaleStatisticsType.SaleCounts)
            {
                litDayMaxTotal.Text = num2.ToString();
            }
            else
            {
                litDayMaxTotal.Text = Globals.FormatMoney(num2);
            }
        }
Example #2
0
        private void BindDaySaleTotalStatistics()
        {
            System.Data.DataTable daySaleTotal = SubsiteSalesHelper.GetDaySaleTotal(this.dayYear, this.dayMonth, this.dayType);
            if (this.radioDayForSaleType.SelectedValue == SaleStatisticsType.SaleCounts)
            {
                this.grdDaySaleTotalStatistics.Columns[1].Visible    = true;
                this.grdDaySaleTotalStatistics.Columns[1].HeaderText = this.radioDayForSaleType.SelectedItem.Text;
                this.grdDaySaleTotalStatistics.Columns[2].Visible    = false;
            }
            else
            {
                this.grdDaySaleTotalStatistics.Columns[1].Visible    = false;
                this.grdDaySaleTotalStatistics.Columns[2].Visible    = true;
                this.grdDaySaleTotalStatistics.Columns[2].HeaderText = this.radioDayForSaleType.SelectedItem.Text;
            }
            this.grdDaySaleTotalStatistics.DataSource = daySaleTotal;
            this.grdDaySaleTotalStatistics.DataBind();
            this.TableOfDay          = daySaleTotal;
            this.lblDayAllTotal.Text = string.Format("总{0}:", this.radioDayForSaleType.SelectedItem.Text);
            decimal monthSaleTotal = SubsiteSalesHelper.GetMonthSaleTotal(this.dayYear, this.dayMonth, this.dayType);

            if (this.radioDayForSaleType.SelectedValue == SaleStatisticsType.SaleCounts)
            {
                this.litDayAllTotal.Text = monthSaleTotal.ToString();
            }
            else
            {
                this.litDayAllTotal.Text = Globals.FormatMoney(monthSaleTotal);
            }
            this.lblDayMaxTotal.Text = string.Format("最高峰{0}:", this.radioDayForSaleType.SelectedItem.Text);
            decimal num = 0m;

            foreach (System.Data.DataRow dataRow in daySaleTotal.Rows)
            {
                if ((decimal)dataRow["SaleTotal"] > num)
                {
                    num = (decimal)dataRow["SaleTotal"];
                }
            }
            if (this.radioDayForSaleType.SelectedValue == SaleStatisticsType.SaleCounts)
            {
                this.litDayMaxTotal.Text = num.ToString();
                return;
            }
            this.litDayMaxTotal.Text = Globals.FormatMoney(num);
        }