// ========================================================== static void DumpTerm ( [NotNull] string term ) { MarcRecord[] records = connection.SearchRead("\"" + term + "\""); Console.WriteLine ( "{0} MFN={1}", term, StringUtility.Join(", ", records.Select(r => r.Mfn)) ); if (records.Length > 1) { DoubleCount++; } for (int i = 1; i < records.Length; i++) { FieldDifference[] diff = RecordComparator.FindDifference2 ( records[0], records[i], ResiduaryTags ) .ToArray(); FieldDifference[] modified = diff .Where(line => line.State != FieldState.Unchanged) .ToArray(); if (modified.Length == 0) { Console.WriteLine("No difference found"); FullDoubleCount++; if (DeleteDoubles) { connection.DeleteRecord(records[i].Mfn); Console.WriteLine("Deleted"); } } foreach (FieldDifference line in diff) { Console.WriteLine(line.ToString()); } Console.WriteLine(); } Console.WriteLine(new string('=', 70)); Console.WriteLine(); }
public RecordEnumeration EnumerateRecords(RecordFilter filter, RecordComparator comparator, bool keepUpdated) { CheckOpen("enumerateRecords"); if (filter != null) { throw new Exception("enumerateRecords with RecordFilter Unimplemented"); } if (comparator != null) { throw new Exception("enumerateRecords with RecordComparator Unimplemented"); } if (keepUpdated) { throw new Exception("enumerateRecords with keepUpdated Unimplemented"); } return(new RecordEnumerationImpl(records)); }
private void DumpTerm ( string termText ) { if (termText.SameString(Prefix)) { return; } string expression = "\"" + termText + "\""; int count; try { count = Connection.SearchCount(expression); } catch (Exception ex) { AppendLog("Сбой при поиске: {0}", expression); AppendLog(ex.Message); return; } if (count > 3) { AppendLog ( "{0} МНОГО ЗАПИСЕЙ: {1}", termText, count ); return; } if (count <= 1) { return; } MarcRecord[] records = Connection.SearchRead(expression); AppendLog ( "{0} MFN={1}", termText, StringUtility.Join(", ", records.Select(r => r.Mfn)) ); if (NeedDump) { for (int i = 1; i < records.Length; i++) { FieldDifference[] diff = RecordComparator.FindDifference2 ( records[0], records[i], ResiduaryTags ) .ToArray(); FieldDifference[] modified = diff .Where(line => line.State != FieldState.Unchanged) .ToArray(); if (modified.Length == 0) { AppendLog("Различий между записями нет"); } foreach (FieldDifference line in diff) { AppendLog(line.ToString()); } AppendLog(string.Empty); } AppendLog(new string('=', 70)); AppendLog(string.Empty); } }
public RecordEnumeration EnumerateRecords(RecordFilter filter, RecordComparator comparator, bool keepUpdated) { CheckOpen("enumerateRecords"); if (filter != null) { throw new Exception("enumerateRecords with RecordFilter Unimplemented"); } if (comparator != null) { throw new Exception("enumerateRecords with RecordComparator Unimplemented"); } if (keepUpdated) { throw new Exception("enumerateRecords with keepUpdated Unimplemented"); } return new RecordEnumerationImpl(records); }