Web/SysAdmin/Advertising/BarList.aspx.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace Web.Admin.Advertising
{
    public partial class BarList : Web.UI.ManagePage
    {
        public int pcount = 0; //总条数
        public int page; //当前页
        public readonly int pagesize = 15; //设置每页显示的大小

        public string keywords = "";
        public int pid;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!int.TryParse(Request.Params["pid"] as string, out this.pid))
            {
                JscriptMsg(350, 230, "错误提示", "<b>出现错误啦!</b>您要查看的广告位不存在或者已经被删除了。", "back", "Error");
                return;
            }
            if (!string.IsNullOrEmpty(Request.Params["keywords"]))
            {
                this.keywords = Request.Params["keywords"].Trim();
            }
            if (!Page.IsPostBack)
            {
                chkLoginLevel("viewAdvertising");
                RptBind("Id>0" + this.CombSqlTxt(this.pid, this.keywords));
            }
        }

        #region 列表数据绑定
        private void RptBind(string where)
        {
            //显示所属的广告位
            BLL.Advertising aBll = new BLL.Advertising();
            Model.Advertising aModel = aBll.GetModel(this.pid);
            lblAdTitle.Text = "【" + aModel.Id + "】" + aModel.Title + "(" + GetAdTypeName(aModel.AdType.ToString()) + ")";

            //绑定广告条列表
            if (!int.TryParse(Request.Params["page"] as string, out this.page))
            {
                this.page = 0;
            }
            this.txtKeywords.Text = this.keywords;
            BLL.Adbanner bll = new BLL.Adbanner();
            //利用PAGEDDAGASOURCE类来分页
            PagedDataSource pg = new PagedDataSource();
            pg.DataSource = bll.GetList(where).Tables[0].DefaultView;
            pg.AllowPaging = true;
            pg.PageSize = pagesize;
            pg.CurrentPageIndex = page;
            //获得总条数
            pcount = bll.GetCount(where);
            //绑定数据
            rptList.DataSource = pg;
后面还有 105 行代码,购买后查看完整代码

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

AI 解读

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

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