Ejemplo n.º 1
0
        private void GridEX_RowDoubleClick(object sender, RowActionEventArgs e)
        {
            var game = e.Row.DataRow as Game;

            using (var form = new GameEditForm(game, DbContext))
            {
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    GameService.UpdateGame(game);
                    GridEX.Refetch();
                }
            }
        }
Ejemplo n.º 2
0
        private void diagram_ElementDoubleClick(object sender, EventArgs e)
        {
            var s = sender as Shape;

            if (s == null)
            {
                return;
            }
            var game = s.Tag as Game;

            if (game == null)
            {
                return;
            }

            using (var form = new GameEditForm(game, DbContext))
            {
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    GameService.UpdateGame(game);

                    foreach (var prevGames in DbContext.GameSet.Where(f => f.CompetitionId == game.CompetitionId && (int)f.Stage.Type <= (int)game.Stage.Type).OrderByDescending(f => (int)f.Stage.Type))
                    {
                        GameService.UpdateGame(game);
                    }


                    //if (game.ParentGame1 != null)
                    //{
                    //    GameService.UpdateGame(game.ParentGame1);
                    //}

                    //if (game.ParentGame2 != null)
                    //{
                    //    GameService.UpdateGame(game.ParentGame2);
                    //}


                    UpdateDiagram();
                    diagram.Refresh();
                }
            }
        }