/// <summary> /// 下注 /// </summary> public feiPanJieGuo StartXiaZhu(xztj xztj, string qiHao) { feiPanJieGuo fpjgData = new feiPanJieGuo(); fpjgData.serverUrl = ""; fpjgData.yuE = "0"; lblYuE.Text = "0"; lblServer.Text = ""; lblName.Text = ""; lblState.Text = "链接中"; if (cbStart.Checked == true) { string useServer = ""; //尝试下注 if (ServerFeiPan.checkLogin() == false) { ServerFeiPan.loginAgain(); } if (ServerFeiPan.checkLogin() == true) { if (ServerFeiPan.ServerType.Equals("顺丰")) { fpjgData.isSuccess = true; fpjgData.serverUrl += ServerFeiPan.FeidanUrl + ";"; fpjgData = ServerFeiPan.xiaZhu_shunfen(xztj, qiHao, fpjgData); } else if (ServerFeiPan.ServerType.Equals("永利")) { fpjgData.isSuccess = true; fpjgData.serverUrl += ServerFeiPan.FeidanUrl + ";"; fpjgData = ServerFeiPan.xiaZhu_yongli(xztj, qiHao, fpjgData); } useServer = ServerFeiPan.ServerType + ServerFeiPan.LoginName; } foreach (ListViewItem item in lvSerState.Items) { item.SubItems[4].Text = "已停止"; } //重新遍历服务器列表 if (fpjgData.isSuccess == false) { //加载服务器 DataTable dtServer = SQLiteHelper.ExecuteDataTable("select * from fuwuqi_" + (String.IsNullOrWhiteSpace(Seq) ? CacheData.Seq : Seq), null); if (dtServer.Rows.Count > 0) { foreach (DataRow row in dtServer.Rows) { string _serverType = row["类型"].ToString(); string _serverUrl = row["服务器地址"].ToString(); string _userName = row["用户名"].ToString(); string _userPass = row["密码"].ToString(); if (_serverType.Equals(_serverType + _userName)) { function.log("提交失败:" + _serverType + _userName); continue; } if (_serverType.Equals("顺丰")) { ServerFeiPan.login(_serverUrl, _userName, _userPass, _serverType); if (ServerFeiPan.IsLoginSuccess == false && cbIsTryCon.Checked) { frmMessageTimer frmMessage = new frmMessageTimer("服务器" + _serverUrl + "不能使用"); frmMessage.Show(); Application.DoEvents(); } if (ServerFeiPan.IsLoginSuccess == true) { fpjgData = ServerFeiPan.xiaZhu_shunfen(xztj, qiHao, fpjgData); } } else if (_serverType.Equals("永利")) { ServerFeiPan.login(_serverUrl, _userName, _userPass, _serverType); if (ServerFeiPan.IsLoginSuccess == false && cbIsTryCon.Checked) { frmMessageTimer frmMessage = new frmMessageTimer("服务器" + _serverUrl + "不能使用"); frmMessage.Show(); Application.DoEvents(); } if (ServerFeiPan.IsLoginSuccess == true) { fpjgData = ServerFeiPan.xiaZhu_yongli(xztj, qiHao, fpjgData); } } // if (ServerFeiPan.IsLoginSuccess) { lblYuE.Text = ServerFeiPan.KeYongYuE.ToString(); lblServer.Text = ServerFeiPan.FeidanUrl; lblName.Text = ServerFeiPan.LoginName; lblState.Text = "使用中"; } else { lblYuE.Text = ServerFeiPan.KeYongYuE.ToString(); lblServer.Text = ServerFeiPan.FeidanUrl; lblName.Text = ServerFeiPan.LoginName; lblState.Text = "已停止"; } foreach (ListViewItem item in lvSerState.Items) { if (item.SubItems[2].Text.Equals(_serverUrl)) { item.SubItems[4].Text = ServerFeiPan.IsLoginSuccess ? "使用中" : "已停止"; } } // if (fpjgData.isSuccess) { break; } } } } } else { fpjgData = ServerCommon.SetFeiPanJieGuo(fpjgData, true); fpjgData.errorMessage = "未开启"; //关闭直接返回 return(fpjgData); } if (fpjgData.isSuccess == false) { playFaileSound(); if (cbStart.Checked && ServerFeiPan.IsLoginSuccess == false) { frmMessageTimer frmMessage = new frmMessageTimer("盘口可能坏了,请检查是否可用?"); frmMessage.Show(); cbStart.Checked = false; } } //for (int i = 0; i < 4; i++)//总和组合 //{ // fpjgData.ZHZHDXDS[i] = true; //} // //lblYuE.Text = fpjgData.yuE; //插入 feiPanJieGuoInsert(xztj, fpjgData, qiHao); //查询最新 chaXunZuiXin(); return(fpjgData); // //string result = HttpHelps.Post("", _feidanUrl + "/user/cql_cqsc_lm.aspx?t=all", // _webCookie, Encoding.Default); }
public void TryConnect() { if (ServerFeiPan.checkLogin() == true) { //已登录 function.log("已经登录 【TryConnect】"); return; } //加载服务器 DataTable dtServer = SQLiteHelper.ExecuteDataTable("select * from fuwuqi_" + (String.IsNullOrWhiteSpace(Seq) ? CacheData.Seq : Seq), null); if (dtServer.Rows.Count > 0) { foreach (DataRow row in dtServer.Rows) { string _serverType = row["类型"].ToString(); string _serverUrl = row["服务器地址"].ToString(); string _userName = row["用户名"].ToString(); string _userPass = row["密码"].ToString(); // System.Windows.Forms.ListViewItem.ListViewSubItem subItem = null; foreach (ListViewItem item in lvSerState.Items) { if (item.SubItems[2].Text.Equals(_serverUrl)) { subItem = item.SubItems[4]; } } subItem.Text = "链接中.."; if (subItem != null) { if (_serverType.Equals("顺丰")) { ServerFeiPan.login(_serverUrl, _userName, _userPass, _serverType); } else if (_serverType.Equals("永利")) { ServerFeiPan.login(_serverUrl, _userName, _userPass, _serverType); } // subItem.Text = ServerFeiPan.IsLoginSuccess ? "使用中" : "已停止"; if (ServerFeiPan.IsLoginSuccess) { lblYuE.Text = ServerFeiPan.KeYongYuE.ToString(); lblServer.Text = ServerFeiPan.FeidanUrl; lblName.Text = ServerFeiPan.LoginName; lblState.Text = "使用中"; break; } else { lblYuE.Text = ServerFeiPan.KeYongYuE.ToString(); lblServer.Text = ServerFeiPan.FeidanUrl; lblName.Text = ServerFeiPan.LoginName; lblState.Text = "已停止"; } } function.log("测试登录 【TryConnect】" + _serverType); } } // if (cbStart.Checked && ServerFeiPan.IsLoginSuccess == false) { playFaileSound(); frmMessageTimer frmMessage = new frmMessageTimer("盘口可能坏了,请检查是否可用?"); frmMessage.Show(); cbStart.Checked = false; } }
/// <summary> /// 回水查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button8_Click(object sender, EventArgs e) { //===================2018-02-08=================== //在属性窗口中改 主窗体的 textBox23 的 modifiers 属性为Public if (MainPlugin.frmMain != null && MainPlugin.frmMain._group != null) { try { bili = Convert.ToDouble(MainPlugin.frmMain.textBox23.Text); } catch { frmMessageTimer frmMessage = new frmMessageTimer("比例设置错误!"); frmMessage.Show(); } } //===================2018-02-08=================== string sj1 = dateTimePicker6.Value.ToString("yyyy-MM-dd") + " 00:00:00"; string sj2 = dateTimePicker7.Value.ToString("yyyy-MM-dd") + " 23:59:59"; string str = "select * from NameInt_" + seq + " where Time BETWEEN '" + sj1 + "' AND '" + sj2 + "' group by seq"; DataTable deset = SQLiteHelper.ExecuteDataTable(str, null); int q = 0; // decimal showDD = 0; decimal showDD_HS = 0; decimal showDXDS = 0; decimal showDXDS_HS = 0; decimal showZ = 0; decimal showZ_HS = 0; // listView4.Items.Clear(); foreach (DataRow dr in deset.Rows) { if (dr[1].ToString() == "") { continue; } string s = "select * from NameInt_" + seq + " where seq like '" + dr[1].ToString() + "' and Time BETWEEN '" + sj1 + "' AND '" + sj2 + "'"; DataTable datat = SQLiteHelper.ExecuteDataTable(s, null); int qd = 0; int dxds = 0; int zh = 0; int zhzh = 0; int lhh = 0; foreach (DataRow drB in datat.Rows) { for (int i = 0; i < 10; i++) { for (int x = 0; x < 5; x++) { qd += int.Parse(drB["qd" + (x + 1).ToString() + "_" + i.ToString()].ToString()); } } for (int i = 0; i < 5; i++)//大小单双 { for (int x = 0; x < 4; x++) { dxds += int.Parse(drB["d" + (i + 1).ToString() + "_" + x.ToString()].ToString()); } } for (int i = 0; i < 4; i++)//总和 总和组合 { zh += int.Parse(drB["zh" + i.ToString()].ToString()); zhzh += int.Parse(drB["zhzh" + i.ToString()].ToString()); } for (int i = 0; i < 3; i++)//龙虎和 { lhh += int.Parse(drB["LHH" + i.ToString()].ToString()); } } if (qd.ToString().Length >= int.Parse(textBox5.Text)) { q++; string tagS = dr[1].ToString() + "/" + dateTimePicker6.Value.ToString("yyyy-MM-dd") + "/" + dateTimePicker7.Value.ToString("yyyy-MM-dd"); ListViewItem item = new ListViewItem(); //item.SubItems.Add(q.ToString()); item.SubItems.Add(dr["seq"].ToString()); item.SubItems.Add(dr["NickName"].ToString()); //单点 item.SubItems.Add(qd.ToString()); item.SubItems.Add((qd * bili / 100).ToString()); //大小单双 int zonghe = dxds + zh + zhzh + lhh; item.SubItems.Add(zonghe.ToString()); item.SubItems.Add((zonghe * bili / 100).ToString()); //总下注 item.SubItems.Add((qd + zonghe).ToString()); //总回水 item.SubItems.Add(((qd + zonghe) * bili / 100).ToString()); item.SubItems.Add("确认回水"); item.SubItems.Remove(item.SubItems[0]); item.Tag = tagS; // string sqlCCC = "select count(1) from Chaxun_" + seq + " where 时间='" + tagS + "' "; DataRow sCCC = SQLiteHelper.ExecuteDataRow(sqlCCC, null); int iCCCCount = int.Parse(sCCC[0].ToString()); if (iCCCCount > 0) { item.BackColor = System.Drawing.Color.Yellow; showDD += qd; showDXDS += zonghe; showZ += qd + zonghe; showDD_HS += (decimal)(qd * bili / 100); showDXDS_HS += (decimal)(zonghe * bili / 100); showZ_HS += (decimal)((qd + zonghe) * bili / 100); } listView4.Items.Add(item); } } label13.Text = String.Format("当前选中发放详情:\n 单点总下注:{0} 单点回水:{1} 大小单双总下注:{2} 大小单双回水:{3} 总下注:{4} 总回水:{5} ", showDD.ToString(), showDD_HS.ToString(), showDXDS.ToString(), showDXDS_HS.ToString(), showZ.ToString(), showZ_HS.ToString()); }