private void RefreshResList(TreeListNode node) { if (IsChanged()) { DialogResult rst = EFMessageBox.Show(EP.EPES.EPESC0000089 /*已修改群组资源权限,是否保存?*/, EP.EPES.EPESC0000024, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rst == DialogResult.Yes) { SaveAuth(); } } listFormGrant.Clear(); listFormRevok.Clear(); listButtGrant.Clear(); listButtRevok.Clear(); subjType = GetSubjType(node); if (node.Tag != null) { subjEname = node.Tag.ToString(); } else { subjEname = treeListUser.FocusedNode.GetValue("ID").ToString(); } subjDescript = node.GetDisplayText(2) == null ? "" : node.GetDisplayText(2); if (treeListForm.Nodes.Count == 0) { QryAuthForm(); } else { RefreshFormList(); } }
/// <summary> /// 节点值匹配搜索值 /// </summary> /// <param name="key"></param> /// <param name="node"></param> /// <param name="colNames">搜索字段名称数组</param> /// <returns></returns> private bool NodeMatch(string key, TreeListNode node, params string[] colNames) { if (colNames.Length > 0) { foreach (string colName in colNames) { string nodeText = node.GetDisplayText(Columns.ColumnByFieldName(colName)); bool isVisible = nodeText.IndexOf(key, StringComparison.CurrentCultureIgnoreCase) >= 0; if (isVisible) { return(true); } } return(false); } foreach (TreeListColumn column in Columns) { string nodeText = node.GetDisplayText(Columns.ColumnByFieldName(column.FieldName)); bool isVisible = nodeText.IndexOf(key, StringComparison.CurrentCultureIgnoreCase) >= 0; if (isVisible) { return(true); } } return(false); }
private void GenerateTestChildrenNodes(TreeListNode parent) { TreeList TreeList = treeListLookUpEdit1.Properties.TreeList; if (parent.GetDisplayText("Name") == "Mammals") { ID++; TreeListNode node = TreeList.AppendNode(new object[] { "Fox", "Medium", ID }, parent); node.HasChildren = true; ID++; node = TreeList.AppendNode(new object[] { "Panda", "Medium-Huge", ID }, parent); node.HasChildren = true; } else if (parent.GetDisplayText("Name") == "Birds") { ID++; TreeListNode node = TreeList.AppendNode(new object[] { "Eagle", "Medium", ID }, parent); node.HasChildren = true; ID++; node = TreeList.AppendNode(new object[] { "Sparrow", "Little", ID }, parent); node.HasChildren = true; } else { ID++; TreeListNode node = TreeList.AppendNode(new object[] { "New animal 1", "Medium", ID }, parent); node.HasChildren = true; ID++; node = TreeList.AppendNode(new object[] { "New animal 2", "Little", ID }, parent); node.HasChildren = true; } }
public AllowMergeRowCellsEventArgs(RowInfo rowInfo, int currCellIndex, int prevCellIndex) { node = rowInfo.Node; currentColumn = rowInfo.Cells[currCellIndex].Column; previousColumn = rowInfo.Cells[prevCellIndex].Column; currentCellDisplayText = node.GetDisplayText(currentColumn); previousCellDisplayText = node.GetDisplayText(previousColumn); merge = DefaultBoolean.Default; }
private void treeList1_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e) { TreeListNode clickedNode = this.treeList1.FocusedNode; string code = clickedNode.GetDisplayText("Code"); string item = clickedNode.GetDisplayText("Item"); int pid = (int)clickedNode[treeList1.ParentFieldName]; int id = (int)clickedNode[treeList1.KeyFieldName]; medicalID = id; GridReload(medicalID); }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { TreeListNode clickedNode = this.treeList1.FocusedNode; string name = clickedNode.GetDisplayText("Customer"); string formname = clickedNode.GetDisplayText("Phone"); if (clickedNode != null) { treeList1.AppendNode(new object[] { "Suyama, Michael", "Obere Str. 55", "030-0074263" }, clickedNode); } }
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { TreeListNode clickedNode = this.treeList1.FocusedNode; string name = clickedNode.GetDisplayText("Customer"); string formname = clickedNode.GetDisplayText("Phone"); if (clickedNode != null) { treeList1.DeleteNode(clickedNode); } }
/// <summary> /// 查看产品/任务, /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void itemView_ItemClick(object sender, ItemClickEventArgs e) { if (focused.GetDisplayText("Type").Equals("D")) { ProductViewer productviewer = new ProductViewer(); productviewer.ShowDialog(); } else { //任务查看窗体 } }
/// <summary> /// 获取选中节点到根节点的所有信息 /// </summary> /// <param name="focusedNode">TreeListNode</param> /// <param name="columnID">列名称</param> /// <param name="buildPathRule">规则委托</param> /// <returns>路径信息</returns> public static string FullPathInfo(this TreeListNode focusedNode, string columnID, Func <string, string, string> buildPathRule) { string _fullPathInfo = string.Empty; _fullPathInfo = focusedNode.GetDisplayText(columnID); while (focusedNode.ParentNode != null) { focusedNode = focusedNode.ParentNode; string _nodeText = focusedNode.GetDisplayText(columnID).Trim(); _fullPathInfo = buildPathRule(_nodeText, _fullPathInfo); } return(_fullPathInfo); }
/// <summary> /// 新增同级类目 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { TreeListNode node = treeListStockCat.FocusedNode; if (node != null) { TreeListNode fatherNode = node.ParentNode; string fatherName = string.Empty; string fatherCode = "0"; if (fatherNode != null) { fatherName = fatherNode.GetDisplayText(0); TreeListNodeTag tag = fatherNode.Tag as TreeListNodeTag; fatherCode = tag.Cid; } StockCatAdd stockCatAdd = new StockCatAdd(fatherName, "0"); stockCatAdd.ShowDialog(); if (stockCatAdd.DialogResult == DialogResult.OK) { flag = true; Init(null);//刷新 } } else { StockCatAdd stockCatAdd = new StockCatAdd(string.Empty, "0"); stockCatAdd.ShowDialog(); if (stockCatAdd.DialogResult == DialogResult.OK) { flag = true; Init(null);//刷新 } } }
private async void trlUser_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { try { trlPermission.ClearNodes(); TreeListNode node = trlUser.FocusedNode; //CommonEngine.ShowWaitForm(this); await LoadPermission(node.GetDisplayText(tlcCode) + "", rootNode, node.Level == 0?false : true); string result = "", tmpGroup = "", tmpUser = ""; if (node.Level.Equals(0)) { tmpGroup = string.Format(@" {0}: {1}", ConfigEngine.Language.Equals("vi") ? "Nhóm" : "Group", node.GetDisplayText(tlcName)); tmpUser = ""; } else { tmpGroup = string.Format(@" {0}: {1}", ConfigEngine.Language.Equals("vi") ? "Nhóm" : "Group", node.ParentNode.GetDisplayText(tlcName)); tmpUser = string.Format(@"<br> {0}: {1}", ConfigEngine.Language.Equals("vi") ? "Người dùng" : "User", node.GetDisplayText(tlcName)); } result = string.Format(@"{0}{1}", tmpGroup, tmpUser); lblUserInfo.Caption = result; } catch (Exception ex) { CommonEngine.ShowExceptionMessage(ex); return; } finally { //CommonEngine.CloseWaitForm(); } }
private void treeList1_DoubleClick(object sender, EventArgs e) { TreeListNode clickedNode = this.treeList1.FocusedNode; string disPlayText = clickedNode.GetDisplayText(0); MessageBox.Show("You clicked " + disPlayText); }
protected override void ProcessFindItem(KeyPressHelper helper, char pressedKey) { filterText = helper.Text; if (filterText == "" || filterText == null) { Properties.TreeList.FocusedNode = Properties.PrevFocusedNode; } base.ProcessFindItem(helper, pressedKey); if (filterText != "" && Properties.SearchMode != SearchMode.OnlyInPopup) { TreeListNode node = Properties.GetNodeByDisplayText(Properties.TreeList.Nodes, filterText, Properties.DisplayMember); if (node != null) { string nodeText = node.GetDisplayText(Properties.DisplayMember); EditValue = node[Properties.ValueMember]; AutoSearchText = filterText; this.SelectionStart = helper.GetCorrectedAutoSearchSelectionStart(Text, pressedKey); this.SelectionLength = nodeText.Length - this.SelectionStart; if (Properties.TreeList.FocusedNode != null) { if (Properties.TreeList.FocusedNode != Properties.PrevFocusedNode) { Properties.PrevFocusedNode = Properties.TreeList.FocusedNode; } } Properties.TreeList.FocusedNode = node; LayoutChanged(); } } }
/// <summary> /// 新增子类目 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (gridViewStockProp.RowCount > 0) { XtraMessageBox.Show("该类目下有属性信息,不能添加子类目!", Constants.SYSTEM_PROMPT); return; } TreeListNode node = treeListStockCat.FocusedNode; if (node != null) { TreeListNodeTag tag = node.Tag as TreeListNodeTag; string fatherCode = tag.Cid; if (tag.Cid == "10000") { XtraMessageBox.Show("该类目为系统内置默认类目,不能有子类目!", Constants.SYSTEM_PROMPT); return; } string fatherName = node.GetDisplayText(0); StockCatAdd stockCatAdd = new StockCatAdd(fatherName, fatherCode); stockCatAdd.ShowDialog(); if (stockCatAdd.DialogResult == DialogResult.OK) { flag = true; Init(null);//刷新 } } else { XtraMessageBox.Show("请先选中一个类目进行子节点的添加!", Constants.SYSTEM_PROMPT); return; } }
private void tlProjectType_Click(object sender, EventArgs e) { TreeListNode tlfocuse = tlProjectType.FocusedNode; int groupid = Convert.ToInt32(tlfocuse.GetDisplayText("Id")); List <ProjectBo> projects = WcfServiceLocator.Create <IProjectExportService>().getProjectsByGroupId(groupid); gcProjectList.DataSource = projects; }
private void barSubChild_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { this.popupMenu1.HidePopup(); TreeListNode clickedNode = this.treeList1.FocusedNode; string code = clickedNode.GetDisplayText("Code"); string item = clickedNode.GetDisplayText("Item"); int pid = (int)clickedNode[treeList1.ParentFieldName]; int id = (int)clickedNode[treeList1.KeyFieldName]; FrmAdd frmAdd = new FrmAdd(code, pid, id, true); frmAdd.ShowDialog(); DJK.Model.admin_MedicalData _model = frmAdd._model; if (_model != null) { CreateNodes(this.treeList1, clickedNode, _model); } }
/// <summary> /// 绘制寄存号位 /// </summary> private void DrawGrid(TreeListNode regionNode) { int rows = int.Parse(regionNode.GetValue("RG020").ToString()); //层数 int cols = int.Parse(regionNode.GetValue("RG021").ToString()); gridView1.BeginUpdate(); /////////清除所有数据 gridTable.Rows.Clear(); gridTable.Columns.Clear(); gridView1.RowHeight = AppInfo.GRID_HEIGHT; ////生成列 DataColumn col = null; DataRow row = null; for (int i = 1; i <= cols; i++) { col = new DataColumn("col" + i.ToString(), typeof(string)); col.ReadOnly = true; gridTable.Columns.Add(col); } dt_bi01.Clear(); op_rg001.Value = regionNode.GetValue("RG001").ToString(); bi01Adapter.Fill(dt_bi01); int bitIndex = 0; for (int i = 1; i <= rows; i++) { row = gridTable.NewRow(); for (int j = 1; j <= cols; j++) { row.SetField(j - 1, dt_bi01.Rows[bitIndex]["BI003"]); bitIndex++; } gridTable.Rows.Add(row); } gridControl1.DataSource = gridTable; gridView1.PopulateColumns(); //设置列宽 for (int i = 1; i <= cols; i++) { gridView1.Columns[i - 1].Width = AppInfo.GRID_WIDTH; } //grid标题 TreeListNode hall_node = regionNode.ParentNode.ParentNode; TreeListNode room_node = regionNode.ParentNode; gridView1.ViewCaption = hall_node.GetDisplayText("RG003") + "-" + room_node.GetDisplayText("RG003") + "-" + regionNode.GetDisplayText("RG003"); gridView1.EndUpdate(); }
private void treeList1_DoubleClick(object sender, EventArgs e) { TreeListNode tree = this.treeList1.FocusedNode; if (tree == null) { return; } string name = tree.GetDisplayText("Customer"); string formname = tree.GetDisplayText("Phone"); TreeListNode node = treeList1.FocusedNode; DevExpress.XtraTreeList.Columns.TreeListColumn column = treeList1.FocusedColumn; if (column.FieldName == "NodeName" && node.GetValue(0).ToString() != "") { } TreeListNode praNode = tree.ParentNode; }
public AllowMergeColumnCellsEventArgs(RowInfo rowInfo, int cellIndex) { currNode = rowInfo.Node; prevNode = rowInfo.Node.PrevNode; column = rowInfo.Cells[cellIndex].Column; currCellVisibleText = currNode.GetDisplayText(column); prevCellVisibleText = prevNode.GetDisplayText(column); merge = DefaultBoolean.Default; }
private bool ContainsSearchText(TreeListColumn column, TreeListNode node) { if (column == null) { return(false); } string txt = node.GetDisplayText(column).ToLower(); return(txt.Contains(SearchText.ToLower())); }
bool IsAcronymOfVariableInEditModus(TreeListNode acroNode) {//does the acronym of this node belong to the variable, which is just edited? if (_variableInEditModus == string.Empty || !IsAcronymNode(acroNode)) { return(false); } return(IsAcronymOfVariable(_variableInEditModus, acroNode.GetDisplayText(_variablesForm.colAcronym), //acronym (acroNode.Tag as VarConfig.AcronymRow).AcronymLevelRow.AcronymTypeRow.ShortName)); //acronym tpye }
/// <summary> /// 获取筛选节点到根节点的所有信息 /// </summary> /// <param name="focusedNode">TreeListNode</param> /// <param name="columnID">列名称</param> /// <param name="compareNodeRule">规则委托</param> /// <param name="buildPathFactory">规则委托</param> /// <returns>路径信息</returns> public static string FilterPathInfo(this TreeListNode focusedNode, string columnID, Func <TreeListNode, bool> compareNodeRule, Func <string, string, string> buildPathFactory) { string _fullPathInfo = string.Empty; _fullPathInfo = focusedNode.GetDisplayText(columnID); while (focusedNode.ParentNode != null) { focusedNode = focusedNode.ParentNode; if (compareNodeRule(focusedNode)) { string _nodeText = focusedNode.GetDisplayText(columnID).Trim(); _fullPathInfo = buildPathFactory(_nodeText, _fullPathInfo); } } return(_fullPathInfo); }
private void barButtonItemCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { TreeListMultiSelection multiSelection = this.FTAttrTreeList.Selection; TreeListNode node = multiSelection[0]; string strTemp = node.GetDisplayText("FieldValue").ToString(); if (strTemp != "" && strTemp != null) { Clipboard.SetText(strTemp); } }
public static string NodePath(this TreeListNode tln, string fieldName, string spliter = @"\") { try { string path = tln.GetDisplayText(fieldName); while (tln.ParentNode != null) { tln = tln.ParentNode; path = tln.GetDisplayText(fieldName) + spliter + path; } return(path); } catch (Exception ex) { throw ex; } finally { } }
private void treeList1_Click(object sender, EventArgs e) { TreeListNode clickedNode = this.treeList1.FocusedNode; if (!clickedNode.HasChildren) { string disPlayText = clickedNode.GetDisplayText("COLNAME"); // 显示的汉字,目前无法取到绑定时的数字 TicketSaleSystem.TicketOperate.Frm_FinanceStockIn frm = new TicketSaleSystem.TicketOperate.Frm_FinanceStockIn(); UIHelper.AddUserControl(xtraTabControl1, frm, disPlayText, disPlayText); } }
public static void ConvertTreeListNodeToObj <T>(DevExpress.XtraTreeList.TreeList treeList, TreeListNode node, T obj) { object arr = treeList.GetDataRecordByNode(node); foreach (TreeListColumn col in treeList.Columns) { string[] props = col.FieldName.Split('.'); if (props != null) { for (int i = 0; i < props.Length; i++) { object val = node.GetDisplayText(props[i]); if (val != null && !string.IsNullOrWhiteSpace(val.ToString())) { foreach (PropertyInfo p in obj.GetType().GetProperties()) { if (p.Name == props[i]) { Type u = Nullable.GetUnderlyingType(p.PropertyType); if (u != null) { var temp = ChangeType(val, u); if (temp != null) { p.SetValue(obj, temp, null); } } else { var temp = ChangeType(val, p.PropertyType); if (val != null) { p.SetValue(obj, temp, null); } } //if (p.PropertyType.Name == "DateTime") //{ // var temp = Convert.ChangeType(val, p.PropertyType,VnCul); // p.SetValue(obj, temp, null); //} //else //{ // var temp = (val == null) ? null : Convert.ChangeType(val, p.PropertyType); // p.SetValue(obj, temp, null); //} } } } } } } }
/// <summary> /// 绘制寄存号位 /// </summary> /// <param name="regionNode"></param> private void DrawGrid(TreeListNode regionNode) { int rows = int.Parse(regionNode.GetValue("RG020").ToString()); //层数 int cols = int.Parse(regionNode.GetValue("RG021").ToString()); gridView1.BeginUpdate(); /////////清除所有数据 gridTable.Clear(); gridTable.Columns.Clear(); ////生成列 DataColumn col = null; DataRow row = null; for (int i = 1; i <= cols; i++) { col = new DataColumn("col" + i.ToString(), typeof(string)); col.ReadOnly = true; gridTable.Columns.Add(col); } DataRow[] datarow_arry = rgset.Bi01.Select("RG001='" + regionNode.GetValue("RG001").ToString() + "'", "BI005 DESC,BI008 ASC"); int bitIndex = 0; for (int i = 1; i <= rows; i++) { row = gridTable.NewRow(); for (int j = 1; j <= cols; j++) { row.SetField(j - 1, datarow_arry[bitIndex]["BI003"]); bitIndex++; } gridTable.Rows.Add(row); } gridControl1.DataSource = gridTable; gridView1.PopulateColumns(); //设置列宽 for (int i = 1; i <= cols; i++) { gridView1.Columns[i - 1].Width = 50; } //grid标题 TreeListNode hall_node = regionNode.ParentNode.ParentNode; TreeListNode room_node = regionNode.ParentNode; gridView1.ViewCaption = hall_node.GetDisplayText("RG003") + "-" + room_node.GetDisplayText("RG003") + "-" + regionNode.GetDisplayText("RG003"); gridView1.EndUpdate(); }
/// <summary> /// 初始化/刷新 /// </summary> private void Init(TreeListNode fnode) { if (flag) { treeListStockCat.Nodes.Clear(); //只加载最顶级的类目 List <Alading.Entity.StockCat> stockCatList = StockCatService.GetStockCat(i => i.ParentCid == "0"); treeListStockCat.BeginUnboundLoad(); foreach (Alading.Entity.StockCat stockCat in stockCatList) { TreeListNode node = treeListStockCat.AppendNode(new object[] { stockCat.StockCatName }, null, new TreeListNodeTag(stockCat.StockCid)); //设置是否有子节点,有则会显示一个+号 node.HasChildren = stockCat.IsParent; } treeListStockCat.EndUnboundLoad(); //不可编辑 treeListStockCat.OptionsBehavior.Editable = false; treeListStockCat.FocusedNodeChanged += treeListStockCat_FocusedNodeChanged; flag = false; if (treeListStockCat.FocusedNode != null) { TreeListNodeTag tag = treeListStockCat.FocusedNode.Tag as TreeListNodeTag; textCatCode.Text = tag.Cid; textCatName.Text = treeListStockCat.FocusedNode.GetDisplayText(0); gridCtrlStockProp.DataSource = StockPropService.GetStockProp(c => c.StockCid == tag.Cid); Alading.Entity.StockProp stockProp = gridViewStockProp.GetFocusedRow() as Alading.Entity.StockProp; if (stockProp != null) { gridCtrlStockPropValue.DataSource = StockPropValueService.GetStockPropValue(c => c.StockPid == stockProp.StockPid); } else { gridCtrlStockPropValue.DataSource = null; } } } else if (fnode != null) { TreeListNodeTag tag = fnode.Tag as TreeListNodeTag; textCatCode.Text = tag.Cid; textCatName.Text = fnode.GetDisplayText(0); gridCtrlStockProp.DataSource = StockPropService.GetStockProp(c => c.StockCid == tag.Cid); Alading.Entity.StockProp stockProp = gridViewStockProp.GetFocusedRow() as Alading.Entity.StockProp; if (stockProp != null) { gridCtrlStockPropValue.DataSource = StockPropValueService.GetStockPropValue(c => c.StockPid == stockProp.StockPid); } else { gridCtrlStockPropValue.DataSource = null; } } }
private bool MatchCondition(TreeListNode node) { if (node == null) { return(true); } if (node.GetDisplayText(FieldName).Contains(Text)) { return(true); } return(false); }
/// <summary> /// 获取选中节点到根节点的所有信息 /// </summary> /// <param name="focusedNode">TreeListNode</param> /// <param name="columnID">列名称</param> /// <param name="buildPathRule">规则委托</param> /// <returns>路径信息</returns> public static string FullPathInfo(this TreeListNode focusedNode, string columnID, BuildPathRule buildPathRule) { if (focusedNode == null) { throw new ArgumentNullException("focusedNode"); } if (string.IsNullOrEmpty("columnID")) { throw new ArgumentNullException("columnID"); } string _fullPathInfo = string.Empty; _fullPathInfo = focusedNode.GetDisplayText(columnID); while (focusedNode.ParentNode != null) { focusedNode = focusedNode.ParentNode; string _nodeText = focusedNode.GetDisplayText(columnID).Trim(); _fullPathInfo = buildPathRule(_nodeText, _fullPathInfo); } return(_fullPathInfo); }
private static bool IsNodeMatchFilter(TreeListNode node, TreeListColumn column) { var filterValue = column.FilterInfo.AutoFilterRowValue.ToString(); if (node.GetDisplayText(column) .ToLower() .Contains(filterValue.ToLower())) { return true; } foreach (TreeListNode n in node.Nodes) { if (IsNodeMatchFilter(n, column)) { return true; } } return false; }
bool IsNodeMatchFilter(TreeListNode node, TreeListColumn column) { string filterValue = treeListPhong.FindFilterText; if (node.GetDisplayText(column).ToUpper().Contains(filterValue.ToUpper())) return true; foreach (TreeListNode n in node.Nodes) if (IsNodeMatchFilter(n, column)) return true; return false; }
private void RefreshResList(TreeListNode node) { if (IsChanged()) { DialogResult rst = EFMessageBox.Show(EP.EPES.EPESC0000089/*已修改群组资源权限,是否保存?*/, EP.EPES.EPESC0000024, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rst == DialogResult.Yes) { SaveAuth(); } } listFormGrant.Clear(); listFormRevok.Clear(); listButtGrant.Clear(); listButtRevok.Clear(); subjType = GetSubjType(node); if (node.Tag != null) { subjEname = node.Tag.ToString(); } else { subjEname = treeListUser.FocusedNode.GetValue("ID").ToString(); } subjDescript = node.GetDisplayText(2) == null ? "" : node.GetDisplayText(2); if (treeListForm.Nodes.Count == 0) { QryAuthForm(); } else { RefreshFormList(); } }
bool IsNodeMatchFilter(TreeListNode node, TreeListColumn column) { string filterValue = treeListViTri.FindFilterText; if (StringHelper.CoDauThanhKhongDau(node.GetDisplayText(column)).ToUpper().Contains(StringHelper.CoDauThanhKhongDau(filterValue).ToUpper())) return true; foreach (TreeListNode n in node.Nodes) if (IsNodeMatchFilter(n, column)) return true; return false; }
bool IsNodeMatchFilter(TreeListNode node, TreeListColumn column) { string filterValue = getValue(treeListLookUpDonViTreeList.FilterPanelText); if (StringHelper.CoDauThanhKhongDau(node.GetDisplayText(column).ToUpper()).Contains(StringHelper.CoDauThanhKhongDau(filterValue.ToUpper()))) return true; foreach (TreeListNode n in node.Nodes) if (IsNodeMatchFilter(n, column)) return true; return false; }
private bool InsertNodeToTree(TreeListNode node, TreeListNode targetNode) { TreeListNode parentNode = (targetNode.ImageIndex == FORMICON) ? targetNode.ParentNode : targetNode; int treeseq = parentNode.Nodes.Count; if (treeseq == 999) { MessageBox.Show("节点数量超过系统上限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } EI.EIInfo inBlock = new EI.EIInfo(); EI.EIInfo outBlock; inBlock.SetColName(1, 1, "fname"); inBlock.SetColName(1, 2, "name"); inBlock.SetColName(1, 3, "resname"); inBlock.SetColName(1, 4, "description"); inBlock.SetColName(1, 5, "shortcut"); inBlock.SetColName(1, 6, "treeno"); inBlock.SetColName(1, 7, "treeseq"); inBlock.SetColName(1, 8, "userid"); //string nodeName = node.Tag.ToString(); string nodeText = node.GetDisplayText(treeListColumn1); string nodeResName = nodeText.Substring(nodeText.IndexOf('(') + 1, nodeText.Length - 1 - nodeText.IndexOf('(') -1); string nodeDesc = nodeText.Substring(0, nodeText.IndexOf('(')); int nodeSeq = parentNode.Nodes.Count ; string parentNodeName = ""; parentNodeName = (parentNode.ImageIndex == FORMICON) ? parentNode.ParentNode.Tag.ToString() : parentNode.Tag.ToString(); inBlock.SetColVal(1, 1, "name", parentNodeName + nodeResName); inBlock.SetColVal(1, 1, "fname", parentNodeName); inBlock.SetColVal(1, 1, "description", nodeDesc); inBlock.SetColVal(1, 1, "shortcut", " "); inBlock.SetColVal(1, 1, "resname", nodeResName); inBlock.SetColVal(1, 1, "treeno", "0"); inBlock.SetColVal(1, 1, "treeseq", nodeSeq.ToString("d3")); inBlock.AddNewBlock(); inBlock.SetColName(1, "NAME"); inBlock.SetColVal(2, 1, 1, parentNodeName); inBlock.SetColName(2, "cursystem"); inBlock.SetColVal(2, 1, 2, comboApp.EditValue.ToString().Split(':')[0]); outBlock = EI.EITuxedo.CallService("epestree_insb", inBlock); if (outBlock.sys_info.flag != 0) { ShowReturnMsg(outBlock); return false; } return true; }