dzbl/mydzbllist.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class dzbl_mydzbllist : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) {
            if (!IsPostBack) {

                string sql = "select * from dzbl where 1=1";
                if (Session["yhm"] != null) {
                    sql += " and hz='"+Session["yhm"].ToString()+"'";
                }


                    this.SqlDataSource1.SelectCommand=sql;
            }
        }
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {


        string sql = "select * from dzbl where 1=1";
        if (Session["yhm"] != null)
        {
            sql += " and hz='" + Session["yhm"].ToString() + "'";
        }
        string zz = this.TextBox1.Text;
        string fx = this.TextBox2.Text;

        if (zz.Length > 0) {

            sql += " and zz like '%"+zz+"%'";
        }

        if (fx.Length > 0)
        {

            sql += " and fx like '%" + fx + "%'";
        }
        this.SqlDataSource1.SelectCommand = sql;
    }
}

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

AI 解读 AI

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

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