public WebRequestStateEx2(string text2, WebRequest request1, string text1, int num1, EnumCollection.eBetType type1, EnumCollection.eBetTarget target1, MatchNew new4, MatchBetNew new2, MatchNew new3, MatchBetNew new1, AgentToClientBet bet1) { this._strTitle = ""; this._strPost = ""; this._intBetAmount = 0; this._objBetType = EnumCollection.eBetType.HDP; this._objBetTarget = EnumCollection.eBetTarget.FT_Home; this._objMatchParentSite = new MatchNew(); this._objMatchBetParentSite = new MatchBetNew(); this._objMatchChildSite = new MatchNew(); this._objMatchBetChildSite = new MatchBetNew(); this._objMatchBetChildSite = new1; this._objMatchBetParentSite = new2; this._objMatchChildSite = new3; this._objMatchParentSite = new4; this._objRequest = request1; this._strPost = text1; this._strTitle = text2; this._objBetType = type1; this._objBetTarget = target1; this._intBetAmount = num1; this._objAgentToClientBet = bet1; }
public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string format = ""; string str5 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; format = base._strRootURL + "/webroot/restricted/plain/ticket.aspx?{0}&loginname=" + this._strLoginName; switch (target1) { case EnumCollection.eBetTarget.FT_Home: str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_FT_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_Away: str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_FT_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_Over: str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_Under: str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_1: str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_X: str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_2: str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Home: str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_Half_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Away: str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_Half_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Over: str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Under: str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_1: str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_X: str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_2: str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; } string url = string.Format(format, str5); new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Timeout = 0x7530; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Headers["Cookie"] = base._objCookieList.ToString(); request.ContentType = "application/x-www-form-urlencoded"; //request.KeepAlive = true; this.WriteProgramLogger("POST: " + url); base._objBetListLogger.write("POST: " + str5); WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true); this.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4); ProjectData.ClearProjectError(); } }
public abstract void GetTicketAndBet(AgentToClientBet b1, EnumCollection.eBetFollowMethod b2);
public void RaisePerMatchLimit(string text1, AgentToClientBet bet1) { PerMatchLimitEventHandler perMatchLimitEvent = this.perMatchLimitEventHandler; if (perMatchLimitEvent != null) { perMatchLimitEvent(text1, bet1); } }
public void RaiseEventBetQueueListRefresh(string text1, AgentToClientBet bet1) { BetQueueListRefreshEventHandler betQueueListRefreshEvent = this.BetQueueListRefreshEvent; if (betQueueListRefreshEvent != null) { betQueueListRefreshEvent(text1, bet1); } }
public void WebsiteBetQueueRefreshHandler(string text1, string text2, AgentToClientBet bet1) { WebsiteBetQueueRefreshEventHandler websiteBetQueueRefreshEvent = this.WebsiteBetQueueRefreshEvent; if (websiteBetQueueRefreshEvent != null) { websiteBetQueueRefreshEvent(text1, text2, bet1); } }
private void RefreshBetQueue(string text1, AgentToClientBet bet1) { switch (text1) { case "Add": this.AddBetQueue(bet1); break; case "Update": this.UpdateBetQueue(bet1); break; } }
private void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str5 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; switch (target1) { case EnumCollection.eBetTarget.FT_Home: requestUriString = new1.get_FT_HomeBetLink(); break; case EnumCollection.eBetTarget.FT_Away: requestUriString = new1.get_FT_AwayBetLink(); break; case EnumCollection.eBetTarget.FT_Over: requestUriString = new1.get_FT_OverBetLink(); break; case EnumCollection.eBetTarget.FT_Under: requestUriString = new1.get_FT_UnderBetLink(); break; case EnumCollection.eBetTarget.Half_Home: requestUriString = new1.get_Half_HomeBetLink(); break; case EnumCollection.eBetTarget.Half_Away: requestUriString = new1.get_Half_AwayBetLink(); break; case EnumCollection.eBetTarget.Half_Over: requestUriString = new1.get_Half_OverBetLink(); break; case EnumCollection.eBetTarget.Half_Under: requestUriString = new1.get_Half_UnderBetLink(); break; } new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x2710; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.KeepAlive = true; request.Referer = base._strRootURL + "/app/member/FT_browse/body_browse.php?uid=" + this._strUID + "&rtype=re&langx=en-us&mtype=3&delay="; request.AllowAutoRedirect = true; request.Headers["Cookie"] = base._objCookieList.ToString(); WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); ProjectData.ClearProjectError(); } }
/// <summary> /// 当投注额大于单场赛事限制投注额时,进行二分法投注 /// </summary> /// <param name="gamerSite">博彩网</param> /// <param name="message">下注消息</param> /// <param name="currentBet">当前下注对象</param> private void TryBetAgain(WebSiteAbstractClass gamerSite, string message, AgentToClientBet currentBet) { if (message.Contains(IBC_STAKE_DESC) || message.Contains(SBO_STAKE_DESC) || message.Contains(IBC_BETCREDIT_DESC) || message.Contains(SBO_BETCREDIT_DESC) || currentBet.get_SourceAgentMemberBet().BetFailCount > ConstUtil.BET_FAIL_COUNT) { PlayerBetLog log = setBetLogMessage(message); DataServiceAdapter.SavePlayerBetLog(log); currentBet.set_IsRemoved(true); } else if (message.Contains(IBC_PERLIMIT) || message.Contains(SBO_PERLIMIT)) { int betAmount = currentBet.get_TargetAmount(); String[] arrays = message.Split(SPLIT); // 当单场赛事投注达到限制投注额时,将赌注降低为原来的一半进行下注 if (arrays.Length == 2) { betAmount = Conversions.ToInteger(arrays[1]) / 2; } currentBet.set_TargetAmount(betAmount); currentBet.set_BetAmountValue(MARK_VALUE); if (!gamerSite.get_IsGettingFullOdds()) { gamerSite.GetOddsFromServer(); } List<MatchNew> newMatchNews = gamerSite.get_MatchListFull(); MatchNew oldMatchNew = currentBet.get_TargetClientMatch(); foreach (var newMatchNew in newMatchNews) { // 取最新的赛事数据 if (oldMatchNew.get_FT_ID() == newMatchNew.get_FT_ID()) { currentBet.set_TargetClientMatch(newMatchNew); break; } } } gamerSite.get_BetQueueList().UpdateBetMatchInfo(currentBet); }
private void setBetAmount(AgentToClientBet bet) { // 玩家赌注 int newBetAmount = decimal.ToInt32(playerConvert.Member.get_BetCredit()); // 该场比赛玩家首次下注 int gamerBetAmount = System.Convert.ToInt32(playerConvert.Player.PerMatchTarget) - bet.get_BettedAmount(); if (newBetAmount > gamerBetAmount) { newBetAmount = gamerBetAmount; } bet.set_TargetAmount(newBetAmount); }
/// <summary> /// 下注成功 /// </summary> /// <param name="message">下注消息</param> /// <param name="currentBet">下注对象</param> private void SaveBetInfo(string message, AgentToClientBet currentBet) { if (string.IsNullOrEmpty(message)) { return; } message = message.ToLower(); if (message.Contains(BET_SUCCESS)) { PlayerBet playerBet = new PlayerBet(); playerBet.Player = playerConvert.Player; playerBet.IsSuccess = true; playerBet.Result = BET_SUCCESS; playerBet.Remarks = string.Empty; playerBet.AccountingDate = DateTime.Now.ToShortDateString(); DataServiceAdapter.SavePlayerBetInfo(playerBet, currentBet.get_SourceAgentMemberBet()); } else { if (0 == currentBet.get_SourceAgentMemberBet().BetFailCount | currentBet.get_SourceAgentMemberBet().BetFailCount > ConstUtil.BET_FAIL_COUNT) { PlayerBetLog log = setBetLogMessage(message); DataServiceAdapter.SavePlayerBetLog(log); } } }
/// <summary> /// 监听玩家下注信息 /// </summary> /// <param name="message">下注消息</param> /// <param name="currentBet">下注对象</param> private void BetMessageOfPlayer(string message, AgentToClientBet currentBet) { if (string.IsNullOrEmpty(message)) { return; } WebSiteAbstractClass gamerSite = this.playerConvert.WebSite; // 玩家退出时,不再下注 if (!gamerSite.get_IsLoginSuccess()) { gamerSite.WriteBetlistLogger(gamerSite.get_AccountID() + " log out."); return; } message = message.ToLower(); // 当投注额大于单场赛事限制投注额时,进行二分法投注 TryBetAgain(gamerSite, message, currentBet); if (gamerSite.get_BetQueueList().get_AvailableHasClientMatchCount() > 0) { AgentToClientBet bet = gamerSite.get_BetQueueList().get_GetNextBetQueueHasClientMatch(); if ((bet != null) && (((bet.get_SourceAgentMemberBet() != null) & (bet.get_TargetClientMatch() != null)) & !gamerSite.get_IsBetting())) { getGamerDetailInfo(); // 单场赛事投注未达到限制投注额时,投注值取玩家可用投注额与代理为玩家设置的投注额的最小值 if (bet.get_BetAmountValue() != MARK_VALUE) { // 设置赌注 setBetAmount(bet); } gamerSite.WriteBetlistLogger("Gamer:[ " + playerConvert.Player.LoginName + "] \r\n" + bet.get_TargetClientMatch().GenerateInfo() + "Target Amount:" + bet.get_TargetAmount()); gamerSite.WriteProgramLogger("Gamer:[ " + playerConvert.Player.LoginName + "] \r\n" + bet.get_TargetClientMatch().GenerateInfo() + "Target Amount:" + bet.get_TargetAmount()); if (bet.get_TargetAmount() <= 0) { gamerSite.WriteBetlistLogger(gamerSite.get_AccountID() + " amount is invalid.(amount=0)"); bet.set_IsRemoved(true); gamerSite.get_BetQueueList().UpdateBetMatchInfo(bet); return; } gamerSite.GetTicketAndBet(bet, playerConvert.Member.get_BetFollowMethod()); } } }
private void GetTicketAndBetFromAgent(MatchBetNew new1, MatchNew new4, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str5 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; requestUriString = base._strRootURL + "/english/index.php?p=bettingback&b=soccer|"; if (new1.get_GameType() == EnumCollection.eGameType.Running) { str5 = "r"; } switch (target1) { case EnumCollection.eBetTarget.FT_Home: requestUriString = requestUriString + string.Format("{2}ah|{0}|a||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.FT_Away: requestUriString = requestUriString + string.Format("{2}ah|{0}|b||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.FT_Over: requestUriString = requestUriString + string.Format("{2}ou|{0}|over||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.FT_Under: requestUriString = requestUriString + string.Format("{2}ou|{0}|under||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Home: requestUriString = requestUriString + string.Format("{2}ahht|{0}|a||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Away: requestUriString = requestUriString + string.Format("{2}ahht|{0}|b||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Over: requestUriString = requestUriString + string.Format("{2}ouht|{0}|over||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Under: requestUriString = requestUriString + string.Format("{2}ouht|{0}|under||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5); break; } new3 = new1; new2 = new4.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x2710; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/english/index.php?p=user_main"; request.ContentLength = 0L; request.KeepAlive = true; WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, "", num1, new3.get_BetType(), target1, new MatchNew(), new3, new4, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new4, new2, null); ProjectData.ClearProjectError(); } }
private void UpdateBetQueue(AgentToClientBet bet1) { if (this._synchronisingObject != null) { if (this._synchronisingObject.InvokeRequired) { this._synchronisingObject.BeginInvoke(new ProcessEventBetQueueDelegate(this.UpdateBetQueue), new object[] { bet1 }); } else { IEnumerator enumerator = null; ListViewItem current = new ListViewItem(); MatchBetNew new2 = bet1.get_SourceAgentMemberBet(); try { enumerator = this.get_lstBetQueue().Items.GetEnumerator(); while (enumerator.MoveNext()) { current = (ListViewItem) enumerator.Current; if (current.SubItems[3].Text == new2.get_ID()) { current.SubItems[0x10].Text = bet1.get_Status(); if (bet1.get_Status().Contains("Stop") | bet1.get_Status().Contains("Changed")) { current.SubItems[0x10].ForeColor = Color.Red; } else { if (bet1.get_Status().Contains("OK")) { current.SubItems[0x10].ForeColor = Color.Blue; continue; } if (bet1.get_Status().Contains("Betting")) { current.SubItems[0x10].ForeColor = Color.Green; continue; } if (bet1.get_Status().Contains("Finding")) { current.SubItems[0x10].ForeColor = Color.DarkGray; continue; } if (bet1.get_Status().Contains("Found")) { current.SubItems[0x10].ForeColor = Color.LightGreen; } } } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } } }
public override void GetTicketAndBet(AgentToClientBet bet1, EnumCollection.eBetFollowMethod method1) { try { if (base._isAutoBetting) { if (!base._isBetting) { if (!this.IsWaitingBetCoolDown()) { int num = 0; if (!base._isPerMatchLimitEnabled | (base._isPerMatchLimitEnabled & base._objPerMatchLimitList.IsCanBet(bet1.get_SourceAgentMemberBet(), ref num))) { bool flag = false; MatchBetNew new2 = new MatchBetNew(); new2 = bet1.get_SourceAgentMemberBet().Clone(); EnumCollection.eBetTarget target = bet1.get_SourceAgentMemberBet().get_BetTarget(); switch (new2.get_BetTarget()) { case EnumCollection.eBetTarget.FT_Home: case EnumCollection.eBetTarget.FT_Over: case EnumCollection.eBetTarget.Half_Home: case EnumCollection.eBetTarget.Half_Under: flag = true; break; default: flag = false; break; } if (method1 == EnumCollection.eBetFollowMethod.Opposite) { target = SpiderFunction.ConvertBetFollowMethodToOpposite(target); } this.GetTicketAndBetFromAgent(bet1.get_SourceAgentMemberBet(), bet1.get_TargetClientMatch(), target, bet1.get_TargetAmount() - bet1.get_BettedAmount(), bet1.CloneObject()); } else { bet1.get_SourceAgentMemberBet().set_Description("Exceed Per Match Limit!"); base._objBetListFailed.Add(bet1.get_SourceAgentMemberBet()); this.get__objBetQueueMonitor().UpdateMatchStatus(bet1.get_SourceAgentMemberBet().get_ID(), "Exceed Per Match Limit!"); this.WriteProgramLogger("Exceed Per Match Limit!"); } } else { this.WriteProgramLogger("Please wait, program is waiting bet cool down..."); } } else { this.WriteProgramLogger("Please wait, program is betting other match..."); } } else { bet1.get_SourceAgentMemberBet().set_Description("Auto Bet OFF."); base._objBetListFailed.Add(bet1.get_SourceAgentMemberBet()); this.get__objBetQueueMonitor().UpdateMatchStatus(bet1.get_SourceAgentMemberBet().get_ID(), "Auto Bet OFF"); this.WriteProgramLogger("Auto Bet OFF."); } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBet: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBet: " + exception.Message); ProjectData.ClearProjectError(); } }
public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str5 = ""; string str = ""; string str3 = ""; string str4 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; requestUriString = base._strRootURL + "/BetProcess_Data.aspx"; switch (target1) { case EnumCollection.eBetTarget.FT_Home: str = new1.get_FTHDP_ID(); str3 = new1.get_FT_HomeOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.FT_Away: str = new1.get_FTHDP_ID(); str3 = new1.get_FT_AwayOddsString(); str4 = "a"; break; case EnumCollection.eBetTarget.FT_Over: str = new1.get_FTOU_ID(); str3 = new1.get_FT_OverOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.FT_Under: str = new1.get_FTOU_ID(); str3 = new1.get_FT_UnderOddsString(); str4 = "a"; break; case EnumCollection.eBetTarget.Half_Home: str = new1.get_HalfHDP_ID(); str3 = new1.get_Half_HomeOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.Half_Away: str = new1.get_HalfHDP_ID(); str3 = new1.get_Half_AwayOddsString(); str4 = "a"; break; case EnumCollection.eBetTarget.Half_Over: str = new1.get_HalfOU_ID(); str3 = new1.get_Half_OverOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.Half_Under: str = new1.get_HalfOU_ID(); str3 = new1.get_Half_UnderOddsString(); str4 = "a"; break; // add 1x2 case EnumCollection.eBetTarget.FT_1: str = new1.get_FT1X2_ID(); str3 = new1.get_FT_1X2HomeOddsString().ToString(); str4 = "1"; break; case EnumCollection.eBetTarget.FT_X: str = new1.get_FT1X2_ID(); str3 = new1.get_FT_1X2AwayOddsString().ToString(); str4 = "X"; break; case EnumCollection.eBetTarget.FT_2: str = new1.get_FT1X2_ID(); str3 = new1.get_FT_1X2DrawOddsString().ToString(); str4 = "2"; break; case EnumCollection.eBetTarget.Half_1: str = new1.get_Half1X2_ID(); str3 = new1.get_Half_1X2HomeOddsString().ToString(); str4 = "1"; break; case EnumCollection.eBetTarget.Half_X: str = new1.get_Half1X2_ID(); str3 = new1.get_Half_1X2AwayOddsString().ToString(); ; str4 = "X"; break; case EnumCollection.eBetTarget.Half_2: str = new1.get_Half1X2_ID(); str3 = new1.get_Half_1X2DrawOddsString().ToString(); ; str4 = "2"; break; } str5 = "bp_Match=" + str + "_" + str4 + "_" + str3 + "&bp_ssport=&chk_BettingChange=4"; // Add Andy 添加新值 2011.08.08 StringBuilder sb = new StringBuilder(str5); sb.Append("&").Append(this.key); sb.Append("=").Append(this.value); str5 = sb.ToString(); // End Andy new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUriString); request.Timeout = 0x7530; request.Method = "POST"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/LeftAllInOne.aspx"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = str5.Length; base._objBetListLogger.write("POST: " + str5); this.WriteProgramLogger("TWESTESST2.0: " + request.Address.ToString()); Stream stream = request.GetRequestStream(); byte[] bytes = Encoding.UTF8.GetBytes(str5); stream.Write(bytes, 0, str5.Length); stream.Close(); this.WriteProgramLogger("TWESTESST2.1: " + request.Address.ToString()); WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true); base.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); ProjectData.ClearProjectError(); } }
private void BetQueueListRefreshCall(string text1, AgentToClientBet bet1) { try { this.RaiseEventBetQueueListRefresh(text1, bet1); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._objErrorLogger.write(base._strName + ": EXCEPTION IN BetQueueListRefreshCall: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN BetQueueListRefreshCall: " + exception.Message); ProjectData.ClearProjectError(); } }
private void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str7 = ""; string str5 = "1"; string str6 = "1"; base._isBetting = true; base._datTicketStart = DateTime.Now; requestUriString = base._strRootURL + "/MenuBet/BetSlipProc.aspx"; switch (target1) { case EnumCollection.eBetTarget.FT_Home: case EnumCollection.eBetTarget.FT_Away: case EnumCollection.eBetTarget.FT_Over: case EnumCollection.eBetTarget.FT_Under: if ((new1.get_FTHomeColor() == Color.Blue) & (new1.get_FTAwayColor() == Color.Red)) { str5 = "0"; } break; case EnumCollection.eBetTarget.Half_Home: case EnumCollection.eBetTarget.Half_Away: case EnumCollection.eBetTarget.Half_Over: case EnumCollection.eBetTarget.Half_Under: if ((new1.get_HalfHomeColor() == Color.Blue) & (new1.get_HalfAwayColor() == Color.Red)) { str5 = "0"; } break; } if (new1.get_GameType() == EnumCollection.eGameType.Early) { str6 = "2"; } if (new1.get_GameType() == EnumCollection.eGameType.Running) { switch (target1) { case EnumCollection.eBetTarget.FT_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RB", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RB", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RBOU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RBOU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=1&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "30", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=2&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "30", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=4&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "31", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=5&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "31", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; } } else { switch (target1) { case EnumCollection.eBetTarget.FT_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "AH", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "AH", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "OU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "OU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=1&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "7", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=2&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "7", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=4&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "8", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=5&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "8", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; } } Label_0B3C: new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x2710; request.Method = "POST"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/MenuBet/LeftMenu.aspx"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = str7.Length; request.KeepAlive = true; WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str7, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.ReadCallBackTicket), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true); base.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); ProjectData.ClearProjectError(); } }
private void WebsiteBetSuccess(string text1, AgentToClientBet bet1) { WebsiteBetQueueRefreshEventHandler websiteBetQueueRefreshEvent = this.WebsiteBetQueueRefreshEvent; if (websiteBetQueueRefreshEvent != null) { websiteBetQueueRefreshEvent(this.get__objWebsite().get_AccountID(), text1, bet1); } }
private void AddBetQueue(AgentToClientBet bet1) { if (this._synchronisingObject != null) { if (this._synchronisingObject.InvokeRequired) { this._synchronisingObject.BeginInvoke(new ProcessEventBetQueueDelegate(this.AddBetQueue), new object[] { bet1 }); } else { MatchBetNew new2 = bet1.get_SourceAgentMemberBet(); ListViewItem item = new ListViewItem(); item.UseItemStyleForSubItems = false; item.SubItems.Add(new2.get_MemberName()); item.SubItems.Add(new2.get_Company()); item.SubItems.Add(new2.get_ID()); item.SubItems.Add(new2.get_BetCoverage().ToString()); item.SubItems.Add(new2.get_GameType().ToString()); if (new2.get_GameType() == EnumCollection.eGameType.Running) { item.SubItems.Add(Conversions.ToString(new2.get_HomeScore()) + "-" + Conversions.ToString(new2.get_AwayScore())); } else { item.SubItems.Add("-"); } item.SubItems.Add(new2.get_HomeName()); item.SubItems[item.SubItems.Count - 1].ForeColor = new2.get_HomeColor(); item.SubItems.Add(new2.get_AwayName()); item.SubItems[item.SubItems.Count - 1].ForeColor = new2.get_AwayColor(); item.SubItems.Add(new2.get_SelectedMatch()); item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Green; if (this.get_IsShowHDPDoubleStyle()) { item.SubItems.Add(new2.get_HDPDouble().ToString("N2")); } else { item.SubItems.Add(new2.get_HDP()); } item.SubItems.Add(new2.get_OddsString()); if (new2.get_Odds() >= 0.0) { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Blue; } else { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Red; } item.SubItems.Add(new2.get_BetAmount()); if (bet1.get_TargetAmount() > -1) { item.SubItems.Add(Conversions.ToString(bet1.get_TargetAmount())); } else { item.SubItems.Add("Max Bet"); } item.SubItems.Add(new2.get_CreateDate().ToLongTimeString()); item.SubItems.Add(new2.get_BetFollowMethod().ToString()); if (new2.get_BetFollowMethod() == EnumCollection.eBetFollowMethod.Opposite) { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Red; } else { item.SubItems[item.SubItems.Count - 1].ForeColor = Color.Blue; } item.SubItems.Add(bet1.get_Status()); if (bet1.get_Status().Contains("Stop")) { item.SubItems[0x10].ForeColor = Color.Red; } else if (bet1.get_Status().Contains("OK")) { item.SubItems[0x10].ForeColor = Color.Blue; } else if (bet1.get_Status().Contains("Betting")) { item.SubItems[0x10].ForeColor = Color.Green; } else if (bet1.get_Status().Contains("Finding")) { item.SubItems[0x10].ForeColor = Color.DarkGray; } else if (bet1.get_Status().Contains("Found")) { item.SubItems[0x10].ForeColor = Color.LightGreen; } if ((this.get_lstBetQueue().Items.Count % 2) == 1) { int num3 = item.SubItems.Count - 1; for (int i = 0; i <= num3; i++) { item.SubItems[i].BackColor = Color.FromArgb(240, 0xf8, 0xff); } } this.get_lstBetQueue().Items.Add(item); if (this.get_lstBetQueue().Items.Count > 0) { this.get_lstBetQueue().Items[this.get_lstBetQueue().Items.Count - 1].Selected = true; this.get_lstBetQueue().Items[this.get_lstBetQueue().Items.Count - 1].EnsureVisible(); } this.get_lblTotalCount().Text = "Total Count: " + this.get_lstBetQueue().Items.Count.ToString(); } } }