public PropertyBuyerViewModel( int buyerNumber, IntendedPropertyUse intendedUse, bool firstHomeBuyer, bool isForeignBuyer, string purchaseFraction) { try { PurchaseFractionAsFraction = new Fraction(purchaseFraction); PurchaseFraction = purchaseFraction; } catch (Exception ex) { throw new ArgumentException("Invalid purchase fraction specified. The purchase fraction must either be a fraction such as 1/2, 3/8, or the number 1.", PARAM_PURCHASE_FRACTION, ex); } if (PurchaseFractionAsFraction.Numerator > PurchaseFractionAsFraction.Denominator) { throw new ArgumentException("The purchase fraction cannot be greater than 1.", PARAM_PURCHASE_FRACTION); } BuyerNumber = buyerNumber; IntendedUse = intendedUse; FirstHomeBuyer = firstHomeBuyer; IsForeignBuyer = isForeignBuyer; }
public PropertyBuyer( int buyerNumber, IntendedPropertyUse intendedUse, bool firstHomeBuyer, bool isForeignBuyer, Fraction shares) { BuyerNumber = buyerNumber; IntendedUse = intendedUse; FirstHomeBuyer = firstHomeBuyer; IsForeignBuyer = isForeignBuyer; Shares = shares; }