Example #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (BaseAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "BaseAmount");
     }
     if (RatePlan == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "RatePlan");
     }
     if (TotalGrossAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TotalGrossAmount");
     }
     if (UnitGroup == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "UnitGroup");
     }
     if (Actions != null)
     {
         foreach (var element in Actions)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (BaseAmount != null)
     {
         BaseAmount.Validate();
     }
     if (IncludedServices != null)
     {
         foreach (var element1 in IncludedServices)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (RatePlan != null)
     {
         RatePlan.Validate();
     }
     if (TotalGrossAmount != null)
     {
         TotalGrossAmount.Validate();
     }
     if (Unit != null)
     {
         Unit.Validate();
     }
     if (UnitGroup != null)
     {
         UnitGroup.Validate();
     }
 }
Example #2
0
 public int GetIdempotentKey()
 {
     unchecked
     {
         int hashCode = Currency?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ DiscountAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ Items.GetIdempotentListKey();
         hashCode = (hashCode * 397) ^ TotalGrossAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalNetAmount.GetHashCode();
         return(hashCode);
     }
 }
Example #3
0
 public int GetIdempotentKey()
 {
     unchecked
     {
         int hashCode = Currency?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ DiscountAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ (ImageUrl?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ LineItems.GetIdempotentListKey();
         hashCode = (hashCode * 397) ^ (MerchantImageUrl?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Number?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ TotalGrossAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalNetAmount.GetHashCode();
         return(hashCode);
     }
 }
Example #4
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (CancellationFee == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CancellationFee");
     }
     if (NoShowFee == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "NoShowFee");
     }
     if (PrePaymentAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "PrePaymentAmount");
     }
     if (RatePlan == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "RatePlan");
     }
     if (TaxDetails == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TaxDetails");
     }
     if (TimeSlices == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TimeSlices");
     }
     if (TotalGrossAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TotalGrossAmount");
     }
     if (UnitGroup == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "UnitGroup");
     }
     if (CancellationFee != null)
     {
         CancellationFee.Validate();
     }
     if (CityTax != null)
     {
         CityTax.Validate();
     }
     if (NoShowFee != null)
     {
         NoShowFee.Validate();
     }
     if (PrePaymentAmount != null)
     {
         PrePaymentAmount.Validate();
     }
     if (RatePlan != null)
     {
         RatePlan.Validate();
     }
     if (TaxDetails != null)
     {
         foreach (var element in TaxDetails)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (TimeSlices != null)
     {
         foreach (var element1 in TimeSlices)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (TotalGrossAmount != null)
     {
         TotalGrossAmount.Validate();
     }
     if (UnitGroup != null)
     {
         UnitGroup.Validate();
     }
     if (ValidationMessages != null)
     {
         foreach (var element2 in ValidationMessages)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (CancellationFee == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CancellationFee");
     }
     if (Id == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Id");
     }
     if (Property == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Property");
     }
     if (RatePlan == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "RatePlan");
     }
     if (TotalGrossAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TotalGrossAmount");
     }
     if (UnitGroup == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "UnitGroup");
     }
     if (CancellationFee != null)
     {
         CancellationFee.Validate();
     }
     if (Company != null)
     {
         Company.Validate();
     }
     if (PaymentAccount != null)
     {
         PaymentAccount.Validate();
     }
     if (Property != null)
     {
         Property.Validate();
     }
     if (RatePlan != null)
     {
         RatePlan.Validate();
     }
     if (Services != null)
     {
         foreach (var element in Services)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (TotalGrossAmount != null)
     {
         TotalGrossAmount.Validate();
     }
     if (UnitGroup != null)
     {
         UnitGroup.Validate();
     }
 }
Example #6
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (CancellationFee == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CancellationFee");
     }
     if (NoShowFee == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "NoShowFee");
     }
     if (TaxDetails == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TaxDetails");
     }
     if (TimeSlices == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TimeSlices");
     }
     if (TotalGrossAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TotalGrossAmount");
     }
     if (CancellationFee != null)
     {
         CancellationFee.Validate();
     }
     if (CityTax != null)
     {
         CityTax.Validate();
     }
     if (NoShowFee != null)
     {
         NoShowFee.Validate();
     }
     if (Services != null)
     {
         foreach (var element in Services)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (TaxDetails != null)
     {
         foreach (var element1 in TaxDetails)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (TimeSlices != null)
     {
         foreach (var element2 in TimeSlices)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
     if (TotalGrossAmount != null)
     {
         TotalGrossAmount.Validate();
     }
     if (ValidationMessages != null)
     {
         foreach (var element3 in ValidationMessages)
         {
             if (element3 != null)
             {
                 element3.Validate();
             }
         }
     }
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Balance == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Balance");
     }
     if (BookingId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "BookingId");
     }
     if (CancellationFee == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CancellationFee");
     }
     if (Id == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Id");
     }
     if (NoShowFee == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "NoShowFee");
     }
     if (PrimaryGuest == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "PrimaryGuest");
     }
     if (Property == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Property");
     }
     if (RatePlan == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "RatePlan");
     }
     if (TotalGrossAmount == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TotalGrossAmount");
     }
     if (UnitGroup == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "UnitGroup");
     }
     if (Actions != null)
     {
         foreach (var element in Actions)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (AdditionalGuests != null)
     {
         foreach (var element1 in AdditionalGuests)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (AssignedUnits != null)
     {
         foreach (var element2 in AssignedUnits)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
     if (Balance != null)
     {
         Balance.Validate();
     }
     if (Booker != null)
     {
         Booker.Validate();
     }
     if (CancellationFee != null)
     {
         CancellationFee.Validate();
     }
     if (CityTax != null)
     {
         CityTax.Validate();
     }
     if (Commission != null)
     {
         Commission.Validate();
     }
     if (Company != null)
     {
         Company.Validate();
     }
     if (NoShowFee != null)
     {
         NoShowFee.Validate();
     }
     if (PaymentAccount != null)
     {
         PaymentAccount.Validate();
     }
     if (PrimaryGuest != null)
     {
         PrimaryGuest.Validate();
     }
     if (Property != null)
     {
         Property.Validate();
     }
     if (RatePlan != null)
     {
         RatePlan.Validate();
     }
     if (Services != null)
     {
         foreach (var element3 in Services)
         {
             if (element3 != null)
             {
                 element3.Validate();
             }
         }
     }
     if (TimeSlices != null)
     {
         foreach (var element4 in TimeSlices)
         {
             if (element4 != null)
             {
                 element4.Validate();
             }
         }
     }
     if (TotalGrossAmount != null)
     {
         TotalGrossAmount.Validate();
     }
     if (Unit != null)
     {
         Unit.Validate();
     }
     if (UnitGroup != null)
     {
         UnitGroup.Validate();
     }
     if (ValidationMessages != null)
     {
         foreach (var element5 in ValidationMessages)
         {
             if (element5 != null)
             {
                 element5.Validate();
             }
         }
     }
 }