Web/ViewSearch.aspx.cs

(开头部分) 2KB

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

using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
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 Model;
using BLL;

public partial class ViewSearch : System.Web.UI.Page
{
    public string txtCategory = string.Empty;
    public string txtProduct = string.Empty;
    public string txtPriceStart = string.Empty;
    public string txtPriceEnd = string.Empty;
    public string txtItem = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindCategory();
        }

    }
    public void BindCategory() {

        Category bll = new Category();
        IList<CategoryInfo> category = bll.GetCategory();
        SelectCategory.Items.Add(new ListItem("所有商品", "all"));

        for (int i = 0; i < category.Count; i++)
        {

            SelectCategory.Items.Add(new ListItem(category[i].CategoryName, category[i].CategoryId));

        }
    
    }
    protected void ButtonSearch_Click(object sender, EventArgs e)
    {
        txtCategory = SelectCategory.SelectedItem.Value;
        txtProduct = SelectProduct.SelectedItem.Value;
        txtPriceStart = PriceStart.Value.Trim().ToString();
        if (string.IsNullOrEmpty(txtPriceStart)) {

            txtPriceStart = "0";
        
        }
        txtPriceEnd = PriceEnd.Value.Trim().ToString();
        if (string.IsNullOrEmpty(txtPriceEnd)) {

            txtPriceEnd = "0";
        
        }
        txtItem = Server.HtmlEncode(ItemName.Value.Trim().ToString().Replace(",", ""));
        if (string.IsNullOrEmpty(txtItem)) {
后面还有 32 行代码,解锁后查看完整代码

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

AI 解读

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

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