public NFLBet IsBettable(NFLGame game) { NFLBet bet = null; string revengeTeam = ""; string revengeGame = ""; TimeSpan aSpan = new TimeSpan(730, 0, 0, 0); DataSet ds = tflWS.GetGamesBetween(game.HomeTeam, game.AwayTeam, DateTime.Now.Subtract(aSpan)); DataTable dt = ds.Tables["SCHED"]; dt.DefaultView.Sort = "GAMEDATE ASC"; foreach (DataRow dr in dt.Rows) { if (dr.RowState != DataRowState.Deleted) { NFLGame aGame = new NFLGame(dr); if (aGame.WasRout()) { revengeTeam = (aGame.HomeWin()) ? aGame.AwayTeam : aGame.HomeTeam; revengeGame = aGame.ScoreOut(revengeTeam) + " " + aGame.GameCodeOut(); } } } if (revengeTeam.Length > 0) { bet = new NFLBet(revengeTeam, game, Name + " - " + revengeGame, ConfidenceLevel()); } return(bet); }
public TipResult CheckResult() { var game = new NFLGame(Utility.GameKey(Season, Week, GameCode)); if (game.Played()) { Result = HomeWinTipped() ? (game.HomeWin() ? TipResult.Correct : TipResult.Incorrect) : (game.AwayWin() ? TipResult.Correct : TipResult.Incorrect); } else { Result = TipResult.None; } return(Result); }