private void Bind()
        {
            DateTime?beginDate = null;
            DateTime?endDate   = null;
            DateTime b;
            DateTime e;

            if (!DateTime.TryParse(this.txtBeginDate.Text.Trim(), out b) || !DateTime.TryParse(this.txtEndDate.Text.Trim(), out e))
            {
                if (this.FilterType() == "0")
                {
                    //按天
                    //string year = DateTime.Now.ToString("yyyy");
                    //string month = DateTime.Now.ToString("MM");
                    beginDate = Utils.GetNowBeginDate(); //  Convert.ToDateTime(year + "-" + month + "-01 03:00:00");
                    endDate   = Utils.GetNowEndDate();   //Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("yyyy/MM/dd") + " 03:00:00");
                }
                else
                {
                    //年
                    beginDate = DateTime.Now.AddYears(-1);
                    endDate   = DateTime.Now;
                }
            }
            else
            {
                beginDate = Convert.ToDateTime(b.ToString("yyyy/MM/dd") + " 00:03:00");
                endDate   = Convert.ToDateTime(e.ToString("yyyy/MM/dd") + " 00:03:00");
            }
            ICountDataService dataService = IoC.Resolve <ICountDataService>();

            this.repList.DataSource = dataService.FilterSp_userBannerTypeSuanTable(beginDate.Value, endDate.Value, this.TraceTypeStr, Convert.ToInt32(this.FilterType()));
            this.repList.DataBind();
            this.repList.Visible = true;
        }
示例#2
0
        private void Bind()
        {
            DateTime?beginDate = null;
            DateTime?endDate   = null;
            DateTime b;
            DateTime e;

            if (!DateTime.TryParse(this.txtBeginDate.Text.Trim(), out b) || !DateTime.TryParse(this.txtEndDate.Text.Trim(), out e))
            {
                if (this.FilterType() == "0")
                {
                    //按天
                    //string year = DateTime.Now.ToString("yyyy");
                    //string month = DateTime.Now.ToString("MM");
                    //beginDate = Convert.ToDateTime(year + "-" + month + "-01 03:00:00");
                    //endDate = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("yyyy/MM/dd") + " 03:00:00");
                    beginDate = Utils.GetNowBeginDate(); //  Convert.ToDateTime(year + "-" + month + "-01 03:00:00");
                    endDate   = Utils.GetNowEndDate();   //Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("yyyy/MM/dd") + " 03:00:00");
                }
                else
                {
                    //年
                    beginDate = DateTime.Now.AddYears(-1);
                    endDate   = DateTime.Now;
                }
            }
            else
            {
                beginDate = Convert.ToDateTime(b.ToString("yyyy/MM/dd") + " 03:00:00");
                endDate   = Convert.ToDateTime(e.ToString("yyyy/MM/dd") + " 03:00:00");
            }
            ICountDataService dataService = IoC.Resolve <ICountDataService>();

            if (this.FilterType() == "0")
            {
                //按日
                var dayRes = dataService.FilterSp_DayJieSuanTable(beginDate.Value, endDate.Value);
                this.repList.DataSource = dayRes;
                this.repList.DataBind();
                this.repList.Visible       = true;
                this.RepeaterMonth.Visible = false;
                this.rptSum.DataSource     = SumDayRes(dayRes);
                this.rptSum.DataBind();
            }
            else
            {
                //按月
                var res = dataService.FilterSp_MonthJieSuanTable(beginDate.Value, endDate.Value);
                this.RepeaterMonth.DataSource = res;
                this.RepeaterMonth.DataBind();
                this.repList.Visible       = false;
                this.RepeaterMonth.Visible = true;
                this.rptSum.DataSource     = SumRes(res);
                this.rptSum.DataBind();
            }
        }
        private void BindData()
        {
            string beginDate = Utils.GetNowBeginDateStr(); //业务开始日期
            string endDate   = Utils.GetNowEndDateStr();   //业务截止日期

            ICountDataService countDataService = IoC.Resolve <ICountDataService>();
            var result = countDataService.GetCountData(beginDate, endDate);

            if (result == null)
            {
                return;
            }
            //盈亏统计
//            result.yesterDayData

            //统计
            this.mUserData = result.userData;
            if (this.mUserData == null)
            {
                mUserData = new UserData();
            }

            //rptList.DataSource = result.playTypeRadioDataList;//玩法
            //rptList.DataSource = result.lotteryDataList;//彩种
            //rptList.DataBind();

            //彩票投注金额
            rptlotteryType.DataSource = result.lotteryTypeDataList.OrderByDescending(x => x.BetMoney);//彩票投注
            rptlotteryType.DataBind();

            //树图
            //mStatDataStr
            StringBuilder builder = new StringBuilder();

            foreach (var item in result.toDayData)
            {
                string period = item.OccDate;
                builder.Append("{");
                builder.AppendFormat("period:'{0}',yk: {1},tz:{2}", period, item.ProfitAndLossMoney, item.BetMoney);
                builder.Append("},");
            }
            mStatDataStr = builder.ToString();
            if (mStatDataStr.EndsWith(","))
            {
                mStatDataStr = "{data:[" + mStatDataStr.Substring(0, mStatDataStr.Length - 1) + "]}";
            }

            BindYingKuiStat();//盈亏报表
        }
