Web/Admin/productAdmin/product_admin.aspx.cs

(开头部分) 6KB

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

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

public partial class Admin_product_product_admin : basePage
{Bll.ProductBll B_pro = new Bll.ProductBll();
    protected void Page_Load(object sender, EventArgs e)
    {
        PublicClass pce = new PublicClass();


       
        if (!Page.IsPostBack)
        {
            //this.CheckUser();
            pce.GetProductClass(this.DropDownList1);
    
            databind("select  * from tab_productClass,tab_products where tab_products.productClassID=tab_productClass.productClassID and tab_productClass.productClassID=tab_products.productClassID");
            //ProBin("select * from tab_products,tab_productClass where tab_products.productClassID=tab_productClass.productClassID");
        }
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        Response.Redirect("product_add.aspx");
    }
    Bll.ProductBll bp = new Bll.ProductBll();
   /// <summary>
   /// 绑定repeater 控件
   /// </summary>
   /// <param name="sql"></param>
    void ProBin(string sql)
    {
        
        DataTable dt = bp.SelectPro(sql);
        this.Repeater1.DataSource = dt;
        this.Repeater1.DataBind();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {   //模糊查询产品数据
        StringBuilder str = new StringBuilder();
        str.Append("select * from tab_products,tab_productClass where tab_products.productClassID=tab_productClass.productClassID ");
        if (this.TextBox1.Text != string.Empty || this.TextBox1.Text != "")
            str.AppendFormat(" and productName like '%'+'{0}'+'%'", this.TextBox1.Text);
        if (this.DropDownList1.SelectedIndex != 0)
            str.AppendFormat(" and tab_products.productClassID ={0}", this.DropDownList1.SelectedValue);
        ProBin(str.ToString());

    }
    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "con")
        {
后面还有 103 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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