Exemplo n.º 1
0
        public static void Delete(int id, BBScoreboardEntities db = null)
        {
            if (id > 0)
            {
                db = db ?? new BBScoreboardEntities();

                var tstats = db.UCGameTeamStats.Where(i => i.TeamId == id);
                foreach (var ts in tstats)
                {
                    db.UCGameTeamStats.Remove(ts);
                }

                var players = db.UCPlayers.Where(i => i.TeamId == id);
                foreach (var player in players)
                {
                    PlayerHelper.Delete(player.Id, db);
                }

                var team = db.UCTeams.Find(id);
                if (team != null)
                {
                    db.UCTeams.Remove(team);
                }
            }
        }
Exemplo n.º 2
0
        public static void Delete(int id, BBScoreboardEntities db = null)
        {
            if (id > 0)
            {
                db = db ?? new BBScoreboardEntities();

                var actions = db.UCGameplayActions.Where(i => i.PlayerId == id);
                foreach (var action in actions)
                {
                    db.UCGameplayActions.Remove(action);
                }

                var pstats = db.UCGamePlayerStats.Where(i => i.PlayerId == id);
                foreach (var ps in pstats)
                {
                    db.UCGamePlayerStats.Remove(ps);
                }

                var player = db.UCPlayers.Find(id);
                if (player != null)
                {
                    db.UCPlayers.Remove(player);
                }
            }
        }
Exemplo n.º 3
0
        public static void Delete(int id, BBScoreboardEntities db = null)
        {
            if (id > 0)
            {
                db = db ?? new BBScoreboardEntities();

                var actions = db.UCGameplayActions.Where(i => i.GameId == id);
                foreach (var action in actions)
                {
                    db.UCGameplayActions.Remove(action);
                }

                var pstats = db.UCGamePlayerStats.Where(i => i.GameId == id);
                foreach (var ps in pstats)
                {
                    db.UCGamePlayerStats.Remove(ps);
                }

                var tstats = db.UCGameTeamStats.Where(i => i.GameId == id);
                foreach (var ts in tstats)
                {
                    db.UCGameTeamStats.Remove(ts);
                }

                var game = db.UCGames.Find(id);
                if (game != null)
                {
                    db.UCGames.Remove(game);
                }
            }
        }
Exemplo n.º 4
0
        public static GameplayModel Create(int gameId, BBScoreboardEntities db = null)
        {
            var item = new GameplayModel(db == null ? new BBScoreboardEntities() : db, gameId);

            item.Initialize();

            return(item);
        }
Exemplo n.º 5
0
        public static void Delete(int id, BBScoreboardEntities db = null)
        {
            if (id > 0)
            {
                db = db ?? new BBScoreboardEntities();

                var games = db.UCGames.Where(i => i.SeasonId == id);
                foreach (var game in games)
                {
                    GameHelper.Delete(game.Id, db);
                }

                var item = db.UCSeasons.Find(id);
                if (item != null)
                {
                    db.UCSeasons.Remove(item);
                }
            }
        }
Exemplo n.º 6
0
 public GameplayModel(BBScoreboardEntities db, int gameId)
 {
     Db         = db;
     GameId     = gameId;
     TeamModels = new List <TeamGameplayModel>();
 }