public ActionResult BetList(int seasonId, int?bettingType, int?moneyType) { SeasonBets model = new SeasonBets(); //ListAccess la = new ListAccess(); //model.Bets = la.NBABets(seasonId); //model.TotalGroupBetNumbers(); model.VersionThree((AppStatic.Seasons)seasonId, AppStatic.BettingSetup.MoneyLine); //model.Bets = model.Bets.SelectMany(b => b.BetGames).OrderBy(g => g.GameDate).ToList(); //model.MoneyLineBetsQuitWin(); //if (bettingType != null) //{ // switch (bettingType) // { // case 1: // model.Bets.SpreadBetsAll(); // break; // case 2: // model.Bets.MoneyLineBetsAll(); // break; // } //} //model.Bets.MoneyLineBetsAll(); return(View("~/Views/Sports/NBA/BetList.cshtml", model)); }
public ActionResult ByDate(int seasonId, int?bettingType, int?moneyType) { List <ByDate> model = new List <ByDate>(); SeasonBets tempModel = new SeasonBets(); List <DateTime> betDates = new List <DateTime>(); tempModel.VersionThree((AppStatic.Seasons)seasonId, AppStatic.BettingSetup.MoneyLine); betDates = tempModel.Bets.SelectMany(b => b.BetGames).GroupBy(g => g.GameDate).OrderBy(g => g.Key).Select(g => g.Key).ToList(); foreach (DateTime gameDate in betDates) { ByDate day = new ByDate(); day.Date = gameDate; day.ACount = tempModel.Bets.Where(b => b.WinA && b.BetADate <= gameDate).Count(); day.BCount = tempModel.Bets.Where(b => b.WinB && b.BetBDate <= gameDate).Count(); day.CCount = tempModel.Bets.Where(b => b.WinC && b.BetCDate <= gameDate).Count(); day.DCount = tempModel.Bets.Where(b => b.WinD && b.BetDDate <= gameDate).Count(); day.Loss = tempModel.Bets.Where(b => b.Loss && b.LossDate <= gameDate).Count(); //day.TotalBets = tempModel.Bets.Where(b => b.Loss && b.BetDDate <= gameDate).Count(); model.Add(day); } return(View("~/Views/Sports/NBA/ByDate.cshtml", model)); }
public ActionResult GameDetail(int gameId) { GameDetails model = new GameDetails(); model.game = new Game(gameId); //ListAccess la = new ListAccess(); SeasonBets sBets = new SeasonBets(); sBets.VersionThree((AppStatic.Seasons)model.game.SeasonId, AppStatic.BettingSetup.MoneyLine); model.gameLinks = sBets.Bets.SelectMany(b => b.BetGames).Select(g => g.GameId).ToArray(); return(View("~/Views/Sports/NBA/GameDetail.cshtml", model)); }
public ActionResult Excel(int seasonId, int?bettingType, int?moneyType) { ExcelModel model = new ExcelModel(); model.BetList = new List <ExcelExport>(); SeasonBets tempModel = new SeasonBets(); //ListAccess la = new ListAccess(); //model.Bets = la.NBABets(seasonId); //model.TotalGroupBetNumbers(); tempModel.VersionThree((AppStatic.Seasons)seasonId, AppStatic.BettingSetup.MoneyLine); //List<ExcelExport> eeList = new List<ExcelExport>(); bool hasWon = false; //keeps track of amount of best after loss int indexLoss = 0; foreach (Bet bet in tempModel.Bets) { hasWon = false; foreach (Game game in bet.BetGames) { if (hasWon) { break; } ; ExcelExport ee = new ExcelExport(); ee.BetId = bet.BetId; ee.BetDate = game.GameDate; ee.AwayTeam = game.AwayTeamName; ee.HomeTeam = game.HomeTeamName; switch (bet.BetGames.IndexOf(game)) { case 0: ee.Current = "A"; break; case 1: ee.Current = "B"; break; case 2: ee.Current = "C"; break; case 3: ee.Current = "D"; break; case 4: ee.Current = "Loss"; break; default: ee.Current = "OVER"; break; } ee.RunningTotal = ee.RunningTotal - ee.BetAmount; if (bet.WinA) { ee.Winning = "A"; } if (bet.WinB) { ee.Winning = "B"; } if (bet.WinC) { ee.Winning = "C"; } if (bet.WinD) { ee.Winning = "D"; } if (!bet.WinA && !bet.WinB && !bet.WinC && !bet.WinD) { ee.Winning = "Loss"; } model.BetList.Add(ee); if (ee.Winning == ee.Current) { hasWon = true; } } } model.BankRoll(16, 2000, 275, 578, 1214, 2275); model.ACount = model.BetList.Where(b => b.Winning == "A" && b.Current == "A").Count(); model.BCount = model.BetList.Where(b => b.Winning == "B" && b.Current == "B").Count(); model.CCount = model.BetList.Where(b => b.Winning == "C" && b.Current == "C").Count(); model.DCount = model.BetList.Where(b => b.Winning == "D" && b.Current == "D").Count(); model.Loss = model.BetList.Where(b => b.Winning == "Loss" && b.Current == "Loss").Count(); model.TotalWins = model.ACount + model.BCount + model.CCount + model.DCount; model.TotalBets = model.BetList.Count(); // model.VersionThree((AppStatic.Seasons)seasonId, AppStatic.BettingSetup.MoneyLine); //model.Bets = model.Bets.SelectMany(b => b.BetGames).OrderBy(g => g.GameDate).ToList(); //model.MoneyLineBetsQuitWin(); //if (bettingType != null) //{ // switch (bettingType) // { // case 1: // model.Bets.SpreadBetsAll(); // break; // case 2: // model.Bets.MoneyLineBetsAll(); // break; // } //} //model.Bets.MoneyLineBetsAll(); return(View("~/Views/Sports/NBA/Excel.cshtml", model)); }