示例#4
0
        private void BindResult()
        {
            string beginDate = this.txtBeginDate.Text.Trim(); //业务开始日期
            string endDate   = this.txtEndDate.Text.Trim();   //业务截止日期

            ICountDataService countDataService = IoC.Resolve <ICountDataService>();
            var result = countDataService.GetCountData(beginDate, endDate);

            if (result != null)
            {
                var res = result.lotteryDataList.Where(x => x.LotteryCode == this.txtLotteryId.Value).FirstOrDefault();
                if (null == res || res.playTypeRadioDataList == null)
                {
                    return;
                }
                this.rptList1.DataSource = res.playTypeRadioDataList;
                this.rptList1.DataBind();
            }
        }
        private void Bind()
        {
            ICountDataService countDataService = IoC.Resolve <ICountDataService>();
            var source = countDataService.GetClearDataStat().FirstOrDefault();

            if (null == source)
            {
                return;
            }
            lbCustomer.Text      = source.UserCount.ToString();
            lbBettcount.Text     = source.bettCount.ToString();
            lbCusLoginLog.Text   = source.CusLoginLog.ToString();
            lbIssue.Text         = source.OpenIssue.ToString();
            lbManLogCount.Text   = source.SysLoginLog.ToString();
            lbCusChartCount.Text = source.CusMessage.ToString();
            lbsockChart.Text     = source.ChartMsg.ToString();
            lbrechangeCount.Text = source.rechangeCount.ToString();
            lbTiXian.Text        = source.TiXian.ToString();
            lbZhanBian.Text      = source.ZhanBian.ToString();
        }
        /// <summary>
        /// 盈亏统计
        /// </summary>
        private void BindYingKuiStat()
        {
            List <Sp_DayJieSuanTable> showResult  = new List <Sp_DayJieSuanTable>();
            ICountDataService         dataService = IoC.Resolve <ICountDataService>();
            //获取今日盈亏统计
            DateTime beginDate = Utils.GetNowBeginDate();
            DateTime endDate   = Utils.GetNowEndDate();
            var      nowResult = dataService.FilterSp_DayJieSuanTable(beginDate, endDate);

            if (null != nowResult && nowResult.Count > 0)
            {
                var nowStat = this.EmptySp_DayJieSuanTable("今日统计");
                foreach (var item in nowResult)
                {
                    nowStat.Activity        += item.Activity;
                    nowStat.Chongzhi        += item.Chongzhi;
                    nowStat.FenHong         += item.FenHong;
                    nowStat.Jiangjinpaisong += item.Jiangjinpaisong;
                    nowStat.QianDao         += item.QianDao;
                    nowStat.tiXian          += item.tiXian;
                    nowStat.TouZhu          += item.TouZhu;
                    nowStat.YingKui         += item.YingKui;
                    nowStat.YongJing        += item.YongJing;
                    nowStat.Youxifandian    += item.Youxifandian;
                    nowStat.ZhuChe          += item.ZhuChe;
                }
                showResult.Add(nowStat);
            }
            else
            {
                showResult.Add(EmptySp_DayJieSuanTable("今日统计"));
            }
            //昨日统计
            var preResult = dataService.FilterSp_DayJieSuanTable(beginDate.AddDays(-1), endDate.AddDays(-1));

            if (null != preResult && preResult.Count > 0)
            {
                var nowStat = this.EmptySp_DayJieSuanTable("昨日统计");
                foreach (var item in preResult)
                {
                    nowStat.Activity        += item.Activity;
                    nowStat.Chongzhi        += item.Chongzhi;
                    nowStat.FenHong         += item.FenHong;
                    nowStat.Jiangjinpaisong += item.Jiangjinpaisong;
                    nowStat.QianDao         += item.QianDao;
                    nowStat.tiXian          += item.tiXian;
                    nowStat.TouZhu          += item.TouZhu;
                    nowStat.YingKui         += item.YingKui;
                    nowStat.YongJing        += item.YongJing;
                    nowStat.Youxifandian    += item.Youxifandian;
                    nowStat.ZhuChe          += item.ZhuChe;
                }
                showResult.Add(nowStat);
            }
            else
            {
                showResult.Add(EmptySp_DayJieSuanTable("昨日统计"));
            }
            //当月统计
            beginDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1, 0, 3, 0).AddDays(-1);//当月第一天
            endDate   = beginDate.AddMonths(1).AddDays(-1);
            var nowMonthResult = dataService.FilterSp_MonthJieSuanTable(beginDate, endDate);

            if (null != nowMonthResult && nowMonthResult.Count > 0)
            {
                var nowStat = this.EmptySp_DayJieSuanTable("当月统计");
                foreach (var item in nowMonthResult)
                {
                    nowStat.Activity        += item.Activity;
                    nowStat.Chongzhi        += item.Chongzhi;
                    nowStat.FenHong         += item.FenHong;
                    nowStat.Jiangjinpaisong += item.Jiangjinpaisong;
                    nowStat.QianDao         += item.QianDao;
                    nowStat.tiXian          += item.tiXian;
                    nowStat.TouZhu          += item.TouZhu;
                    nowStat.YingKui         += item.YingKui;
                    nowStat.YongJing        += item.YongJing;
                    nowStat.Youxifandian    += item.Youxifandian;
                    nowStat.ZhuChe          += item.ZhuChe;
                }
                showResult.Add(nowStat);
            }
            else
            {
                showResult.Add(EmptySp_DayJieSuanTable("当月统计"));
            }

            beginDate = beginDate.AddMonths(-1);
            endDate   = endDate.AddMonths(-1);
            //上月统计
            var preMonthResult = dataService.FilterSp_MonthJieSuanTable(beginDate, endDate);

            if (null != preMonthResult && preMonthResult.Count > 0)
            {
                var nowStat = this.EmptySp_DayJieSuanTable("上月统计");
                foreach (var item in preMonthResult)
                {
                    nowStat.Activity        += item.Activity;
                    nowStat.Chongzhi        += item.Chongzhi;
                    nowStat.FenHong         += item.FenHong;
                    nowStat.Jiangjinpaisong += item.Jiangjinpaisong;
                    nowStat.QianDao         += item.QianDao;
                    nowStat.tiXian          += item.tiXian;
                    nowStat.TouZhu          += item.TouZhu;
                    nowStat.YingKui         += item.YingKui;
                    nowStat.YongJing        += item.YongJing;
                    nowStat.Youxifandian    += item.Youxifandian;
                    nowStat.ZhuChe          += item.ZhuChe;
                }
                showResult.Add(nowStat);
            }
            else
            {
                showResult.Add(EmptySp_DayJieSuanTable("上月统计"));
            }

            this.repListYingKui.DataSource = showResult;
            this.repListYingKui.DataBind();
        }
        protected void btnClear_Click(object sender, EventArgs e)
        {
            var btn = sender as Button;
            // 0 用户数 1投注、追号、账变 2会员登录日志  3开奖期数 4管理员登录日志 5客户消息 6聊天消息 7充值记录 8充值记录
            int     tp     = 0;
            decimal monery = 0m;
            int     day    = 60;

            switch (btn.ID)
            {
            case "btnClear":
                if (!decimal.TryParse(this.txtMinMoner.Text.Trim(), out monery))
                {
                    JsAlert("金额格式输入错误!");
                    return;
                }
                tp  = 0;
                day = GetDrpDay(drpCode);
                break;

            case "btnClearBett":
                tp  = 1;
                day = GetDrpDay(drpBet);
                break;

            case "btnCusLog":
                tp  = 2;
                day = GetDrpDay(drpCusLog);
                break;

            case "btnIssue":
                tp  = 3;
                day = GetDrpDay(drpIssue);
                break;

            case "btnManLog":
                tp  = 4;
                day = GetDrpDay(drpMaLog);
                break;

            case "btnChartCount":
                tp  = 5;
                day = GetDrpDay(drpChartCount);
                break;

            case "btnSockChart":
                tp  = 6;
                day = GetDrpDay(drpSockChart);
                break;

            case "btnrechangeCount":
                tp  = 7;
                day = GetDrpDay(drprechangeCount);
                break;

            case "btnTiXian":
                tp  = 8;
                day = GetDrpDay(drpTiXian);
                break;

            case "btnZhanBian":
                tp  = 9;
                day = GetDrpDay(drpZhangBian);
                break;
            }

            ICountDataService countDataService = IoC.Resolve <ICountDataService>();

            countDataService.ClearData(tp, monery, day);
            JsAlert("数据清理成功!");
            this.Bind();
        }