HPManage/BaseManage/StoreType/StoreTypeShow.aspx.cs

(完整代码) 1KB

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

public partial class BaseManage_StoreType_StoreTypeShow : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindTree(this.ListTreeView.Nodes, 0);
        }
    }

    private void BindTree(TreeNodeCollection Nds, int IDStr)
    {
        try
        {
            DataTable dt = DBUtility.DbHelperSQL.GetDataTable("select * from StoreTypeInfor where STParentID=" + IDStr.ToString() + " and (STState=0 or STState=1) order by STypeNumber asc");
            foreach (DataRow item in dt.Rows)
            {
                TreeNode OrganizationNode = new TreeNode();
                OrganizationNode.Text = item["STypeName"].ToString();
                OrganizationNode.Value = item["ID"].ToString();
                int strId = int.Parse(item["ID"].ToString());
                OrganizationNode.SelectAction = TreeNodeSelectAction.Expand;
                OrganizationNode.ToolTip = item["ID"].ToString();
                OrganizationNode.Expand();
                Nds.Add(OrganizationNode);
                //递归循环
                BindTree(Nds[Nds.Count - 1].ChildNodes, strId);
            }
        }
        catch (Exception ex)
        {
            Common.WriteLog.CreateLog(ex, "BaseManage_StoreType_StoreTypeShow", "BindTree", Session["TrueName"].ToString());
        }
    }
}

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

AI 解读

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

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