Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        private void BindData()
        {
            OrderStatisticsQuery entity = new OrderStatisticsQuery {
                BeginDate = this.BeginDate,
                EndDate   = this.EndDate,
                Top       = new int?(this.Top),
                PageIndex = this.pager.PageIndex,
                PageSize  = this.pager.PageSize,
                SortOrder = SortAction.Desc,
                SortBy    = "SaleAmountFee",
                wid       = this.wid
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult orderStatisticReport = ShopStatisticHelper.GetOrderStatisticReport(entity);
            DateTime      beginDate            = DateTime.Today.AddDays(-7.0);

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

            if (this.txtEndDate.TextToDate.HasValue)
            {
                now = this.txtEndDate.TextToDate.Value;
            }
            DataRow drOne = ShopStatisticHelper.GetOrder_Member_CountInfo(beginDate, now, this.wid);

            this.OrderNumber     = base.GetFieldIntValue(drOne, "OrderNumber");
            this.SaleAmountFee   = base.GetFieldDecimalValue(drOne, "SaleAmountFee").ToString("N2");
            this.FXOrderNumber   = base.GetFieldIntValue(drOne, "FXOrderNumber");
            this.FXSaleAmountFee = base.GetFieldDecimalValue(drOne, "FXSaleAmountFee").ToString("N2");
            this.FXResultPercent = "0";
            if (base.GetFieldDecimalValue(drOne, "SaleAmountFee") > 0M)
            {
                this.FXResultPercent = Math.Round((decimal)((base.GetFieldDecimalValue(drOne, "FXSaleAmountFee") / base.GetFieldDecimalValue(drOne, "SaleAmountFee")) * 100M), 2).ToString("N2");
            }
            this.FXCommissionFee    = base.GetFieldDecimalValue(drOne, "FXCommissionFee").ToString("N2");
            this.rptList.DataSource = orderStatisticReport.Data;
            this.rptList.DataBind();
            this.pager.TotalRecords = orderStatisticReport.TotalRecords;
        }
Exemplo n.º 4
0
        private void BindData()
        {
            OrderStatisticsQuery orderStatisticsQuery = new OrderStatisticsQuery();

            orderStatisticsQuery.BeginDate = this.BeginDate;
            orderStatisticsQuery.EndDate   = this.EndDate;
            orderStatisticsQuery.Top       = new int?(this.Top);
            orderStatisticsQuery.PageIndex = this.pager.PageIndex;
            orderStatisticsQuery.PageSize  = this.pager.PageSize;
            orderStatisticsQuery.SortOrder = SortAction.Desc;
            orderStatisticsQuery.SortBy    = "SaleAmountFee";
            Globals.EntityCoding(orderStatisticsQuery, true);
            DbQueryResult orderStatisticReport = ShopStatisticHelper.GetOrderStatisticReport(orderStatisticsQuery);

            System.DateTime beginDate = System.DateTime.Today.AddDays(-6.0);
            if (this.txtBeginDate.TextToDate.HasValue)
            {
                beginDate = this.txtBeginDate.TextToDate.Value;
            }
            System.DateTime endDate = System.DateTime.Now;
            if (this.txtEndDate.TextToDate.HasValue)
            {
                endDate = this.txtEndDate.TextToDate.Value;
            }
            System.Data.DataRow order_Member_CountInfo = ShopStatisticHelper.GetOrder_Member_CountInfo(beginDate, endDate);
            this.OrderNumber     = base.GetFieldIntValue(order_Member_CountInfo, "OrderNumber");
            this.SaleAmountFee   = base.GetFieldDecimalValue(order_Member_CountInfo, "SaleAmountFee").ToString("N2");
            this.FXOrderNumber   = base.GetFieldIntValue(order_Member_CountInfo, "FXOrderNumber");
            this.FXSaleAmountFee = base.GetFieldDecimalValue(order_Member_CountInfo, "FXSaleAmountFee").ToString("N2");
            this.FXResultPercent = "0";
            if (base.GetFieldDecimalValue(order_Member_CountInfo, "SaleAmountFee") > 0m)
            {
                this.FXResultPercent = System.Math.Round(base.GetFieldDecimalValue(order_Member_CountInfo, "FXSaleAmountFee") / base.GetFieldDecimalValue(order_Member_CountInfo, "SaleAmountFee") * 100m, 2).ToString("N2");
            }
            this.FXCommissionFee    = base.GetFieldDecimalValue(order_Member_CountInfo, "FXCommissionFee").ToString("N2");
            this.rptList.DataSource = orderStatisticReport.Data;
            this.rptList.DataBind();
            this.pager.TotalRecords = orderStatisticReport.TotalRecords;
        }