Пример #1
0
        protected void news_list_query_type(int _type)
        {
            int     _pageAmount;
            DataSet _ds = new DataSet();

            if (_type == 1)
            {
                hl_news_type.Text        = "站内公告";
                hl_news_type.NavigateUrl = "article.aspx?type=1";

                _ds = _newsLogic.NewsQueryByNewsType("1", 1, 100, 1, 8, out _pageAmount);
                if (_ds.Tables.Count > 0)
                {
                    rpt_news_type1.DataSource = _ds;
                    rpt_news_type1.DataBind();
                }

                rpt_news_type1.Visible = true;
                ipt_menu_current.Value = "1";
            }

            if (_type == 2)
            {
                hl_news_type.Text        = "游戏资讯";
                hl_news_type.NavigateUrl = "article.aspx?type=2";

                _ds = _newsLogic.NewsQueryByNewsType("2", 1, 100, 1, 8, out _pageAmount);
                if (_ds.Tables.Count > 0)
                {
                    rpt_news_type2.DataSource = _ds;
                    rpt_news_type2.DataBind();
                }

                rpt_news_type2.Visible = true;
                ipt_menu_current.Value = "2";
            }

            if (_type == 3)
            {
                hl_news_type.Text        = "常见问题";
                hl_news_type.NavigateUrl = "article.aspx?type=3";

                _ds = _newsLogic.NewsQueryByNewsType("3", 1, 100, 1, 8, out _pageAmount);
                if (_ds.Tables.Count > 0)
                {
                    rpt_news_type3.DataSource = _ds;
                    rpt_news_type3.DataBind();
                }

                rpt_news_type3.Visible = true;
                ipt_menu_current.Value = "3";
            }
        }
Пример #2
0
        protected void header_news_roll()
        {
            int _pageAmount;
            int _foreachIndex = 0;

            String[] _newsRollId      = new String[5];
            String[] _newsRollContent = new String[5];
            DataSet  _ds = _newsLogic.NewsQueryByNewsType("1", 1, 50, 1, 5, out _pageAmount);

            if (_ds.Tables.Count > 0)
            {
                foreach (DataRow _dr in _ds.Tables[0].Rows)
                {
                    _newsRollId[_foreachIndex]      = _dr[0].ToString();
                    _newsRollContent[_foreachIndex] = _dr[1].ToString() + " [" + _dr[6].ToString() + "]";
                    _foreachIndex++;
                }
            }

            ipt_news_id0.Value = _newsRollId[0];
            ipt_news_id1.Value = _newsRollId[1];
            ipt_news_id2.Value = _newsRollId[2];
            ipt_news_id3.Value = _newsRollId[3];
            ipt_news_id4.Value = _newsRollId[4];

            ipt_news_content0.Value = _newsRollContent[0];
            ipt_news_content1.Value = _newsRollContent[1];
            ipt_news_content2.Value = _newsRollContent[2];
            ipt_news_content3.Value = _newsRollContent[3];
            ipt_news_content4.Value = _newsRollContent[4];

            ipt_news_count.Value = _foreachIndex.ToString();
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int     _pageAmount;
            DataSet _ds = _newsLogic.NewsQueryByNewsType("1", 1, 50, 1, 5, out _pageAmount);

            if (_ds.Tables.Count > 0)
            {
                rpt_sidebar_news.DataSource = _ds;
                rpt_sidebar_news.DataBind();
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int     _pageAmount;
            DataSet _ds;

            if (!IsPostBack)
            {
                _ds = _newsLogic.NewsQueryByNewsType("3", 1, 50, 1, 5, out _pageAmount);
                if (_ds.Tables.Count > 0)
                {
                    rpt_sidebar_faq.DataSource = _ds;
                    rpt_sidebar_faq.DataBind();
                }

                _ds = _gameLogic.GameQueryByGameState("-1", 50, 1, 1000, out _pageAmount);
                if (_ds.Tables.Count > 0)
                {
                    rpt_sidebar_gamelist.DataSource = _ds;
                    rpt_sidebar_gamelist.DataBind();
                }

                _ds = _gameLogic.GameQueryByGameState("1", 50, 1, 1000, out _pageAmount);
                if (_ds.Tables.Count > 0)
                {
                    rpt_index_gamelist1.DataSource = _ds;
                    rpt_index_gamelist1.DataBind();
                }

                _ds = _gameLogic.GameQueryByGameState("0", 50, 1, 1000, out _pageAmount);
                if (_ds.Tables.Count > 0)
                {
                    rpt_index_gamelist0.DataSource = _ds;
                    rpt_index_gamelist0.DataBind();
                }


                get_gameinfo_into_dropdownlist();
                gamelist_changed(ddl_gamelist.SelectedValue);
            }
        }
Пример #5
0
        //新闻列表
        protected void news_list_query(int _pageIndex)
        {
            int     _pageAmount;
            DataSet _ds = new DataSet();

            _ds = _newsLogic.NewsQueryByNewsType("-1", 1, 50, _pageIndex, 20, out _pageAmount);

            lb_querytype.Text          = "新闻列表";
            pn_news_list_table.Visible = true;

            pagination_pageindex.InnerHtml  = "第" + _pageIndex + "页";
            pagination_pageamount.InnerHtml = "共" + _pageAmount + "页";

            if (_pageAmount > 1)
            {
                pagination_frame.Visible = true;


                if (_pageIndex == 1)
                {
                    pagination_prev.InnerHtml = "";
                    pagination_next.InnerHtml = "<a href=\"newscfg.aspx?type=1&page=" + (_pageIndex + 1).ToString() + "\">下一页</a>";
                }

                if (_pageIndex == _pageAmount)
                {
                    pagination_prev.InnerHtml = "<a href=\"newscfg.aspx?type=1&page=" + (_pageIndex - 1).ToString() + "\">上一页</a>";
                    pagination_next.InnerHtml = "";
                }

                if (_pageIndex > 1 && _pageIndex < _pageAmount)
                {
                    pagination_prev.InnerHtml = "<a href=\"newscfg.aspx?type=1&page=" + (_pageIndex - 1).ToString() + "\">上一页</a>";
                    pagination_next.InnerHtml = "<a href=\"newscfg.aspx?type=1&page=" + (_pageIndex + 1).ToString() + "\">下一页</a>";
                }
            }
            else
            {
                pagination_frame.Visible = false;
            }


            if (_ds.Tables.Count > 0)
            {
                if (_ds.Tables[0].Rows.Count > 0)
                {
                    rpt_news.DataSource = _ds;
                    rpt_news.DataBind();
                }
                else
                {
                    pagination_pageindex.Visible  = false;
                    pagination_pageamount.Visible = false;
                    query_null.Visible            = true;
                    pagination_frame.Visible      = false;
                }
            }
            else
            {
                pagination_pageindex.Visible  = false;
                pagination_pageamount.Visible = false;
                query_null.Visible            = true;
                pagination_frame.Visible      = false;
            }
        }