Car/ChooseProduct.aspx.cs

(开头部分) 2KB

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

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

namespace Car
{
    public partial class ChooseProduct : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                DropDownList1.DataSource = DBUtility.DbHelperSQL.Query("select * from Category where Verify = 1 ").Tables[0];
                DropDownList1.DataTextField = "Title";
                DropDownList1.DataValueField = "InfoID";
                DropDownList1.DataBind();
                ListItem item = new ListItem();
                item.Text = "请选择...";
                item.Value = "";
                DropDownList1.Items.Insert(0, item);
                bind();
            }
        }

        void bind()
        {
            AspNetPager1.RecordCount = int.Parse(DBUtility.DbHelperSQL.GetSingle("select count(*) from [Product] where Verify = 1 and TypeID = 1 " + HiddenField1.Value).ToString());
            Repeater1.DataSource = DBUtility.DbHelperSQL.Query("select *,(select Title from Category where Category.InfoID = Product.CategoryID) as CategoryName from [Product] where Verify = 1 and TypeID = 1 " + HiddenField1.Value + " order by infoid desc", AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize).Tables[0];
            Repeater1.DataBind();
        }

        public string ShowDisplay(int count)
        {
            if (count == 0) { return "table-row"; }
            else { return "none"; }
        }

        protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;
            bind();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            HiddenField1.Value = "";
            if (TextBox1.Text.Trim() != "")
            {
                HiddenField1.Value = " and Title like '%" + TextBox1.Text.Trim() + "%'";
            }
            if (DropDownList1.SelectedValue.Trim() != "")
            {
后面还有 6 行代码,购买后查看完整代码

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

AI 解读

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

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