public partial class AdvAcordTree : System.Web.UI.Page
{
SysInfo sysInfo = new SysInfo();
DES des = new DES();
string patid;
DataSet ds; protected void Page_Load(object sender, EventArgs e)
{
patid = Request["patid"];
if (ds == null)
{
ds = new AdvAcord().GetMenuTree(sysInfo.ActDeptId, sysInfo.StaffId);
}
if (!IsPostBack)
{
TreeInit();
} } /// <summary>
/// 无刷新动态生成树
/// </summary>
private void TreeInit()
{
this.Tvtree.Nodes.Clear();
//添加个人模板
TreeNode node = new TreeNode("本人", "30");
node.SelectAction = TreeNodeSelectAction.Expand;
node.PopulateOnDemand = true;
this.Tvtree.Nodes.Add(node);
//添加 本科 模板
node = new TreeNode("本科", "20");
node.SelectAction = TreeNodeSelectAction.Expand;
node.PopulateOnDemand = true;
this.Tvtree.Nodes.Add(node);
//添加全院模板
node = new TreeNode("全院", "10");
node.SelectAction = TreeNodeSelectAction.Expand;
node.PopulateOnDemand = true;
this.Tvtree.Nodes.Add(node);
}
public void TreeShow(object sender, TreeNodeEventArgs e)
{
if (IsCallback)
if (e.Node.ChildNodes.Count == 0)
{
LoadChildNode(e.Node,int.Parse(e.Node.Value));
}
}
private void LoadChildNode(TreeNode node, Int32 id)
{
DataView dv = ds.Tables[0].DefaultView;
dv.RowFilter = string.Format(" sharekd = {0} ", id);
foreach (DataRowView drv in dv)
{
TreeNode nNew = new TreeNode();
nNew.Text = drv[GRPRCPPData.NAME_FIELD].ToString();
nNew.NavigateUrl = string.Format("AdvAcord.aspx?patid={0}&;amp;id={1}",
patid, des.Encrypt(drv[GRPRCPPData.ID_FIELD].ToString()));
node.ChildNodes.Add(nNew);
}
}
}
{
SysInfo sysInfo = new SysInfo();
DES des = new DES();
string patid;
DataSet ds; protected void Page_Load(object sender, EventArgs e)
{
patid = Request["patid"];
if (ds == null)
{
ds = new AdvAcord().GetMenuTree(sysInfo.ActDeptId, sysInfo.StaffId);
}
if (!IsPostBack)
{
TreeInit();
} } /// <summary>
/// 无刷新动态生成树
/// </summary>
private void TreeInit()
{
this.Tvtree.Nodes.Clear();
//添加个人模板
TreeNode node = new TreeNode("本人", "30");
node.SelectAction = TreeNodeSelectAction.Expand;
node.PopulateOnDemand = true;
this.Tvtree.Nodes.Add(node);
//添加 本科 模板
node = new TreeNode("本科", "20");
node.SelectAction = TreeNodeSelectAction.Expand;
node.PopulateOnDemand = true;
this.Tvtree.Nodes.Add(node);
//添加全院模板
node = new TreeNode("全院", "10");
node.SelectAction = TreeNodeSelectAction.Expand;
node.PopulateOnDemand = true;
this.Tvtree.Nodes.Add(node);
}
public void TreeShow(object sender, TreeNodeEventArgs e)
{
if (IsCallback)
if (e.Node.ChildNodes.Count == 0)
{
LoadChildNode(e.Node,int.Parse(e.Node.Value));
}
}
private void LoadChildNode(TreeNode node, Int32 id)
{
DataView dv = ds.Tables[0].DefaultView;
dv.RowFilter = string.Format(" sharekd = {0} ", id);
foreach (DataRowView drv in dv)
{
TreeNode nNew = new TreeNode();
nNew.Text = drv[GRPRCPPData.NAME_FIELD].ToString();
nNew.NavigateUrl = string.Format("AdvAcord.aspx?patid={0}&;amp;id={1}",
patid, des.Encrypt(drv[GRPRCPPData.ID_FIELD].ToString()));
node.ChildNodes.Add(nNew);
}
}
}