public void playBetUnder(ticket o, string money, string IsLive, string phieuchung, string group) { string betGroup = group.Split(',')[1]; this.phieuchung = phieuchung; int usdbet = int.Parse(money) / int.Parse(usd); double hdp = o.hdp; string keoid = o.keoid; double odd = o.odd; string bettype = o.bettype; string choose = o.choose; string homescore = o.score.Split('-')[0]; string awayscore = o.score.Split('-')[1]; string PostData = "ItemList[0][sportname]=Soccer&ItemList[0][Hscore]=" + homescore + "&ItemList[0][Ascore]=" + awayscore + "&ItemList[0][type]=OU&ItemList[0][bettype]=" + bettype + "&ItemList[0][oddsid]=" + keoid.Trim() + "&ItemList[0][betteam]=" + choose + "&ItemList[0][stake]=" + usdbet; string GetTicket = http.Fetch(mainHost + "/Betting/GetTickets", HttpHelper.HttpMethod.Post, sportLink, PostData, ip); if (GetTicket.Replace("\"", "").IndexOf("ErrorCode:0") == -1) { message = "IBET: [" + username + "] LOG OUT"; } else { double oddBet = double.Parse(Util.GetSubstringByString(GetTicket.Replace("\"", ""), "DisplayOdds:", ",")); string MinBet = Util.GetSubstringByString(GetTicket, "\"Minbet\":\"", "\","); string MaxBet = Util.GetSubstringByString(GetTicket, "Maxbet\":\"", "\","); PostData = PostData + "&ItemList[0][oddsStatus]=&ItemList[0][min]=" + MinBet + "&ItemList[0][max]=" + MaxBet; if (double.Parse(MaxBet) < usdbet) { PostData = PostData.Replace("ItemList[0][stake]=" + usdbet, "ItemList[0][stake]=" + MaxBet); money = (int.Parse(MaxBet.Replace(",", "")) * int.Parse(usd)).ToString(); } string ProcessBet = http.Fetch(mainHost + "/Betting/ProcessBet", HttpHelper.HttpMethod.Post, sportLink, PostData, ip); if (ProcessBet.IndexOf("Đơn cược đã được chấp nhận") < 0 && ProcessBet.IndexOf("Your bet has been accepted") < 0 && ProcessBet.IndexOf("đang được xử lý") < 0) { message = "IBET: [" + username + "] BET FAILED - INFO: " + o.ToString(); } else { this.phieuchung = mylib.generateID("T"); this.realmoney = money; db.doInsertTicket("IBET", username, o.bettype, o.hdp.ToString(), o.home, o.away, choose, oddBet.ToString(), money, usd, "DX", this.phieuchung); message = "IBET: [" + username + "] BET SUCCESS - INFO: " + o.ToString(); } } }
public void playBetUnder(ticket o, string money, string IsLive, string phieuchung, string group) { o = GetKeoSbo(lstSboLiveBet, o); if (o != null) { int usdbet = int.Parse(money) / int.Parse(usd); double hdp = o.hdp; string keoid = o.keoid; double odd = o.odd; string bettype = o.bettype; string choose = o.choose; string hdpType = ""; if (bettype == "7" || bettype == "9") { hdpType = "2"; } string UrlTicketSbo = "http://" + Util.GetSubstringByString(welcomeLink, "http://", "&").Replace("default", "ticket/ticket") + "&id=" + keoid + "&op=" + choose + "&odds=" + odd + "&hdpType=" + hdpType + "&isor=-1&isLive=" + IsLive + "&betpage=18&style=1"; string UrlBetSbo = "http://" + Util.GetSubstringByString(welcomeLink, "http://", "&").Replace("default", "ticket/confirm") + "&sameticket=0&betcount=" + betcount + "&stake=" + usdbet.ToString() + "&ostyle=1&stakeInAuto=10&betpage=18&acceptIfAny=1&autoProcess=0&autoRefresh=1&oid=" + keoid + "&timeDiff=2100"; string data1 = http.Fetch(UrlTicketSbo, HttpHelper.HttpMethod.Get, welcomeLink, null, ip, mainLink.Replace("http://", "")); string oddbet = Util.GetSubstringByString(data1.Replace("'", "").Replace("Over", "h").Replace("Under", "a").Replace("Tài", "h").Replace("Xỉu", "a"), "," + choose + ",", ","); string ProcessBet = http.Fetch(UrlBetSbo, HttpHelper.HttpMethod.Get, welcomeLink, null, ip); if (ProcessBet.IndexOf("onOrderSubmitted") == -1) { this.phieuchung = ""; message = "SBO: [" + username + "] BET FAILED - INFO: " + o.ToString(); } else { db.doInsertTicket("SBOBET", username, o.bettype, o.hdp.ToString(), o.home, o.away, choose, oddbet, money, usd, "DX", phieuchung); this.phieuchung = phieuchung; message = "SBO: [" + username + "] BET SUCCESS - INFO: " + o.ToString(); betcount++; } } }