YKT_EShop/Admin/Admin_Menu_Product_Class.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using YKT_Model;
using YKT_BLL;
using System.Data;

namespace YKT_EShop.Admin
{
    public partial class Admin_Menu_Product_Class : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void TreeViewMenu_TreeNodePopulate(object sender, TreeNodeEventArgs e)
        {
            if (IsCallback)
            {
                if (e.Node.ChildNodes.Count == 0)
                {
                    Bind_ProductClassList(e.Node);
                }
            }
        }

        private void Bind_ProductClassList(TreeNode node)
        {
            string ClassID = node.Value;
            DataTable dt = new BLLProductClass().GetList(" ParentID=" + ClassID).Tables[0];
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    TreeNode subNode = new TreeNode(row["ClassName"].ToString());
                    //subNode.SelectAction = TreeNodeSelectAction.SelectExpand;
                    subNode.PopulateOnDemand = true;
                    subNode.NavigateUrl = "Admin_Product.aspx?ClassID=" + row["ClassID"].ToString();
                    subNode.Target = "main";
                    subNode.Value = row["ClassID"].ToString();
                    node.ChildNodes.Add(subNode);
                }
            }
        }
    }
}

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

AI 解读 AI

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

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