Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["leagueid"] == null)
         {
             return;
         }
         if (Convert.ToInt32(Session["leagueid"]) == 0)
         {
             return;
         }
         var league = LeagueHelper.GetLeague(Convert.ToInt32(Session["leagueid"]));
         if (league.LeagueType == 8 || league.LeagueType == 2)
         {
             ddlLeague.SelectedValue = "14";
             JqgridSeasonBinding(Convert.ToInt32(Session["leagueid"]));
         }
         else
         {
             ddlLeague.SelectedValue = (string)Session["leagueid"];
             JqgridSeasonBinding(Convert.ToInt32(Session["leagueid"]));
         }
     }
 }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ListLeague  = LeagueHelper.SelectLeague();
     ListScoope  = NewsHelper.ScoopeList();
     ListHotNews = NewsHelper.HotNewsList();
     if (!IsPostBack)
     {
         var httpCookie = Request.Cookies["LeagueId"];
         if (httpCookie != null && httpCookie.Value != "")
         {
             JqgridMatchFullResultBinding(Convert.ToInt32(httpCookie.Value));
             JqgridMatchBinding(Convert.ToInt32(httpCookie.Value));
             JqgridSulvoStarBinding(Convert.ToInt32(httpCookie.Value));
         }
         else
         {
             if (ListLeague != null && ListLeague.Any())
             {
                 var leagueId = ListLeague.First().LeagueId;
                 JqgridMatchFullResultBinding(leagueId);
                 JqgridMatchBinding(leagueId);
                 JqgridSulvoStarBinding(leagueId);
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["seasonid"] == null)
                {
                    return;
                }
                if (Convert.ToInt32(Session["seasonid"]) == 0)
                {
                    return;
                }

                if (Session["leagueid"] == null)
                {
                    return;
                }
                if (Convert.ToInt32(Session["leagueid"]) == 0)
                {
                    return;
                }

                ddlLeague.SelectedValue = Convert.ToString(Session["leagueid"]);
                ddlSeason.SelectedValue = Convert.ToString(Session["seasonid"]);
                var leagueId = Convert.ToInt32(Session["leagueid"]);
                var league   = LeagueHelper.GetLeague(leagueId);
                GenTeam.Visible = (league.LeagueType == 1 || league.LeagueType == 2);
                JqgridTeamBinding(Convert.ToInt32(Session["seasonid"]));
            }
        }
Exemple #4
0
        protected void JqgridSeason_RowAdding(object sender, Trirand.Web.UI.WebControls.JQGridRowAddEventArgs e)
        {
            if (Session["leagueid"] == null)
            {
                return;
            }
            if (Convert.ToInt32(Session["leagueid"]) == 0)
            {
                return;
            }
            var league = LeagueHelper.GetLeague(Convert.ToInt32(Session["leagueid"]));

            using (var dc = ThaitaeDataDataContext.Create())
            {
                if (league.LeagueType == 1)
                {
                    var season = new thaitae.lib.Season
                    {
                        LeagueId   = Convert.ToInt32(Session["leagueid"]),
                        SeasonName = e.RowData["SeasonName"],
                        SeasonDesc = e.RowData["SeasonDesc"]
                    };
                    dc.Seasons.InsertOnSubmit(season);
                    dc.SubmitChanges();
                    var leagueList = LeagueHelper.GetChampionsLeagueGroupList();
                    foreach (var championGroup in leagueList)
                    {
                        var seasonGroup = new thaitae.lib.Season
                        {
                            LeagueId               = championGroup.LeagueId,
                            SeasonName             = e.RowData["SeasonName"],
                            SeasonDesc             = e.RowData["SeasonDesc"],
                            ChampionLeagueSeasonId = championGroup.LeagueType == 2 ? (int?)null : season.SeasonId
                        };
                        dc.Seasons.InsertOnSubmit(seasonGroup);
                    }
                    dc.SubmitChanges();
                }
                else
                {
                    dc.Seasons.InsertOnSubmit(new thaitae.lib.Season
                    {
                        LeagueId   = Convert.ToInt32(Session["leagueid"]),
                        SeasonName = e.RowData["SeasonName"],
                        SeasonDesc = e.RowData["SeasonDesc"]
                    });
                    dc.SubmitChanges();
                }
            }
        }
        protected void ddlLeague_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlLeague.SelectedValue == "")
            {
                return;
            }

            Session["leagueid"] = ddlLeague.SelectedValue;
            Session.Remove("seasonid");
            if (ddlLeague.SelectedValue == "0")
            {
                GenTeam.Visible = false;
                return;
            }
            var leagueId = Convert.ToInt32(Session["leagueid"]);
            var league   = LeagueHelper.GetLeague(leagueId);

            GenTeam.Visible = (league.LeagueType == 1 || league.LeagueType == 2);
        }
Exemple #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ListLeague          = LeagueHelper.SelectNormalLeague();
     ListChampionsLeague = LeagueHelper.SelectChampionsLeague();
 }