Exemplo n.º 1
0
        public ViewResult Subtract4p(int id, string s, string anchorId)
        {
            AlwaysUpdate();
            var mute      = MutedSound;
            var changable = Changable;

            ViewData["PlaySound"] = true;
            ViewData["Sound"]     = "boo";

            FourPlayer score = _entities.FourPlayers.Where(p => p.ID == id).FirstOrDefault();

            if (s == "1")
            {
                score.Score1 = score.Score1 - 1;
            }
            else if (s == "2")
            {
                score.Score2 = score.Score2 - 1;
            }

            _entities.SaveChanges();

            ViewData["AnchorID"] = anchorId;
            return(View("Index", Tuple.Create(_entities.TwoPlayers.ToList(), _entities.FourPlayers.ToList(), _entities.Players.ToList())));
        }
Exemplo n.º 2
0
        public ViewResult Delete4p(int id, string anchorId)
        {
            AlwaysUpdate();
            var mute      = MutedSound;
            var changable = Changable;

            FourPlayer score = _entities.FourPlayers.Where(p => p.ID == id).FirstOrDefault();

            try
            {
                _entities.FourPlayers.Remove(score);
            }
            catch { }

            _entities.SaveChanges();

            ViewData["AnchorID"] = anchorId;
            return(View("Index", Tuple.Create(_entities.TwoPlayers.ToList(), _entities.FourPlayers.ToList(), _entities.Players.ToList())));
        }