static void ProcessNumber ( string number ) { int[] found = irbis.ExactSearch(string.Format ( "IN={0}", number )); if (found.Length == 0) { return; } int mfn = found[0]; irbis.ReadRecord(mfn); NativeRecord native = irbis.GetRecord(); MarcRecord record = native.ToMarcRecord(); string description = irbis.FormatRecord(mfn); int count = record.FM(999).SafeToInt32(); Console.WriteLine ( "{0}\t{1}\t{2}", number, count, description ); }
static void ProcessRecord ( int mfn ) { irbis.ReadRecord(mfn); NativeRecord record = irbis.GetRecord(); NativeField v933 = record.GetFirstField(933); if (ReferenceEquals(v933, null)) { return; } string index = v933.Value; string description; if (!magazines.ContainsKey(index)) { int[] found = irbis.ExactSearch("I=" + index); if (found.Length == 0) { return; } description = irbis.FormatRecord(found[0]); magazines.Add(index, description); } description = magazines[index]; NativeField v999 = record.GetFirstField(999); int count = ReferenceEquals(v999, null) ? 0 : v999.Value.SafeToInt32(); Console.WriteLine ( "{0}: {1}", irbis.FormatRecord(mfn), count ); counter.Augment(description, count); }