Esempio n. 1
0
 public DashboardGameView(Game g)
 {
     GameId = g.GameId.Substring(0,8);
     GameLink = "monitor?g=" + g.GameId;
     GameName = g.Settings.Name;
     Created = g.Settings.TimeCreated.ToString("yyMMdd hh:mm:ss");
     StageId = g.State.StageId;
     IsSetup = g.State.IsSetup;
     IsRecruited = g.State.IsRecruited;
     IsStarted = g.State.IsStarted;
     IsStepReady = g.State.IsStepReady;
     IsFinished = g.State.IsStepReady;
     Status = "IsInit";
     if (IsSetup) Status = "IsSetup";
     if (IsRecruited) Status = "IsRecruited";
     if (IsStepReady) Status = "IsStepReady";
     if (IsFinished) Status = "IsFinished";
 }
Esempio n. 2
0
        public void RemoveGameData(Game game)
        {
            foreach (var c in game.Codes.ToList())
            {
                db.Codes.Remove(c);
            }

            foreach (var p in game.Players.ToList())
            {
                db.Players.Remove(p);
            }

            foreach (var r in game.Store.ToList())
            {
                db.Store.Remove(r);
            }

            foreach (var s in game.Stages.ToList())
            {
                db.Stages.Remove(s);
            }

            foreach (var v in game.Views.ToList())
            {
                db.Views.Remove(v);
            }

            db.Settings.Remove(game.Settings);
            db.Games.Remove(game);

            CommitChanges();
        }
Esempio n. 3
0
 public void Remove(Game game)
 {
     db.Games.Remove(game);
     db.SaveChanges();
 }
Esempio n. 4
0
 public void Add(Game game)
 {
     db.Games.Add(game);
     db.SaveChanges();
 }