public HistoryFacade(PokerBetContext context) { this.context = context; }
private void SetPossiblePrizesList(int i,string[] winners,ref double[] prizes) { using (var context = new PokerBetContext()) { foreach (string winner in winners) { short numberOfPlayers = GetNumberOfPlayers(Convert.ToInt16(i + 1)); switch (winner) { case "1": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize1; break; case "2": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize2; break; case "3": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize3; break; case "4": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize4; break; case "5": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize5; break; case "6": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize6; break; case "7": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize7; break; case "8": prizes[i] += context.RiverFinder.FirstOrDefault(p => p.NumberOfPlayers == numberOfPlayers).Prize8; break; } } } }
public void ClearRiverFinder() { using (var context = new PokerBetContext()) { foreach (var row in context.RiverFinder) { row.Prize1 = 0; row.Prize2 = 0; row.Prize3 = 0; row.Prize4 = 0; row.Prize5 = 0; row.Prize6 = 0; row.Prize7 = 0; row.Prize8 = 0; } context.SaveChanges(); } }
public PokerBetFacade(PokerBetContext context) { this.ctx = context; }
public AdminFacade(PokerBetContext context) { this.context = context; }