private int GetLayersResultCount(string layerName) { int count = 0; DataRow[] drs = LayersResultsDt.Select(string.Format("TaretFeatClass1='{0}'", layerName)); if (drs == null || drs.Length == 0) { return(count); } foreach (DataRow dr in drs) { count += int.Parse(dr["ErrCount"].ToString()); } return(count); }
private void AppendSubResultNode(string layerName, TreeListNode parentNode) { DataRow[] drs = LayersResultsDt.Select(string.Format("TaretFeatClass1='{0}'", layerName)); if (drs == null || drs.Length == 0) { return; } foreach (DataRow dr in drs) { string str = string.Format("{0} ({1})", dr["CheckType"].ToString(), dr["ErrCount"].ToString()); TreeListNode node = treeListRule.AppendNode(new object[] { str, dr["CheckType"].ToString(), dr["ErrCount"].ToString(), dr["RuleId"].ToString() }, parentNode); node.Checked = treeListRule.OptionsView.ShowCheckBoxes; } }
private object GetSubResultsSource(TreeListNode node) { TreeList tempList = null; if (node.Level == 0) { tempList = new TreeList(); TreeListColumn col = tempList.Columns.Add(); col.Caption = "规则分类"; col.Name = "TypeName"; col.FieldName = "TypeName"; col.Visible = true; col.OptionsColumn.AllowEdit = false; col = tempList.Columns.Add(); col.Caption = "错误个数"; col.Name = "ErrCount"; col.FieldName = "ErrCount"; col.Visible = true; col.OptionsColumn.AllowEdit = false; TreeListNode rootNode = tempList.AppendNode(new object[] { "root", "0" }, null); //rootNode.StateImageIndex = 0; AddNode(tempList, node.Nodes, rootNode); return(rootNode); } else if (node.HasChildren) { tempList = new TreeList(); TreeListColumn col = tempList.Columns.Add(); col.Caption = "规则分类"; col.Name = "TypeName"; col.FieldName = "TypeName"; col.Visible = true; col.OptionsColumn.AllowEdit = false; col = tempList.Columns.Add(); col.Caption = "错误个数"; col.Name = "ErrCount"; col.FieldName = "ErrCount"; col.Visible = true; col.OptionsColumn.AllowEdit = false; //增加一级、二级节点 TreeListNode rootNode = tempList.AppendNode(new object[] { node["RuleName"], node["rulesCount"] }, null); //rootNode.StateImageIndex = 0; AddNode(tempList, node.Nodes, rootNode); return(tempList.Nodes.FirstNode); } else { if (m_RuleType == RuleShowType.DefualtType) { if (ResultsDt == null || ResultsDt.Rows.Count == 0) { return(null); } DataTable tempTable = new DataTable(); DataRow[] drs = ResultsDt.Select(string.Format("CheckType='{0}'", node["RuleName"])); if (drs == null || drs.Length == 0) { tempTable = ResultsDt.Clone(); return(tempTable); } tempTable = drs[0].Table.Clone(); foreach (DataRow dr in drs) { tempTable.ImportRow(dr); } return(tempTable); } else { if (LayersResultsDt == null || LayersResultsDt.Rows.Count == 0) { return(null); } DataRow[] drs = LayersResultsDt.Select(string.Format("targetfeatclass1='{0}'", node["CheckType"])); if (drs == null || drs.Length == 0) { return(null); } DataTable tempTable = new DataTable(); tempTable = drs[0].Table.Clone(); foreach (DataRow dr in drs) { tempTable.ImportRow(dr); } return(tempTable); } } }