Beispiel #1
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            dgvInfo.Rows.Clear();
            if (cboStatus.SelectedIndex != 0)
            {
                switch (cboStatus.Text)
                {
                case "等待开奖":
                    Status = 2;
                    break;

                case "开奖中":
                    Status = 0;
                    break;

                case "等待派彩":
                    Status = -2;
                    break;

                case "未中奖":
                    Status = -1;
                    break;

                case "中奖":
                    Status = 1;
                    break;
                }
            }
            if (cboGame.SelectedIndex != 0)
            {
                GameId = (int)cboGame.SelectedValue;
            }
            if (!int.TryParse(txtBetId.Text, out BetId))
            {
                BetId = 0;
            }
            var list = GameDAL.GetBetList(StaticInfo.Account.Id, dtStart.Value, dtEnd.Value, Status, GameId, BetId, cbZH.Checked);

            lblTotal.Text = string.Format("投注:{0} RMB,中奖:{1} RMB", list.Sum(n => n.BetMoney), list.Sum(n => n.BackMoney));
            foreach (var item in list)
            {
                var r = dgvInfo.Rows[dgvInfo.Rows.Add()];
                r.Cells[0].Value = item.Accounts.AccountName;
                r.Cells[1].Value = item.LotteryOpenInfo.Lotterys.LotteryName;
                r.Cells[2].Value = MyTool.GetLotteryPlayList(item.LotteryOpenInfo.Lotterys.LotteryType)[item.BetPlayTypeCode - 1].LotteryPlayName;
                r.Cells[3].Value = item.CreateTime.ToString();
                r.Cells[4].Value = item.LotteryOpenInfo.Expect;
                r.Cells[5].Value = "否";
                r.Cells[6].Value = item.BetMoney;
                r.Cells[7].Value = item.BackMoney;
                r.Cells[8].Value = EnumTool.GetBetResultType(item.ResultType);
                r.Cells[9].Value = "查看";
                r.Cells[9].Tag   = item.Id;
            }
        }
        private void FrmBetInfo_Load(object sender, EventArgs e)
        {
            var info = LotteryBetInfoDAL.GetBetInfoById(betInfoId);

            lblId.Text        = info.Id.ToString();
            lblName.Text      = info.Accounts.AccountName;
            lblOpenNo.Text    = info.LotteryOpenInfo.Expect;
            lblBackMoney.Text = "¥" + info.BackMoney;
            lblBetMoney.Text  = "¥" + info.BetMoney;
            lblbetTime.Text   = info.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
            lblBetTimes.Text  = info.BetTimes + "倍";
            lblBetUnit.Text   = info.BetUnit + "注";
            lblOpenNum.Text   = info.LotteryOpenInfo.OpenCode;
            lblPercent.Text   = info.GetBackPercent.ToString();
            lblStatus.Text    = EnumTool.GetBetResultType(info.ResultType);
            lblText.Text      = string.Format("[{0}]{1}", MyTool.GetLotteryPlayList(info.LotteryOpenInfo.Lotterys.LotteryType)[info.BetPlayTypeCode - 1].LotteryPlayName, info.BetNum.Length > 17 ? info.BetNum.Substring(0, 17) : info.BetNum);
            lblWinUnit.Text   = info.WinUnit + "注";
            txtNum.Text       = info.BetNum;
            lblGameName.Text  = info.LotteryOpenInfo.Lotterys.LotteryName;
        }