Esempio n. 1
0
 public void cancelGame(game g)
 {
     using (var db = new bowlingEntities())
     {
         try
         {
             game game = db.games.Find(g.Id);
             game.State = "canceled";
             db.SaveChanges();
         }
         catch (Exception e)
         {
             throw new Exception("Error", e);
         }
     }
 }
Esempio n. 2
0
 public void addPlayer(game g, player p)
 {
     using (var db = new bowlingEntities())
     {
         try
         {
             game game = db.games.Find(g.Id);
             game.players.Add(p);
             db.SaveChanges();
         }
         catch (Exception e)
         {
             throw new Exception("Error", e);
         }
     }
 }
Esempio n. 3
0
        public game createGame()
        {
            bowlingEntities db = new bowlingEntities();
            game g = new game();
            g.State = "pending";
            try
            {
                db.games.Add(g);
                db.SaveChanges();

            }
            catch (Exception e)
            {
                throw new Exception("Error", e);
            }

            return g;
        }
Esempio n. 4
0
        public game createGame()
        {
            using (var db = new bowlingEntities())
            {
                db.players.Attach(this);
                db.Entry(this).State = EntityState.Modified;

                game game = new game();
                game.players.Add(this);

                try
                {
                    db.games.Add(game);
                    db.SaveChanges();
                }
                catch (Exception e)
                {
                    throw new Exception("Error", e);
                }

                return game;
            }
        }
Esempio n. 5
0
 public void startGame(staff s, game g)
 {
     s.startGame(g);
 }
Esempio n. 6
0
 public void removePlayer(staff s, game g, player p)
 {
     s.removePlayer(g, p);
 }
Esempio n. 7
0
 public void cancelGame(staff s, game g)
 {
     s.cancelGame(g);
 }
Esempio n. 8
0
 public void addPlayer(staff s, game g, player p)
 {
     s.addPlayer(g, p);
 }
Esempio n. 9
0
 public void assignToLane(game g)
 {
     g.assignToLane();
 }