/// <summary> /// 获取玩家下注信息 /// </summary> /// <param name="matchResult"></param> /// <returns></returns> public static List<PlayerBet> GetPlayerBetsByMatchId(MatchResult matchResult) { List<PlayerBet> playerBets = null; try { // 创建下注数据访问对象 BetService betService = new BetService(); playerBets = betService.GetPlayerBetsByMatchId(matchResult.get_HomeName(), matchResult.get_AwayName(), matchResult.get_MatchDate()); /***if (string.IsNullOrEmpty(matchResult.get_ID())) { playerBets = betService.GetPlayerBetsByMatchId(matchResult.get_HomeName(), matchResult.get_AwayName(), matchResult.get_MatchDate()); } else { playerBets = betService.GetPlayerBetsByMatchId(matchResult.get_ID()); }***/ } catch (Exception e) { throw; } return playerBets; }
/// <summary> /// 获取ghost未结算的下注信息 /// </summary> /// <param name="matchResult"></param> /// <returns></returns> public static List<GhostBet> GetGhostBetsByMatchId(MatchResult matchResult) { List<GhostBet> ghostBets = null; try { // 创建下注数据访问对象 BetService betService = new BetService(); ghostBets = betService.GetGhostBetsByMatchId(matchResult.get_HomeName(), matchResult.get_AwayName(), matchResult.get_MatchDate()); } catch (Exception e) { throw; } return ghostBets; }
public List<MatchResult> GenerateMatchResultListFromText(string text1) { List<MatchResult> list3 = new List<MatchResult>(); int num = 0; string item = ""; List<string> list2 = new List<string>(); string current = ""; try { num = 0; while (num > -1) { item = CommonFunction.substring(text1, num, "<tr class='normal", "</table>", ref num).Trim(); list2.Add(item); } List<string>.Enumerator enumerator = list2.GetEnumerator(); try { //enumerator; while (enumerator.MoveNext()) { current = enumerator.Current; MatchResult result = new MatchResult(); num = 0; int num2 = 0; result.set_HomeName(CommonFunction.substring(current, 0, "'ft'>", "</", ref num2).Trim()); num2 = 0; result.set_AwayName(CommonFunction.substring(current, 0, "'nft'>", "</", ref num2).Trim()); if ((result.get_HomeName() != string.Empty) & (result.get_AwayName() != string.Empty)) { num2 = 0; item = CommonFunction.substring(current, 0, "1st Half", "left'>", "<", ref num2).Trim(); List<string> list4 = CommonFunction.SeperateStringBySymbol2(item, "-"); if ((list4.Count == 2) & (item.Length >= 3)) { result.set_IsHalfTimeFinished(true); result.set_HalfHomeScore((int) Math.Round(Conversion.Val(list4[0].Trim()))); result.set_HalfAwayScore((int) Math.Round(Conversion.Val(list4[1].Trim()))); } num2 = 0; item = CommonFunction.substring(current, 0, "Full Time", "left'>", "<", ref num2).Trim(); list4 = CommonFunction.SeperateStringBySymbol2(item, "-"); if ((list4.Count == 2) & (item.Length >= 3)) { result.set_IsFullTimeFinished(true); result.set_FTHomeScore((int) Math.Round(Conversion.Val(list4[0].Trim()))); result.set_FTAwayScore((int) Math.Round(Conversion.Val(list4[1].Trim()))); } list3.Add(result); } } return list3; } finally { enumerator.Dispose(); } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; list3 = new List<MatchResult>(); ProjectData.ClearProjectError(); } return list3; }
/// <summary> /// 获取足球赛事结果 /// </summary> /// <param name="list3"></param> private void GetSoccerMatchResult(List<MatchResult> list3, string text1) { try { int num = 0; string item = ""; List<string> list2 = new List<string>(); string current = ""; num = 0; while (num > -1) { item = CommonFunction.substring(text1, num, "<tr class", "</tr", ref num).Trim(); list2.Add(item); } List<string>.Enumerator enumerator = list2.GetEnumerator(); try { //enumerator; while (enumerator.MoveNext()) { current = enumerator.Current; num = 0; MatchResult result = new MatchResult(); int mum3 = 0; item = CommonFunction.substring(current, num, "text_time", ">", "</td>", ref mum3).Trim(); result.set_MatchDate(item); List<string> list5 = CommonFunction.SeperateStringBySymbol2(CommonFunction.substring(current, num, "text_time", "<td>", "</td>", ref num).Trim(), "-vs-"); if (list5.Count == 2) { int num2; result.set_HomeName(list5[0].Replace("<b>", "").Replace("</b>", "").Trim()); if (result.get_HomeName().Contains("<img ")) { num2 = 0; result.set_HomeName(CommonFunction.substring("@" + result.get_HomeName(), 0, "@", "<img ", ref num2).Trim()); } result.set_AwayName(list5[1].Replace("<b>", "").Replace("</b>", "").Trim()); if (result.get_AwayName().Contains("<img ")) { num2 = 0; result.set_AwayName(CommonFunction.substring("@" + result.get_AwayName(), 0, "@", "<img ", ref num2).Trim()); } item = CommonFunction.substring(current, num, "<td", ">", "<", ref num).Trim(); List<string> list4 = CommonFunction.SeperateStringBySymbol2(item, "-"); if ((list4.Count == 2) & (item.Length >= 3)) { result.set_IsHalfTimeFinished(true); result.set_HalfHomeScore((int)Math.Round(Conversion.Val(list4[0]))); result.set_HalfAwayScore((int)Math.Round(Conversion.Val(list4[1]))); } item = CommonFunction.substring(current, num, "<td", ">", "<", ref num).Trim(); list4 = CommonFunction.SeperateStringBySymbol2(item, "-"); if ((list4.Count == 2) & (item.Length >= 3)) { result.set_IsFullTimeFinished(true); result.set_FTHomeScore((int)Math.Round(Conversion.Val(list4[0]))); result.set_FTAwayScore((int)Math.Round(Conversion.Val(list4[1]))); } // 状态 item = CommonFunction.substring(current, num, "<td", ">", "<", ref num).Trim(); result.setMatchStatus(item); if (item == "Completed") { list3.Add(result); } } } } finally { enumerator.Dispose(); } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; list3 = new List<MatchResult>(); ProjectData.ClearProjectError(); } }