public IndexPageModule(ITournament tournament, ISubmittedBets bets, IResults actual) { Get["/"] = _ => { return(View["frontpage.sshtml", new IndexPageViewModel(tournament, bets, actual)]); }; }
public IndexPageViewModel(ITournament t, ISubmittedBets sb, IResults actual) { _tournament = t; CreateGroups(); CreateBetterlist(sb.GetBetters(), sb, actual); MarkWinnerIfFinished(actual); TimeStamp = actual.GetTimeStamp(); }
public IndexPageViewModel(ITournament t, ISubmittedBets sb, IResultCollection rc) { _tournament = t; CreateGroups(); CreateBetterlist(sb.GetBetters(), sb, rc); EvaluateTrends(); MarkWinnerIfFinished(rc.Current); TimeStamp = rc.Current.GetTimeStamp(); }
public BetterPageModule(ITournament tournament, ISubmittedBets bets, IResultCollection rc) { Get["/{better}"] = _ => { // disable once ConvertToLambdaExpression return(View["betterpage.sshtml", new BetterPageViewModel(tournament, bets.GetSingleBet(_.better), rc.Current)]); }; }
void CreateBetterlist(List <string> betters, ISubmittedBets sb, IResults actual) { foreach (var better in betters) { var score = new ScoringSystem(sb.GetSingleBet(better), actual); var bet = new Better() { Name = better, Score = score.GetTotal() }; var achievements = new AchievementSystem(sb.GetSingleBet(better), actual); bet.Achievements = achievements.Achievements; bet.RowClass = "normal"; Betters.Add(bet); } }
void CreateBetterlist(List <string> betters, ISubmittedBets sb, IResultCollection rc) { foreach (var better in betters) { var score = new ScoringSystem(sb.GetSingleBet(better), rc.Current); var oldscore = new ScoringSystem(sb.GetSingleBet(better), rc.Previous); var bet = new Better() { Name = better, Score = score.GetTotal(), OldScore = oldscore.GetTotal() }; var achievements = new AchievementSystem(sb.GetSingleBet(better), rc.Current); bet.Achievements = achievements.Achievements; bet.RowClass = "normal"; Betters.Add(bet); } }