Search.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BLL.Article;
using CSA.DAL;

public partial class Search : System.Web.UI.Page
{
    protected string cur_ProKind, cur_Id, kindname, title, content, name, navname, cur_price, keyword;
    protected DataRow drList;
    protected DataTable dtList, dtCat, dtProClass;

    protected void Page_Load(object sender, EventArgs e)
    {
        BindProducts();
    }

    protected void BindProducts()
    {
        cur_ProKind = Request.QueryString["se_ProKind"] == null ? "0" : Request.QueryString["se_ProKind"].ToString();   //接收Code
        //dtCat = BLL.Product.Product.getList(cur_Code, 0);
        cur_price = Request.QueryString["se_Price"] == null ? "0" : Request.QueryString["se_Price"].ToString();
        keyword = Request.QueryString["keyword"].ToString();
        string sql1 = "select * from bs_products where( name like '%" + keyword + "%' or Code like '%" + keyword + "%' )";
        if (cur_ProKind != "0")
        {
            sql1 += " and bs_prokindcode like '" + cur_ProKind + "__' ";
        }
        if (cur_price != "0")
        {
            sql1 += " and PriceRange like '%" + cur_ProKind + "%' ";
        }
        sql1 += " order by SortNo asc ";
        dtCat = DBAccess.getRS(sql1);
        int pageSize = 10;
        dtList = CSA.DAL.PageHelper.getPage(dtCat, pageSize, AspNetPager1.CurrentPageIndex);
        AspNetPager1.RecordCount = dtCat != null ? dtCat.Rows.Count : 0;
        AspNetPager1.PageSize = pageSize;


    }


    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindProducts();
    }
}

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

AI 解读 AI

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

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