//加载主界面 private void Form1_Load(object sender, EventArgs e) { if (_pageNum == 0) { logonform.ShowDialog(); //加载登录界面 if (LogonFormResult(_pageNum) == 0) //登录结果 { //posback.GetPra(); } } _pageNum = 1; label_LoginPattern.Text = posconfig.LoginPattern; //显示启动模式 dtime.Start(); //开启显示时间 PosBack posback = new PosBack(); posback.GetPra(); //模拟取参 Update_panel_Parameters_Show(); tabControl1.Visible = true; //标签控制页 panel_Parameters.Visible = true; //显示参数区域 nownumbox = BetNo_A1; nownumbox.Focus(); toolTip1.SetToolTip(tableLayoutPanel_SomePra, posconfig.ServerIP + "\r\n" + posconfig.Port); toolTip1.SetToolTip(Btn_Logonoff, posconfig.ServerIP + "\r\n" + posconfig.Port); toolTip1.SetToolTip(label_Date, posconfig.ServerIP + "\r\n" + posconfig.Port); }
void Update_panel_Parameters_Show() { PosBack posback = new PosBack(); GameName.Text = posback.gamename; DrawNo.Text = posback.drawno; AgentId.Text = posback.xszbm; Lsh.Text = posback.lsh; SmallCount.Text = posback.smallcount; Balance.Text = posback.balance; TQTime.Text = posback.tqtime; }
//处理登录界面返回结果 int LogonFormResult(short pageNum) { //确认登录 if (logonform.DialogResult == DialogResult.OK) { try { // TODO: 此处建立acceptor连接 PosBack posback = new PosBack(); posback.GetPra(); //模拟取参 // logonform.Close(); return(0); } catch (Exception exc) { MessageBox.Show(exc.ToString()); return(100); } } //退出 or 取消登录 else if (logonform.DialogResult == DialogResult.Cancel) { //程序启动时将直接退出,而不是返回主界面 if (_pageNum == 0) { try { this.Close(); } catch (Exception exc) { MessageBox.Show(exc.ToString()); throw; } return(-1); } try { logonform.Close(); } catch (Exception exc) { MessageBox.Show(exc.ToString()); throw; } return(0); } return(-2); }
int DOF8Bet() { PosBack posback = new PosBack(); posback = new PosBack(); //string key = ""; //Control[] pancon; //pancon = panel_Bet.Controls.Find(key, true); Control.ControlCollection pans = panel_Bet.Controls; foreach (Control panel in pans) { if (panel.GetType() == typeof(Panel) && panel.Name == panelA.Name) { Control.ControlCollection tboxs = panelA.Controls; foreach (Control tbox in tboxs) { if (tbox.GetType() == typeof(TextBox) && tbox.Visible == true) { if (tbox.Text == string.Empty) { TestLog("号码不足"); return(-1); } //TestLog(tbox.Name + "||" + tbox.Text); if (posback.ListBetNum(tbox) != 0) { TestLog("号码重复!!"); return(-2); } } } posback.SortBetNum(); TestLog("\r\n-----"); foreach (Control tbox in PosBack.tboxlist) { TestLog(tbox.Name + "||" + tbox.Text); } } //Console.Write(conindex.Name + "||" + conindex.Text + "||" + conindex.TabIndex + "\r\n"); } return(0); string BetAStr = BetNo_A1.Text + BetNo_A2 + BetNo_A3 + BetNo_A4 + BetNo_A5 + BetNo_A6 + BetNo_A7 + BetNo_A8 + BetNo_A9; }