WEB/ascx/category.ascx.cs

(开头部分) 3KB

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

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using shop.Model;
using shop.BLL;
namespace web
{
    public partial class category : System.Web.UI.UserControl
    {
        protected int i = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                rFatherCategory_load();
        }
        private void rFatherCategory_load()
        {
            string where = "is_show=1 and father_id=0";
            string fieldList = "Id,category_name,is_show,father_id,order_by";
            string orderField = "order_by";
            bool orderby = true;
            DataRecordTable table = new ProductCategoryBusiness().GetList(fieldList, orderField, orderby, 1, 9, where);
            rFatherCategory.DataSource = table.Table;
            rFatherCategory.DataBind();
        }
        protected void rFatherCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int Id = int.Parse(DataBinder.Eval(e.Item.DataItem, "Id").ToString());
            string where = "is_show=1 and father_id=" + Id;
            string fieldList = "Id,category_name,is_show,father_id,order_by";
            string orderField = "order_by";
            bool orderby = true;
            Repeater rSonCategory = e.Item.FindControl("rSonCategory") as Repeater;
            DataRecordTable table = new ProductCategoryBusiness().GetList(fieldList, orderField, orderby, 1, 20, where);
            if (rSonCategory != null)
            {
                rSonCategory.DataSource = table.Table;
                rSonCategory.DataBind();
            }

            Repeater rBrandList = e.Item.FindControl("rBrandList") as Repeater;
            table = new ProductBrandBusiness().GetList("Id,category_id,brand_name,order_by", "order_by", true, 1, 20, "is_show=1 and category_id=" + Id);
            if (rBrandList != null)
            {
                rBrandList.DataSource = table.Table;
                rBrandList.DataBind();
            }
        }
        protected void rSonCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int Id = int.Parse(DataBinder.Eval(e.Item.DataItem, "Id").ToString());
后面还有 23 行代码,购买后查看完整代码

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

AI 解读 AI

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

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