private void tmDJS_Tick(object sender, EventArgs e) { betweenExcept = betweenExcept.Add(-_1s); if (betweenExcept.TotalSeconds <= 0) { showNextOpenInfo(); getFlag = true; } else { showDJS(); } if (getFlag && ((int)betweenExcept.TotalSeconds) % 3 == 0) { var list = Tools.client.GetLotteryHistroyInfo(LogGuid, 1, LotteryId); if (list != null && list.Count > 0) { if (list[0].Expect != LastOpenInfo.Expect) { LastOpenInfo = list[0]; showLastOpenInfo(); dgvHistoryNum.Rows.Insert(0, 1); dgvHistoryNum.Rows[0].Cells[0].Value = LastOpenInfo.Expect; dgvHistoryNum.Rows[0].Cells[1].Value = LastOpenInfo.OpenCode; getFlag = false; } } } }
private void btnLogOut_Click(object sender, EventArgs e) { tmDJS.Stop(); dgvHistoryNum.Rows.Clear(); Account = null; plLog.Visible = true; NextOpenInfo = null; LastOpenInfo = null; }
private void btnLogin_Click(object sender, EventArgs e) { LogGuid = Guid.NewGuid().ToString(); var name = txtName.Text.Trim(); var pwd = txtPwd.Text.Trim(); if (name == "" || pwd == "") { return; } if (Tools.client.LoginOn(Tools.GetJm(), LogGuid, name, pwd) == "true") { LotteryId = (int)cbocz.SelectedValue; plLog.Visible = false; Account = Tools.client.GetAccountInfo(LogGuid); if (Account != null) { lblname.Text = Account.AccountName; lblmoney.Text = Account.AccountBalance + "(元)"; lblpt.Text = cbopt.Text; lblcz.Text = cbocz.Text; var list = Tools.client.GetLotteryHistroyInfo(LogGuid, 20, LotteryId); dgvHistoryNum.Rows.Clear(); foreach (var item in list) { var row = dgvHistoryNum.Rows[dgvHistoryNum.Rows.Add()]; row.Cells[0].Value = item.Expect; row.Cells[1].Value = item.OpenCode; } if (list != null && list.Count > 0) { LastOpenInfo = list[0]; showLastOpenInfo(); } showNextOpenInfo(); } } }