日期:2014-05-20 浏览次数:21037 次
DataTable dtGroupName = Cheeli.DBUtility.DbHelperSQL.GetDataTable
("select distinct GroupName from SysRes");
foreach (DataRow rows in dtGroupName.Rows){
string GroupName = rows["GroupName"].ToString(); TreeNode root = new TreeNode(GroupName);
tvPermissions.Nodes.Add(root);
SqlParameter[] parameters =
{ new SqlParameter("@GroupNameText", root.Text) };
string sql = "select * from SysRes where GroupName=@GroupNameText"; DataTable dt = Cheeli.DBUtility.DbHelperSQL.GetDataTable(sql, parameters);
foreach (DataRow row in dt.Rows){
string PromiseName = row["PromiseName"].ToString();
TreeNode node = new TreeNode(PromiseName);
node.Name = row["Id"].ToString();
root.Nodes.Add(node);
}
}