/// <summary> /// 当点击树节点之后 先调用模版初始化编辑区 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { this.treeView2.Nodes.Clear(); Class_Patients_Doc patients_Doc = (Class_Patients_Doc)treeView1.SelectedNode.Tag; // xmlDoc = new XmlDocument();//加入XML的声明段落 string strXml = patients_Doc.Patients_Doc; this.IniEditContent(strXml); string temp = "select * from t_struct where tid=" + patients_Doc.Tid; DataSet dataSet = App.GetDataSet(temp); docStructs = new Class_Struct[dataSet.Tables[0].Rows.Count]; //刷新结构化树列表 for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { docStructs[i] = new Class_Struct(); docStructs[i].Lid = Convert.ToInt32(dataSet.Tables[0].Rows[i]["LID"].ToString()); docStructs[i].Sid = Convert.ToInt32(dataSet.Tables[0].Rows[i]["SID"].ToString()); docStructs[i].Struct_Lable = dataSet.Tables[0].Rows[i]["STRUCT_LABLE"].ToString(); docStructs[i].Struct_Value = dataSet.Tables[0].Rows[i]["STRUCT_VALUE"].ToString(); TreeNode trNode = new TreeNode(); trNode.Tag = docStructs[i]; trNode.Text = docStructs[i].Struct_Lable; treeView2.Nodes.Add(trNode); } T_tempplate_struct_Sql = "select * from t_struct where tid=" + patients_Doc.Tid; //刷新结构化表格 ucC1FlexGrid1.DataBd(T_tempplate_struct_Sql, "SID", "STRUCT_LABLE,STRUCT_VALUE", "结构化标签,结构化值"); }
/// <summary> /// 初始化树节点 /// </summary> private void InitDocTree() { this.treeView1.Nodes.Clear(); string temp = "select * from t_patients_doc"; DataSet dataSet = App.GetDataSet(temp); patients_Docs = new Class_Patients_Doc[dataSet.Tables[0].Rows.Count]; for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { patients_Docs[i] = new Class_Patients_Doc(); patients_Docs[i].Tid = Convert.ToInt32(dataSet.Tables[0].Rows[i]["TID"].ToString()); patients_Docs[i].Pid = dataSet.Tables[0].Rows[i]["PID"].ToString(); patients_Docs[i].TextName = dataSet.Tables[0].Rows[i]["TEXTNAME"].ToString(); patients_Docs[i].Patients_Doc = dataSet.Tables[0].Rows[i]["PATIENTS_DOC"].ToString(); TreeNode tnRoot = new TreeNode(); tnRoot.Tag = patients_Docs[i]; tnRoot.Text = patients_Docs[i].TextName; treeView1.Nodes.Add(tnRoot); } }