示例#1
0
        /**
         * <summary>
         * This method sorts out the games played by week
         * </summary>
         * @method leagueSort
         * @returns {VOID}
         * */

        protected void leagueSort(object sender, EventArgs e)
        {
            if (weekNumberSort.Text == null)
            {
                Response.Redirect("~/League.aspx");
            }
            else
            {
                string   week      = weekNumberSort.Text; //store the input into a string
                string[] weekArray = null;
                char[]   splitChar = { 'W' };             //split the input into 2 parts the year will be stored in weekArray[0] and the week number is stored in the second index of the array
                weekArray = week.Split(splitChar);
                string weekNum = weekArray[1];            // store just the week number into a string variable

                int weekSort = int.Parse(weekNum);        // parse the number as an integer

                //connect to EF
                using (GameTrackerConnection db = new GameTrackerConnection())
                {
                    //query the csgo table
                    var League = (from allData in db.Leagues
                                  where allData.weekOfGame == weekSort
                                  select allData);

                    //bind results to the gridview
                    LeagueGridView.DataSource = League.ToList();
                    LeagueGridView.DataBind();
                }
            }
        }
示例#2
0
        /**
         *
         * <summary>
         * This method gets the dota data from the DB
         * </summary>
         * @method GetLeagueData
         * @returns {void}
         * */
        protected void GetLeagueData()
        {
            //connect to EF
            using (GameTrackerConnection db = new GameTrackerConnection())
            {
                //query the csgo table
                var League = (from allData in db.Leagues
                              select allData);

                //bind results to the gridview
                LeagueGridView.DataSource = League.ToList();
                LeagueGridView.DataBind();
            }
        }