예제 #1
0
 public static bool IsValid(this IOrder order)
 {
     return(DataValidationUtil.IsUsernameValid(order.ClientUsername) &&
            DataValidationUtil.IsProductIdQuantityMapValid(order.ProductIdQuantityMap) &&
            DataValidationUtil.IsPriceValid(order.Price) &&
            (!order.DeliveryDate.HasValue || (order.DeliveryDate >= order.OrderDate)));
 }
예제 #2
0
 public static bool IsValid(this IClient client)
 {
     return(DataValidationUtil.IsUsernameValid(client.Username) &&
            DataValidationUtil.IsFirstNameValid(client.FirstName) &&
            DataValidationUtil.IsLastNameValid(client.LastName) &&
            DataValidationUtil.IsStreetValid(client.Street) &&
            DataValidationUtil.IsStreetNumberValid(client.StreetNumber) &&
            DataValidationUtil.IsPhoneNumberValid(client.PhoneNumber));
 }
예제 #3
0
 public static bool IsValid(this IProduct product)
 {
     return(product.Name.IsTrimmedNonEmpty() &&
            DataValidationUtil.IsPriceValid(product.Price));
 }