コード例 #1
0
ファイル: SaleReport.cs プロジェクト: 123456-cq/xkq34_src
        private void BindData()
        {
            DateTime beginDate = DateTime.Today.AddDays(-6.0);

            if (this.txtBeginDate.TextToDate.HasValue)
            {
                beginDate = DateTime.Parse(this.txtBeginDate.TextToDate.Value.ToString());
            }
            DateTime now = DateTime.Now;

            if (this.txtEndDate.TextToDate.HasValue)
            {
                now = DateTime.Parse(this.txtEndDate.TextToDate.Value.ToString());
            }
            DataRow   drOne      = ShopStatisticHelper.GetOrder_Member_CountInfo(beginDate, now);
            DataTable saleReport = ShopStatisticHelper.GetSaleReport(beginDate, now);
            TimeSpan  span       = (TimeSpan)(now - beginDate);
            int       days       = span.Days;

            this.OrderNumber   = base.GetFieldDecimalValue(drOne, "OrderNumber");
            this.BuyerNumber   = base.GetFieldDecimalValue(drOne, "BuyerNumber");
            this.SaleAmountFee = base.GetFieldDecimalValue(drOne, "SaleAmountFee");
            this.BuyerAvgPrice = 0M;
            if (this.BuyerNumber > 0M)
            {
                this.BuyerAvgPrice = Math.Round((decimal)(this.SaleAmountFee / this.BuyerNumber), 2);
            }
            this.NewMemberNumber = base.GetFieldIntValue(drOne, "NewMemberNumber");
            this.NewAgentNumber  = base.GetFieldIntValue(drOne, "NewAgentNumber");
            this.DateListA       = "";
            this.DateListB       = "";
            int num2 = 0;

            days = saleReport.Rows.Count;
            foreach (DataRow row2 in saleReport.Rows)
            {
                this.DateListA = this.DateListA + "'" + Convert.ToDateTime(row2["RecDate"].ToString()).ToString("yyyy-MM-dd") + "'";
                this.QtyListA1 = this.QtyListA1 + base.GetFieldIntValue(row2, "OrderNumber").ToString();
                this.QtyListA2 = this.QtyListA2 + base.GetFieldDecimalValue(row2, "SaleAmountFee").ToString();
                this.QtyListB1 = this.QtyListB1 + base.GetFieldIntValue(row2, "NewMemberNumber").ToString();
                this.QtyListB2 = this.QtyListB2 + base.GetFieldIntValue(row2, "NewAgentNumber").ToString();
                if (num2 < (days - 1))
                {
                    this.DateListA = this.DateListA + ",";
                    this.QtyListA1 = this.QtyListA1 + ",";
                    this.QtyListA2 = this.QtyListA2 + ",";
                    this.DateListB = this.DateListB + ",";
                    this.QtyListB1 = this.QtyListB1 + ",";
                    this.QtyListB2 = this.QtyListB2 + ",";
                }
                num2++;
            }
            this.DateListB = this.DateListA;
        }
コード例 #2
0
ファイル: SaleReport.cs プロジェクト: llenroc/kangaroo
        private void BindData()
        {
            System.DateTime dateTime = System.DateTime.Today.AddDays(-6.0);
            if (this.txtBeginDate.TextToDate.HasValue)
            {
                dateTime = System.DateTime.Parse(this.txtBeginDate.TextToDate.Value.ToString());
            }
            System.DateTime dateTime2 = System.DateTime.Now;
            if (this.txtEndDate.TextToDate.HasValue)
            {
                dateTime2 = System.DateTime.Parse(this.txtEndDate.TextToDate.Value.ToString());
            }
            System.Data.DataRow   order_Member_CountInfo = ShopStatisticHelper.GetOrder_Member_CountInfo(dateTime, dateTime2);
            System.Data.DataTable saleReport             = ShopStatisticHelper.GetSaleReport(dateTime, dateTime2);
            int num = (dateTime2 - dateTime).Days;

            this.OrderNumber   = base.GetFieldDecimalValue(order_Member_CountInfo, "OrderNumber");
            this.BuyerNumber   = base.GetFieldDecimalValue(order_Member_CountInfo, "BuyerNumber");
            this.SaleAmountFee = base.GetFieldDecimalValue(order_Member_CountInfo, "SaleAmountFee");
            this.BuyerAvgPrice = 0m;
            if (this.BuyerNumber > 0m)
            {
                this.BuyerAvgPrice = System.Math.Round(this.SaleAmountFee / this.BuyerNumber, 2);
            }
            this.NewMemberNumber = base.GetFieldIntValue(order_Member_CountInfo, "NewMemberNumber");
            this.NewAgentNumber  = base.GetFieldIntValue(order_Member_CountInfo, "NewAgentNumber");
            this.DateListA       = "";
            this.DateListB       = "";
            int num2 = 0;

            num = saleReport.Rows.Count;
            foreach (System.Data.DataRow dataRow in saleReport.Rows)
            {
                this.DateListA  = this.DateListA + "'" + System.Convert.ToDateTime(dataRow["RecDate"].ToString()).ToString("yyyy-MM-dd") + "'";
                this.QtyListA1 += base.GetFieldIntValue(dataRow, "OrderNumber").ToString();
                this.QtyListA2 += base.GetFieldDecimalValue(dataRow, "SaleAmountFee").ToString();
                this.QtyListB1 += base.GetFieldIntValue(dataRow, "NewMemberNumber").ToString();
                this.QtyListB2 += base.GetFieldIntValue(dataRow, "NewAgentNumber").ToString();
                if (num2 < num - 1)
                {
                    this.DateListA += ",";
                    this.QtyListA1 += ",";
                    this.QtyListA2 += ",";
                    this.DateListB += ",";
                    this.QtyListB1 += ",";
                    this.QtyListB2 += ",";
                }
                num2++;
            }
            this.DateListB = this.DateListA;
        }