Example #1
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        this.txtKeywords.Text = this.keywords;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();

        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string ls_key = JpCommon.Filter(this.txtKeywords.Text.Trim());

        DataTable dt = new DataTable();
        string ls_where = "  and   hy_advername  like '%" + ls_key + "%' ";
        ls_where += "   and ( hy_ifsh=1 or hy_ifsh=0 )";
        dt = JpAdver.SearchdocsByKey(ls_where, "   order  by hy_sort desc ", Convert.ToInt32(txtPage.Text), 10);

        this.totalCount = JpAdver.SearchdocsByKeyNum(ls_where);

        rptList.DataSource = dt;
        rptList.DataBind();

        string pageUrl = JpCommon.CombUrlTxt("list_adver_tg.aspx", "page={0}&rnd={1}&keywords={2}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Example #2
0
 //首页广告
 private void GetAdvers()
 {
     TPortalClass.JpAdver JpAdver = new TPortalClass.JpAdver();
     string ls_where = " and hy_ifsh='2' ";
     string ls_order = " order by hy_sort";
     DataTable dt = JpAdver.SearchdocsByKey(ls_where, ls_order, 1, 4);
     if (dt.Rows.Count == 4)
     {
         this.lb_gg1.Text = "<a onclick=\"locationDetail('" + dt.Rows[0]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[0]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
         this.lb_gg2.Text = "<a onclick=\"locationDetail('" + dt.Rows[1]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[1]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
         this.lb_gg3.Text = "<a onclick=\"locationDetail('" + dt.Rows[2]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[2]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
         this.lb_gg4.Text = "<a onclick=\"locationDetail('" + dt.Rows[3]["hy_adverurl"].ToString() + "','" + locationType + "','0')\"  target=_blank><img src=\"" + dt.Rows[3]["hy_adverpic"].ToString() + "\" onError=\"this.src='images/nophoto.jpg';\"></a>";
     }
 }