/// <summary> /// 返回指定井的井次信息 /// </summary> /// <param name="wid">井id</param> /// <returns>二维List,List[0]:lognamelist;List[1]:logidlist</returns> private List <List <string> > GetLogListByWellId(string wid) { List <String> lognameList = new List <string>(); List <String> logidList = new List <string>(); try { DataTable dt = new DataTable(); dt = Pusher._pusher.GetAllLogsByWellId(wid, out JsonString); foreach (DataRow dr in dt.Rows) { LognameList.Add(dr[0].ToString()); LogidList.Add(dr[1].ToString()); } List <List <String> > Loginfo = new List <List <string> >(); Loginfo.Add(LognameList); Loginfo.Add(LogidList); return(Loginfo); } catch (Exception ex) { Debug.WriteLine(ex.Message + "\r\t <====== RemoteWell.cs-->GetLogListByWellId() ,Error!======>"); return(null); } }
private void treeView_remoteWell_AfterSelect(object sender, TreeViewEventArgs e) { try { if (treeView_remoteWell.SelectedNode != null) { String strSelectedid = e.Node.ToolTipText; String strSelectedname = e.Node.Text; switch (e.Node.Level)//TreeView层数 { //通过工区节点 获取工区包含的井节点信息 case 0: Wellinfo.Clear(); WellidList.Clear(); WellnameList.Clear(); RegionId = strSelectedid; RegionName = strSelectedname; Wellinfo = GetWellListByRegionId(RegionId); for (int i = 0; i < WellnameList.Count; i++) { if (!getChildNodeList(e.Node).Contains(WellnameList[i])) { TreeNode wellnode = new TreeNode(WellnameList[i]); wellnode.ToolTipText = WellidList[i]; e.Node.Nodes.Add(wellnode); } } SelectedNodeLevel = 0; break; //通过井节点 获取井包含的井次信息 case 1: Loginfo.Clear(); LogidList.Clear(); LognameList.Clear(); WellId = strSelectedid; WellName = strSelectedname; Loginfo = GetLogListByWellId(WellId); for (int i = 0; i < LognameList.Count; i++) { if (!getChildNodeList(e.Node).Contains(LognameList[i])) { TreeNode lognode = new TreeNode(LognameList[i]); lognode.ToolTipText = LogidList[i]; e.Node.Nodes.Add(lognode); } } SelectedNodeLevel = 1; break; //选择井次 case 2: LogName = e.Node.Text; LogId = e.Node.ToolTipText; SelectedNodeLevel = 2; break; } initialNodeMap(); } } catch (Exception ex) { Debug.WriteLine(ex.Message + "\r\t <====== RemoteWell.cs-->treeView_remoteWell_AfterSelect() ,Error!======>"); } }