Пример #1
0
 partial void DeletePlayerHistory(PlayerHistory instance);
Пример #2
0
 partial void InsertPlayerHistory(PlayerHistory instance);
Пример #3
0
 partial void UpdatePlayerHistory(PlayerHistory instance);
Пример #4
0
 partial void DeletePlayerHistory(PlayerHistory instance);
Пример #5
0
 partial void UpdatePlayerHistory(PlayerHistory instance);
Пример #6
0
 partial void InsertPlayerHistory(PlayerHistory instance);
Пример #7
0
        private void updateHistory()
        {

            DatabaseDataContext db = new DatabaseDataContext(Properties.Settings.Default.Tfour_ConnectionString);


            // save player one information in the database


            PlayerHistory newPH = new PlayerHistory();

            newPH.PlayerOne = gamePlayers[0].getPlayerID();
            newPH.PlayerOneScore = gamePlayers[0].getScore();
            newPH.Opponet = gamePlayers[1].getPlayerID();
            newPH.OpponetScore = gamePlayers[1].getScore();
            newPH.GameDate = DateTime.Now;

            if (gamePlayers[0].isWinner())
            {
                newPH.Winner = gamePlayers[0].getPlayerID();

            }
            else if (gamePlayers[1].isWinner())
            {
                newPH.Winner = gamePlayers[1].getPlayerID();
            }
            else
            {
                newPH.Winner = "Draw";
            }


            db.PlayerHistories.InsertOnSubmit(newPH);

            db.SubmitChanges();



            // save player two ddinformation in the database
            PlayerHistory newPH2 = new PlayerHistory();

            newPH2.PlayerOne = gamePlayers[1].getPlayerID();
            newPH2.PlayerOneScore = gamePlayers[1].getScore();
            newPH2.Opponet = gamePlayers[0].getPlayerID();
            newPH2.OpponetScore = gamePlayers[0].getScore();
            newPH2.GameDate = DateTime.Now;

            if (gamePlayers[1].isWinner())
            {
                newPH2.Winner = gamePlayers[1].getPlayerID();

            }
            else if (gamePlayers[0].isWinner())
            {
                newPH2.Winner = gamePlayers[0].getPlayerID();
            }
            else
            {
                newPH2.Winner = "Draw";
            }


            db.PlayerHistories.InsertOnSubmit(newPH2);

            db.SubmitChanges();




        }
Пример #8
0
        private void updateHistory()
        {
            DatabaseDataContext db = new DatabaseDataContext(Properties.Settings.Default.Tfour_ConnectionString);


            // save player one information in the database


            PlayerHistory newPH = new PlayerHistory();

            newPH.PlayerOne      = gamePlayers[0].getPlayerID();
            newPH.PlayerOneScore = gamePlayers[0].getScore();
            newPH.Opponet        = gamePlayers[1].getPlayerID();
            newPH.OpponetScore   = gamePlayers[1].getScore();
            newPH.GameDate       = DateTime.Now;

            if (gamePlayers[0].isWinner())
            {
                newPH.Winner = gamePlayers[0].getPlayerID();
            }
            else if (gamePlayers[1].isWinner())
            {
                newPH.Winner = gamePlayers[1].getPlayerID();
            }
            else
            {
                newPH.Winner = "Draw";
            }


            db.PlayerHistories.InsertOnSubmit(newPH);

            db.SubmitChanges();



            // save player two ddinformation in the database
            PlayerHistory newPH2 = new PlayerHistory();

            newPH2.PlayerOne      = gamePlayers[1].getPlayerID();
            newPH2.PlayerOneScore = gamePlayers[1].getScore();
            newPH2.Opponet        = gamePlayers[0].getPlayerID();
            newPH2.OpponetScore   = gamePlayers[0].getScore();
            newPH2.GameDate       = DateTime.Now;

            if (gamePlayers[1].isWinner())
            {
                newPH2.Winner = gamePlayers[1].getPlayerID();
            }
            else if (gamePlayers[0].isWinner())
            {
                newPH2.Winner = gamePlayers[0].getPlayerID();
            }
            else
            {
                newPH2.Winner = "Draw";
            }


            db.PlayerHistories.InsertOnSubmit(newPH2);

            db.SubmitChanges();
        }