Ejemplo n.º 1
0
        public GameModel getGame(GameModel partialGame)
        {
            ActiveGameDataService GameDS = new ActiveGameDataService();
            //GameModel game = new JavaScriptSerializer().Deserialize<GameModel>(GameDS.Read(partialGame.Id));
            GameModel game = JsonConvert.DeserializeObject <GameModel>(GameDS.Read(partialGame.Id));

            return(game);
        }
Ejemplo n.º 2
0
        public bool ResetActiveGame(int id)
        {
            ActiveGameDataService gameDS = new ActiveGameDataService();

            UserModel user = getUser(id);

            gameDS.Delete(user.ActiveGameId);
            user.ActiveGameId = -1;
            return(UpdateUser(user));
        }
Ejemplo n.º 3
0
        public int saveGame(GameModel game)
        {
            ActiveGameDataService GameDS = new ActiveGameDataService();

            if (GameDS.Read(game.Id) != null)
            {
                GameDS.Delete(game.Id);
            }

            //return GameDS.Create(new JavaScriptSerializer().Serialize(game));
            return(GameDS.Create(JsonConvert.SerializeObject(game)));
        }