/// <summary> /// Compares two specified numbers. /// </summary> /// <param name="first">The first.</param> /// <param name="second">The second.</param> /// <returns>System.Int32.</returns> public static int CompareNumbers ( [JetBrains.Annotations.NotNull] ExemplarInfo first, [JetBrains.Annotations.NotNull] ExemplarInfo second ) { NumberText one = new NumberText(first.Number); NumberText two = new NumberText(second.Number); return(one.CompareTo(two)); }
public static ExemplarInfo Parse ( [JetBrains.Annotations.NotNull] RecordField field ) { if (ReferenceEquals(field, null)) { throw new ArgumentNullException("field"); } ExemplarInfo result = new ExemplarInfo { Status = field.GetSubFieldText('a', 0), Number = field.GetSubFieldText('b', 0), Date = field.GetSubFieldText('c', 0), Place = field.GetSubFieldText('d', 0), Collection = field.GetSubFieldText('q', 0), ShelfIndex = field.GetSubFieldText('r', 0), Price = field.GetSubFieldText('e', 0), Barcode = field.GetSubFieldText('h', 0), Amount = field.GetSubFieldText('1', 0), Purpose = field.GetSubFieldText('t', 0), Coefficient = field.GetSubFieldText('=', 0), OffBalance = field.GetSubFieldText('4', 0), KsuNumber1 = field.GetSubFieldText('u', 0), ActNumber1 = field.GetSubFieldText('y', 0), Channel = field.GetSubFieldText('f', 0), OnHand = field.GetSubFieldText('2', 0), ActNumber2 = field.GetSubFieldText('v', 0), WriteOff = field.GetSubFieldText('x', 0), Completion = field.GetSubFieldText('k', 0), ActNumber3 = field.GetSubFieldText('w', 0), Moving = field.GetSubFieldText('z', 0), NewPlace = field.GetSubFieldText('m', 0), CheckedDate = field.GetSubFieldText('s', 0), CheckedAmount = field.GetSubFieldText('0', 0), RealPlace = field.GetSubFieldText('!', 0), BindingIndex = field.GetSubFieldText('p', 0), BindingNumber = field.GetSubFieldText('i', 0), OtherSubFields = field.SubFields .Where(sub => KnownCodes .IndexOf(char.ToLower(sub.Code)) < 0) .ToArray() }; return(result); }
public static ExemplarInfo Parse ( RecordField field ) { ExemplarInfo result = new ExemplarInfo { Status = field.GetSubFieldText('a', 0), Number = field.GetSubFieldText('b', 0), Date = field.GetSubFieldText('c', 0), Place = field.GetSubFieldText('d', 0), Collection = field.GetSubFieldText('q', 0), ShelfIndex = field.GetSubFieldText('r', 0), Price = field.GetSubFieldText('e', 0), Barcode = field.GetSubFieldText('h', 0), Amount = field.GetSubFieldText('1', 0), Purpose = field.GetSubFieldText('t', 0), Coefficient = field.GetSubFieldText('=', 0), OffBalance = field.GetSubFieldText('4', 0), KsuNumber1 = field.GetSubFieldText('u', 0), ActNumber1 = field.GetSubFieldText('y', 0), Channel = field.GetSubFieldText('f', 0), OnHand = field.GetSubFieldText('2', 0), ActNumber2 = field.GetSubFieldText('v', 0), WriteOff = field.GetSubFieldText('x', 0), Completion = field.GetSubFieldText('k', 0), ActNumber3 = field.GetSubFieldText('w', 0), Moving = field.GetSubFieldText('z', 0), NewPlace = field.GetSubFieldText('m', 0), CheckedDate = field.GetSubFieldText('s', 0), CheckedAmount = field.GetSubFieldText('0', 0), RealPlace = field.GetSubFieldText('!', 0) }; return(result); }