private CompareGroup CompareResult(ResGroup rsGroup1, ResGroup rsGroup2, IgnoreList igList, string comKeys) { CompareGroup comGroup = new CompareGroup(); if (!rsGroup1.isValid() || !rsGroup2.isValid()) { throw new Exception("resGroup Invalid"); } if (rsGroup1.size() != rsGroup2.size()) { throw new Exception("res1 && res2 size Invalid"); } int szOfGroup = rsGroup1.size(); for (int i = 0; i < szOfGroup; ++i) { if (rsGroup1.columns[i] != rsGroup1.columns[i]) { throw new Exception("columns not matched."); } } if (rsGroup1.colValues.Count != rsGroup2.colValues.Count) { string exMsg = "record size not match," + rsGroup1.name + "=" + rsGroup1.colValues.Count.ToString() + " is not equal to " + rsGroup2.name + "=" + rsGroup2.colValues.Count.ToString(); throw new Exception(exMsg); } List <string> keys = comKeys.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList(); for (int i = 0; i < rsGroup1.colValues.Count; ++i) { for (int j = 0; j < szOfGroup; ++j) { if (comKeys != "") { foreach (var it in keys) { if (it == rsGroup1.columns[j]) { CompareUnit ck = comGroup.getColKey(it); if (ck == null) { ck = new CompareUnit(it); comGroup.comKeys.Add(ck); } ck.vecStr1[i] = rsGroup1.colValues[i][j]; ck.vecStr2[i] = rsGroup2.colValues[i][j]; } } } if (rsGroup1.colValues[i][j] == rsGroup2.colValues[i][j]) { continue; } if (igList.HasValue(rsGroup1.columns[j]) && rsGroup1.colValues[i][j] != "" && rsGroup2.colValues[i][j] != "") { continue; } CompareUnit cu = comGroup.getColUnit(rsGroup1.columns[j]); if (cu == null) { cu = new CompareUnit(rsGroup1.columns[j]); comGroup.comUnits.Add(cu); } cu.vecStr1[i] = rsGroup1.colValues[i][j]; cu.vecStr2[i] = rsGroup2.colValues[i][j]; } } return(comGroup); }