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

        protected void smiteSort(object sender, EventArgs e)
        {
            if (weekNumberSort.Text == null)
            {
                Response.Redirect("~/Smite.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 Smite = (from allData in db.Smites
                                 where allData.weekOfGame == weekSort
                                 select allData);

                    //bind results to the gridview
                    SmiteGridView.DataSource = Smite.ToList();
                    SmiteGridView.DataBind();
                }
            }
        }
Example #2
0
        /**
         *
         * <summary>
         * This method gets the dota data from the DB
         * </summary>
         * @method GetSmiteData
         * @returns {void}
         * */

        protected void GetSmiteData()
        {
            //connect to EF
            using (GameTrackerConnection db = new GameTrackerConnection())
            {
                //query the csgo table
                var Smite = (from allData in db.Smites
                             select allData);

                //bind results to the gridview
                SmiteGridView.DataSource = Smite.ToList();
                SmiteGridView.DataBind();
            }
        }