public static Hashtable GetHashTableIdMark(List <objMatch> Odd_SboList, List <objMatch> Odd_IbetList, bool live) { Hashtable Output = new Hashtable(); foreach (objMatch Odd_Sbo in Odd_SboList) { foreach (objMatch Odd_Ibet in Odd_IbetList) { if (live) { } else { if (Convert.ToDateTime(Odd_Sbo.TimeNonLive) < Convert.ToDateTime(Odd_Ibet.TimeNonLive)) { continue; } } if (UtilSoccer.ChuanTenLeauge_Sbo(Odd_Sbo.LeaugeName) == UtilSoccer.ChuanTenLeauge_Ibet(Odd_Ibet.LeaugeName)) { if (UtilSoccer.ChuanTenTeam_Sbo(Odd_Sbo.HomeName) == UtilSoccer.ChuanTenTeam_Ibet(Odd_Ibet.HomeName) && UtilSoccer.ChuanTenTeam_Sbo(Odd_Sbo.AwayName) == UtilSoccer.ChuanTenTeam_Ibet(Odd_Ibet.AwayName)) { if (UtilSoccer.formatkeo(Odd_Sbo.hdp) == UtilSoccer.formatkeo(Odd_Ibet.hdp) && Odd_Sbo.BetType == Odd_Ibet.BetType) { Output.Add(Odd_Sbo.IdKeo, Odd_Ibet.IdKeo); break; } } } } } return(Output); }
public List <objMatch> getMatchOddNonLive() { try { lst.Clear(); string DataOddSboNonLive = http.Fetch(mainLink + "/web-root/restricted/odds-display/today-data.aspx?od-param=2,1,1,1,2,2,2,2,3,1&fi=1&v=0&dl=3", HttpHelper.HttpMethod.Get, null, null); string leagueDataNonLive = "[" + Util.GetSubstringByString(DataOddSboNonLive, "[[[", "]],[[") + "]"; leagueDataNonLive = leagueDataNonLive.Replace("],[", "]\n["); string str_LeaugeSbo = "", str_TeamSbo = ""; if (str_LeaugeSbo == "") { hsLeagueNonLive.Clear(); foreach (string league in leagueDataNonLive.Split('\n')) { string leagueTemp = league.Replace("[", "").Replace("]", "").Replace("'", ""); string nameleagueTemp = UtilSoccer.ChuanTenLeauge_Sbo(leagueTemp.Split(',')[1]); if (nameleagueTemp.IndexOf("SPECIFIC") != -1 || nameleagueTemp.IndexOf("CORNERS") != -1 || nameleagueTemp.IndexOf("BOOKING") != -1 || nameleagueTemp.IndexOf("FANTASY MATCH") != -1 || nameleagueTemp.IndexOf("WHICH TEAM") != -1 || nameleagueTemp.IndexOf("TOTAL GOALS") != -1 || nameleagueTemp.IndexOf("INJURY") != -1 || nameleagueTemp.IndexOf("WINNER") != -1) { continue; //INJURY } hsLeagueNonLive.Add(leagueTemp.Split(',')[0], nameleagueTemp); if (str_LeaugeSbo.IndexOf(nameleagueTemp) == -1) { str_LeaugeSbo += nameleagueTemp + ","; } } } string matchDataNonLive = "[" + Util.GetSubstringByString(DataOddSboNonLive, "]],[[", "]],[[") + "]"; matchDataNonLive = matchDataNonLive.Replace("],[", "]\n["); hsMatchNonLive.Clear(); foreach (string matchNonLive in matchDataNonLive.Split('\n')) { string matchTempNonLive = matchNonLive.Replace("[", "").Replace("]", "").Replace("'", ""); string[] arr_matchTempNonLive = matchTempNonLive.Split(','); string idmatchNonLive = Util.GetSubstringByStringLast(DataOddSboNonLive, "[", "," + arr_matchTempNonLive[0]); try { hsMatchNonLive.Add(idmatchNonLive, hsLeagueNonLive[arr_matchTempNonLive[2]].ToString() + "," + arr_matchTempNonLive[3] + "," + arr_matchTempNonLive[4] + "," + arr_matchTempNonLive[7]); } catch { continue; } if (str_TeamSbo.IndexOf(UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[3])) == -1 || str_TeamSbo.IndexOf(UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[4])) == -1) { str_TeamSbo += UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[3]) + "-" + UtilSoccer.ChuanTenTeam_Sbo(arr_matchTempNonLive[4]) + ","; } } string oddDataNonLive = "[[" + Util.GetSubstringByString(DataOddSboNonLive, ",,[[", "]]],,") + "]]]"; foreach (string OddTempNonLive in oddDataNonLive.Split(new string[] { "]],[" }, StringSplitOptions.None)) { objMatch o = new objMatch(); string OddTemp = OddTempNonLive.Replace("[", "").Replace("]", "").Replace("'", ""); string[] arr_OddTemp = OddTemp.Split(','); string infomatch = ""; try { infomatch = hsMatchNonLive[arr_OddTemp[1]].ToString(); } catch { continue; } o.LeaugeName = infomatch.Split(',')[0]; o.HomeName = infomatch.Split(',')[1]; o.AwayName = infomatch.Split(',')[2]; o.TimeNonLive = infomatch.Split(',')[3]; if (o.TimeNonLive.Split('/').Length == 1) { o.TimeNonLive = o.TimeLive; } o.IdKeo = arr_OddTemp[0]; o.Keo = arr_OddTemp[5]; o.BetType = arr_OddTemp[2]; o.Odd1 = arr_OddTemp[6]; o.Odd2 = arr_OddTemp[7]; lst.Add(o); } } catch (Exception) { lst.Clear(); return(lst); } return(lst); }
public List <objMatch> getMatchOddLive() { try { lstLive.Clear(); string DataOddSboLive = http.Fetch(mainLink + "/web-root/restricted/odds-display/today-data.aspx?od-param=2,1,1,1,2,2,2,2,3,1&fi=0&v=0&dl=3", HttpHelper.HttpMethod.Get, null, null); DataOddSboLive = DataOddSboLive.Replace("\\u200C", ""); string leagueDataLive = "[" + Util.GetSubstringByString(DataOddSboLive, "[[[", "]],[[") + "]"; leagueDataLive = leagueDataLive.Replace("],[", "]\n["); hsLeagueLive.Clear(); foreach (string league in leagueDataLive.Split('\n')) { string leagueTemp = league.Replace("[", "").Replace("]", "").Replace("'", ""); string nameleagueTemp = UtilSoccer.ChuanTenLeauge_Sbo(leagueTemp.Split(',')[1]); if (nameleagueTemp.IndexOf("SPECIFIC") != -1 || nameleagueTemp.IndexOf("CORNERS") != -1 || nameleagueTemp.IndexOf("BOOKING") != -1 || nameleagueTemp.IndexOf("FANTASY MATCH") != -1 || nameleagueTemp.IndexOf("WHICH TEAM") != -1 || nameleagueTemp.IndexOf("TOTAL GOALS") != -1 || nameleagueTemp.IndexOf("INJURY") != -1 || nameleagueTemp.IndexOf("WINNER") != -1) { continue; } hsLeagueLive.Add(leagueTemp.Split(',')[0], nameleagueTemp); } string matchDataLive = "[" + Util.GetSubstringByString(DataOddSboLive, "]],[[", "]],[[") + "]"; matchDataLive = matchDataLive.Replace("],[", "]\n["); hsMatchLive.Clear(); foreach (string matchLive in matchDataLive.Split('\n')) { string matchTempLive = matchLive.Replace("[", "").Replace("]", "").Replace("'", ""); string[] arr_matchTempLive = matchTempLive.Split(','); string idmatchLive = Util.GetSubstringByStringLast(DataOddSboLive, "[", "," + arr_matchTempLive[0]); try { hsMatchLive.Add(idmatchLive, hsLeagueLive[arr_matchTempLive[2]].ToString() + "," + arr_matchTempLive[3] + "," + arr_matchTempLive[4] + "," + arr_matchTempLive[7]); } catch { continue; } } string oddDataLive = "[[" + Util.GetSubstringByString(DataOddSboLive, ",,[[", "]]],,") + "]]]"; foreach (string OddTempLive in oddDataLive.Split(new string[] { "]],[" }, StringSplitOptions.None)) { objMatch OddLive = new objMatch(); string OddTemp = OddTempLive.Replace("[", "").Replace("]", "").Replace("'", ""); string[] arr_OddTemp = OddTemp.Split(','); string infomatch = ""; try { infomatch = hsMatchLive[arr_OddTemp[1]].ToString(); } catch { continue; } OddLive.LeaugeName = UtilSoccer.ChuanTenLeauge_Sbo(infomatch.Split(',')[0]); OddLive.HomeName = UtilSoccer.ChuanTenTeam_Sbo(infomatch.Split(',')[1]); OddLive.AwayName = UtilSoccer.ChuanTenTeam_Sbo(infomatch.Split(',')[2]); OddLive.TimeLive = infomatch.Split(',')[3]; OddLive.IdKeo = arr_OddTemp[0]; OddLive.hdp = UtilSoccer.formatkeo(arr_OddTemp[5]); OddLive.BetType = arr_OddTemp[2]; OddLive.Odd1 = arr_OddTemp[6]; OddLive.Odd2 = arr_OddTemp[7]; lstLive.Add(OddLive); } } catch { lstLive.Clear(); return(lstLive); } return(lstLive); }