ModelManage/SaleSetManage/CarType/CarType.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 SaleSetManage_CarType_CarType : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                addnew.Visible = RoleControl("|1105_2|");// 添加权限
                addSame.Visible = RoleControl("|1105_2|");// 同级权限
                addSub.Visible = RoleControl("|1105_2|");// 下级权限
                BindTree(this.ListTreeView.Nodes, 0);
            }
            catch (Exception ex)
            {
                Common.WriteLog.CreateLog(ex, "SaleSetManage_CarType_CarType", "Page_Load", Session["TrueName"].ToString());
            }
        }
    }

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

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

AI 解读

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

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