Beispiel #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (InstructionIdentification == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "InstructionIdentification");
     }
     if (CurrencyOfTransfer == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CurrencyOfTransfer");
     }
     if (InstructedAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "InstructedAmount");
     }
     if (CreditorAccount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CreditorAccount");
     }
     if (InstructedAmount != null)
     {
         InstructedAmount.Validate();
     }
     if (ExchangeRateInformation != null)
     {
         ExchangeRateInformation.Validate();
     }
     if (DebtorAccount != null)
     {
         DebtorAccount.Validate();
     }
     if (CreditorAccount != null)
     {
         CreditorAccount.Validate();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ConsentId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ConsentId");
     }
     if (Initiation == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Initiation");
     }
     if (Charges != null)
     {
         foreach (var element in Charges)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ExchangeRateInformation != null)
     {
         ExchangeRateInformation.Validate();
     }
     if (Initiation != null)
     {
         Initiation.Validate();
     }
     if (Authorisation != null)
     {
         Authorisation.Validate();
     }
 }