Ejemplo n.º 1
0
 public async Task<bool> SaveGame(Game Game)
 {
     try
     {
         SaveItem(Game);
         return true;
     }
     catch (Exception e)
     {
         await ExceptionHandler.instance.PostException(new AppException(e, (int)ClientIDHandler.AppName._30Seconds));
         return false;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the game to the database. Also saves child items such as teams and players
        /// </summary>
        /// <param name="game"></param>
        /// <returns></returns>
        public bool AddNewGame(Game game)
        {
            try
            {
                InsertItem(game);
                Games.Add(game);

                TeamHandler.instance.SaveTeams(game.Teams.ToList());

                return true;
            }
            catch (Exception e)
            {
                Task ExceptionTask = Task.Run(() => ExceptionHandler.instance.PostException(new AppException(e, (int)BaseLogic.ClientIDHandler.ClientIDHandler.AppName._30Seconds)));
                return false;
            }
        }
Ejemplo n.º 3
0
 public List<Team> GetTeamsByGame(Game Game)
 {
     return Teams.Where(t => t.GameID == Game.InternalID).OrderBy(t => t.Name).ToList();
 }