@{
Tree tree_OA3 = F.GetControl<Tree>("treeMenu_OA3");
ResolveTreeNode(tree_OA3.Nodes);
}
@{
Tree tree_YF = F.GetControl<Tree>("treeMenu_YF");
ResolveTreeNode(tree_YF.Nodes);
}
@{
Tree tree_Sale = F.GetControl<Tree>("treeMenu_Sale");
ResolveTreeNode(tree_Sale.Nodes);
}
@{
Tree tree_Sys = F.GetControl<Tree>("treeMenu_Sys");
ResolveTreeNode(tree_Sys.Nodes);
}
} 作者: xiaowengang 时间: 2017-5-13 15:34
下面是根据表结构动态的构建XML,绑定到树
private void LoadData()
{
int i = 0;
string systemname = "INFOWEB"; //AppConfiguration.SYSTEM_FLAG
string sql0 = "select distinct action_id from vw_power where action_systemno='" + systemname + "' and user_no='" + sCookieName + "' and action_pid=0 and action_menu=1";
string sql = "select distinct action_id,action_name,action_order from vw_power where user_no='" + sCookieName + "' and action_pid in (" + sql0 + ") order by action_order";
DataTable dt_MN = DBConnSql.GetDataTable(AppConfiguration.PowerConn, sql);
string cmdText = "select distinct user_no,action_id,action_name,action_no,action_folder,action_url,action_order from vw_power where action_menu=1 and user_no='" + sCookieName + "' order by action_order";
DataTable dt_TR = DBConnSql.GetDataTable(AppConfiguration.PowerConn, cmdText);
//string strsel = "SELECT action_id as TREENODE_ID,action_name as TEXT,action_url as NAVIGATEURL,'' as ISNEW,action_pid as TREENODE_ID_0,action_order FROM Power_Action where action_systemno='INFOWEB' order by action_order,action_id";
string strsel = "SELECT action_id as TREENODE_ID,action_name as TEXT,case right(action_url,5) when '.aspx' then '/'+substring(action_url,0,len(action_url)-4) else action_url end as NAVIGATEURL,'' as ISNEW,action_pid as TREENODE_ID_0,action_order FROM Power_Action where action_systemno='INFOWEB' order by action_order,action_id";
dtmenu = DBConnSql.GetDataTable(AppConfiguration.PowerConn, strsel);