Esempio n. 1
0
        public void UpdateHitLocation(HitLocation updatedHitLocation)
        {
            HitLocation originalHitLocation = (from h in _repo.Query <HitLocation>()
                                               where h.Id == updatedHitLocation.Id
                                               select h).FirstOrDefault();

            originalHitLocation.X       = updatedHitLocation.X;
            originalHitLocation.Y       = updatedHitLocation.Y;
            originalHitLocation.Z       = updatedHitLocation.Z;
            originalHitLocation.Volley  = updatedHitLocation.Volley;
            originalHitLocation.Game.Id = updatedHitLocation.Game.Id;

            _repo.SaveChanges();
        }
Esempio n. 2
0
        public void UpdateGame(Game updatedGame)
        {
            Game originalGame = (from g in _repo.Query <Game>()
                                 where g.Id == updatedGame.Id
                                 select g).FirstOrDefault();

            originalGame.Player1           = updatedGame.Player1;
            originalGame.Player2           = updatedGame.Player2;
            originalGame.Player1Score      = updatedGame.Player1Score;
            originalGame.Player2Score      = updatedGame.Player2Score;
            originalGame.MaxVelocity       = updatedGame.MaxVelocity;
            originalGame.LongestVolleyTime = updatedGame.LongestVolleyTime;
            originalGame.LongestVolleyHits = updatedGame.LongestVolleyHits;

            _repo.SaveChanges();
        }
Esempio n. 3
0
        public void UpdatePlayer(Player updatedPlayer)
        {
            Player originalPlayer = (from p in _repo.Query <Player>()
                                     where p.Id == updatedPlayer.Id
                                     select p).FirstOrDefault();

            originalPlayer.UserName       = updatedPlayer.UserName;
            originalPlayer.PlayerName     = updatedPlayer.PlayerName;
            originalPlayer.HeightFt       = updatedPlayer.HeightFt;
            originalPlayer.HeightInch     = updatedPlayer.HeightInch;
            originalPlayer.Nationality    = updatedPlayer.Nationality;
            originalPlayer.HandPreference = updatedPlayer.HandPreference;
            originalPlayer.IsSelected     = updatedPlayer.IsSelected;
            originalPlayer.Wins           = updatedPlayer.Wins;
            originalPlayer.Losses         = updatedPlayer.Losses;

            _repo.SaveChanges();
        }