TZ.Web/ticket/index.aspx.cs

(完整代码) 2KB

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using TZ.Common;

public partial class ticket_index : System.Web.UI.Page
{
    protected int id;
    protected int totalCount;
    protected int page = 1;
    protected int pageSize = 10;
    protected string _key = string.Empty;
    protected DataTable dtList = new DataTable();
    protected DataTable dtNews = new DataTable();
    protected DataTable dtHotVenues = new DataTable();
    protected DataTable dtTopTicket = new DataTable();
    protected TZ.BLL.Article bll = new TZ.BLL.Article();
    protected void Page_Load(object sender, EventArgs e)
    {
        id = TZRequest.GetQueryInt("id");
        page = TZRequest.GetQueryInt("page", 1);
        _key = TZRequest.GetQueryString("key");
        if (!IsPostBack)
        {
            dtHotVenues = new TZ.BLL.Venues().GetList(4, "is_top=1", "id asc").Tables[0];
            dtNews = new TZ.BLL.Article().GetList(10, "channel_id=14", "sort_id asc,start_time asc").Tables[0];
            string strWhere = "[status]=0 and channel_id=10";
            if (_key != "")
                strWhere += " and title like '%" + _key + "%'";
            if (id > 0)
            {
                strWhere += " and category_id=" + id + "";
                dtTopTicket = new TZ.BLL.Article().GetList(5, "[status]=0 and channel_id=10 and category_id=" + id + " and is_top=1", "sort_id asc,start_time asc").Tables[0];
            }
            else
            {
                dtTopTicket = new TZ.BLL.Article().GetList(5, "[status]=0 and channel_id=10 and is_top=1", "sort_id asc,start_time asc").Tables[0];
            }
            BindData(strWhere, "sort_id asc,start_time asc");
        }
    }
    private void BindData(string _strWhere, string _orderby)
    {
        dtList = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount).Tables[0];
        string pageUrl = Utils.CombUrlStr("/ticket/", "id={0}&key={1}&page={2}", this.id.ToString(), this._key, "__id__");
        PageContent.InnerHtml = Utils.OutHtmlPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。