示例#1
0
 protected void getGameData()
 {
     using (GameContext db = new GameContext())
     {
         var gameData = (from eachGame in db.GameTables select eachGame);
         GameGridView.DataSource = gameData.ToList();
         GameGridView.DataBind();
     }
 }
        protected void ConnectionToDB()
        {
            using (VJKMConnection db = new VJKMConnection())
            {
                var gameEdit = (from allgames in db.Games
                                select allgames);

                // bind the result to the GridView
                GameGridView.DataSource = gameEdit.AsQueryable().ToList();
                GameGridView.DataBind();
            }
        }
示例#3
0
    private void getGame()
    {
        List <SqlParameter> spParams = new List <SqlParameter>();

        spParams.Add(new SqlParameter("@gameName", searchText.Value));
        spParams.Add(new SqlParameter("@stdName", searchText.Value));
        DataSet ds = new DataSet();

        ds = DBHelper.ExecuteBySPName("GameReportSearch", spParams.ToArray());
        GameGridView.DataSource = ds.Tables[0];
        GameGridView.DataBind();
    }
示例#4
0
        /**
         * <summary>
         * This method gets the games data from the DB
         * </summary>
         *
         * @method Getgame1
         * @returns {void}
         */
        protected void GetGames()
        {
            // connect to EF
            using (ProjectConnection db = new ProjectConnection())
            {
                // query the game Table using EF and LINQ
                var Games = (from allgames in db.MAIN_GAME
                             select allgames);

                // bind the result to the GridView
                GameGridView.DataSource = Games.AsQueryable().ToList();
                GameGridView.DataBind();
            }
        }
示例#5
0
        // This Method gets the games data from the database

        // @method Getguesttrack

        // @return (void)


        protected void GetGame()
        {
            //connect to the EF
            using (DefaultConnection db = new DefaultConnection())
            {
                //Query the game results
                var Games = (from allGames in db.Game
                             select allGames);



                GameGridView.DataSource = Games.ToList();
                GameGridView.DataBind();
            }
        }
示例#6
0
        protected void GetGame()
        {
            string sortString = Session["SortColumn"].ToString() + " " + Session["SortDirection"].ToString();

            // connect to EF
            using (GameDefaultConnection db = new GameDefaultConnection())
            {
                // query the Students Table using EF and LINQ
                var g1 = (from allGames in db.Games
                          select allGames);

                // bind the result to the GridView
                GameGridView.DataSource = g1.AsQueryable().OrderBy(sortString).ToList();
                GameGridView.DataBind();
            }
        }
示例#7
0
        public void InitGamesGrid()
        {
            if (cmboDatabaseFilePaths.Items != null)
            {
                if (cmboDatabaseFilePaths.Items.Count > 0)
                {
                    ToolStripComboBox toolStripcmbo    = toolStripFilePaths.Items["cmboDatabaseFilePaths"] as ToolStripComboBox;
                    ComboBox          cmboDBFilePaths  = toolStripcmbo.ComboBox as ComboBox;
                    string            databaseFileName = cmboDBFilePaths.SelectedValue.ToString();
                    this.Text = "Database  ( " + Path.GetFileName(databaseFileName) + " )";
                    if (databaseFileName != string.Empty)
                    {
                        if (!databaseFileName.EndsWith(Files.DatabaseExtension))
                        {
                            ShowInvalidFileFormatMessage();
                            return;
                        }
                        try
                        {
                            Ap.LoadDatabase(databaseFileName);
                        }
                        catch (Exception ex)
                        {
                            TestDebugger.Instance.WriteError(ex);
                            ShowInvalidFileFormatMessage();
                            return;
                        }

                        Ap.Options.CurrentDatabaseFilePath = databaseFileName;
                        Ap.Options.Save();

                        GameGridView.AutoGenerateColumns = false;

                        ProgressForm frm       = ProgressForm.Show(this, "Loading Database....");
                        DataTable    gameItems = Ap.Database.GameItems.GetGamesData();
                        DataBind(gameItems);
                        frm.Close();
                        GameGridView.Focus();
                    }
                }
            }
        }
示例#8
0
 private void GameGridView_Loaded(object sender, RoutedEventArgs e)
 {
     _gameScrollViewer              = GameGridView.GetScrollViewer();
     _gameScrollViewer.ViewChanged += GameScrollViewer_ViewChanged;
 }