Пример #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (FromProperty == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "FromProperty");
     }
     if (GrossDailyRate == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "GrossDailyRate");
     }
     if (GroupId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "GroupId");
     }
     if (RatePlanId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "RatePlanId");
     }
     if (To == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "To");
     }
     if (GrossDailyRate != null)
     {
         GrossDailyRate.Validate();
     }
 }
Пример #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (GrossDailyRate == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "GrossDailyRate");
     }
     if (Group == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Group");
     }
     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 (UnitGroup == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "UnitGroup");
     }
     if (Actions != null)
     {
         foreach (var element in Actions)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (GrossDailyRate != null)
     {
         GrossDailyRate.Validate();
     }
     if (Group != null)
     {
         Group.Validate();
     }
     if (Property != null)
     {
         Property.Validate();
     }
     if (RatePlan != null)
     {
         RatePlan.Validate();
     }
     if (UnitGroup != null)
     {
         UnitGroup.Validate();
     }
 }