/// <summary> /// 添加节点 /// </summary> /// <param name="node">节点</param> /// <param name="tree">树控件</param> public void AddNode(Node node, AdvTree tree) { if (node.AccessibleDescription == "0") { node.ImageIndex = 0; } else { node.ImageIndex = 1; } if (SelectWestDrugNode != null) { if (TreeLevel == 1) { tree.SelectedNode.Nodes.Add(node); } else { tree.SelectedNode.Parent.Nodes.Add(node); } } tree.SelectedNode = node; if (tree.Name == "treWestDrug") { OPD_PresMouldHead delrHead = ListHead.Find((OPD_PresMouldHead head) => head.PresMouldHeadID == Convert.ToInt32(treWestDrug.SelectedNode.Name)); if ((treWestDrug.SelectedNode.AccessibleDescription == "1") && (delrHead.CreateEmpID == (InvokeController("this") as AbstractController).LoginUserInfo.EmpId)) { WestPresControl.Enabled = true; TemplateName.Text = node.Text; } else { TemplateName.Text = string.Empty; WestPresControl.Enabled = false; } WestPresControl.LoadPatData(Convert.ToInt32(node.Name), 99999, "xxx", 99999, "xxxx"); } else { OPD_PresMouldHead delrHead = ListHead.Find((OPD_PresMouldHead head) => head.PresMouldHeadID == Convert.ToInt32(treMidDrug.SelectedNode.Name)); if ((treMidDrug.SelectedNode.AccessibleDescription == "1") && (delrHead.CreateEmpID == (InvokeController("this") as AbstractController).LoginUserInfo.EmpId)) { MidDrugPresControl.Enabled = true; MidTemplateName.Text = node.Text; } else { MidDrugPresControl.Enabled = false; MidTemplateName.Text = string.Empty; } MidDrugPresControl.LoadPatData(Convert.ToInt32(node.Name), 99999, "xxx", 99999, "xxxx"); } }
/// <summary> /// 节点点击事件 /// </summary> /// <param name="sender">控件对象</param> /// <param name="e">事件参数</param> private void treWestDrug_NodeClick(object sender, TreeNodeMouseEventArgs e) { OPD_PresMouldHead delrHead = ListHead.Find((OPD_PresMouldHead head) => head.PresMouldHeadID == Convert.ToInt32(treWestDrug.SelectedNode.Name)); if ((treWestDrug.SelectedNode.AccessibleDescription == "1") && (delrHead.CreateEmpID == (InvokeController("this") as AbstractController).LoginUserInfo.EmpId)) { WestPresControl.Enabled = true; TemplateName.Text = e.Node.Text; } else { TemplateName.Text = string.Empty; WestPresControl.Enabled = false; } WestPresControl.LoadPatData(Convert.ToInt32(e.Node.Name), 99999, "xxx", 99999, "xxxx"); }