Esempio n. 1
0
        private void finishedGame()
        {
            using (var db = new Memory_Game.MemoryContextContainer1())
            {
                string CompiledLstCoords = "";

                foreach (var item in lstPlayed)
                {
                    CompiledLstCoords += ("," + item);
                }

                Jouer jouer = new Jouer()
                {
                    listeCombine = CompiledLstCoords,
                    Partie       = new Partie()
                    {
                        dateHeurePartie = gameInfo.DateGameStart.ToString()
                    },
                    Utilisateur = new Utilisateur()
                    {
                        nomUser    = gameInfo.PlyerLastName,
                        prenomUser = gameInfo.PlayerFirstName
                    },
                    Etat = new Etat()
                    {
                        nomEtat = gameInfo.Theme
                    }
                };

                db.Jouers.Add(jouer);

                db.SaveChanges();
            }
        }
        private void finishedGame()
        {
            using (var db = new Memory_Game.MemoryContextContainer1())
            {
                string CompiledLstCoords = "";

                foreach (var item in lstPlayed)
                {
                    CompiledLstCoords += ("," + item);
                }

                Jouer jouer = new Jouer()
                {
                    listeCombine = CompiledLstCoords,
                    Partie = new Partie() { dateHeurePartie = gameInfo.DateGameStart.ToString() },
                    Utilisateur = new Utilisateur()
                    {
                        nomUser = gameInfo.PlyerLastName,
                        prenomUser = gameInfo.PlayerFirstName
                    },
                    Etat = new Etat() { nomEtat = gameInfo.Theme }
                };

                db.Jouers.Add(jouer);

                db.SaveChanges();
            }
        }