示例#1
0
 public HistoryFacade(PokerBetContext context)
 {
     this.context = context;
 }
示例#2
0
 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;
             }
         }
     }
 }
示例#3
0
 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();
     }
 }
示例#4
0
 public PokerBetFacade(PokerBetContext context)
 {
     this.ctx = context;
 }
示例#5
0
 public AdminFacade(PokerBetContext context)
 {
     this.context = context;
 }