private int GetResultCount(string RuleName) { int count = 0; DataRow[] drs = ResultsDt.Select(string.Format("CheckType='{0}'", RuleName)); if (drs == null || drs.Length == 0) { return(count); } foreach (DataRow dr in drs) { count += int.Parse(dr["ErrorCount"].ToString()); } return(count); }
private int GetResultCount(int length, int bm) { int count = 0; DataRow[] drs = ResultsDt.Select(string.Format("substring(GZBM,1,{0})='{1}'", length, bm.ToString())); if (drs == null || drs.Length == 0) { return(count); } foreach (DataRow dr in drs) { count += int.Parse(dr["ErrorCount"].ToString()); } return(count); }
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); } } }