예제 #1
0
 public void SetupValidationRules(ModelValidator <ShipmentHistoryModel> v)
 {
     v.RuleFor(x => x.ShipmentStatus).NotEmpty().When(x => x.Id < 1);
     v.RuleFor(x => x.CreatedOn).NotEmpty().When(x => x.Id > 0);
     v.RuleFor(x => x.ShipmentId).GreaterThan(0);
 }
예제 #2
0
        public void SetupValidationRules(ModelValidator <UploadFileModel> v)
        {
            v.RuleFor(x => x.MediaFile).NotNull().Must(x => x.Length != 0);

            v.RuleFor(x => x.ProductId).GreaterThan(0);
        }
 public void SetupValidationRules(ModelValidator <ProductRelationsModel> v)
 {
     v.RuleFor(x => x.ProductId).GreaterThan(0);
     v.RuleFor(x => x.DestinationProductIds).Must(x => x.Any());
 }
예제 #4
0
 public void SetupValidationRules(ModelValidator <CreateCatalogModel> v)
 {
     v.RuleFor(x => x.Name).NotEmpty();
     v.RuleFor(x => x.SourceStoreId).GreaterThan(0);
 }
예제 #5
0
 public void SetupValidationRules(ModelValidator <CategoryModel> v)
 {
     v.RuleFor(x => x.Name).NotEmpty();
 }
예제 #6
0
 public void SetupValidationRules(ModelValidator <ReviewSearchModel> v)
 {
     v.RuleFor(x => x.Page).GreaterThan(0);
     v.RuleFor(x => x.Count).GreaterThan(0);
 }
예제 #7
0
 public void SetupValidationRules(ModelValidator <OrderDownloadModel> v)
 {
     v.RuleFor(x => x.DownloadId).GreaterThan(0);
 }
예제 #8
0
 public void SetupValidationRules(ModelValidator <ShipmentModel> v)
 {
     v.RuleFor(x => x.OrderId).GreaterThan(0);
     v.RuleFor(x => x.WarehouseId).GreaterThan(0);
 }
 public void SetupValidationRules(ModelValidator <EmailVerificationModel> v)
 {
     v.RuleFor(x => x.Code).NotEmpty();
     v.RuleFor(x => x.Email).EmailAddress().NotEmpty();
 }
예제 #10
0
 public void SetupValidationRules(ModelValidator <ManufacturerModel> v)
 {
     v.RuleFor(x => x.Name).NotEmpty();
 }
예제 #11
0
 public void SetupValidationRules(ModelValidator <ScheduledTaskModel> v)
 {
     v.RuleFor(x => x.Id).NotEmpty().GreaterThan(0);
     v.RuleFor(x => x.Seconds).NotEmpty().GreaterThanOrEqualTo(10);
 }
예제 #12
0
 public void SetupValidationRules(ModelValidator <MenuItemModel> v)
 {
     v.RuleFor(x => x.MenuId).GreaterThan(0);
     v.RuleFor(x => x.Name).NotEmpty();
     v.RuleFor(x => x.SeoMetaId).GreaterThan(0);
 }
예제 #13
0
 public void SetupValidationRules(ModelValidator <CurrencyModel> v)
 {
     v.RuleFor(x => x.Name).NotEmpty();
     v.RuleFor(x => x.IsoCode).NotEmpty();
 }
예제 #14
0
 public void SetupValidationRules(ModelValidator <DownloadModel> v)
 {
     v.RuleFor(x => x.ProductId).GreaterThan(0);
 }
예제 #15
0
 public void SetupValidationRules(ModelValidator <UploadPackageModel> v)
 {
     v.RuleFor(x => x.MediaFile).NotNull();
 }
예제 #16
0
 public void SetupValidationRules(ModelValidator <UserSearchModel> v)
 {
     v.RuleFor(x => x.RowCount).GreaterThanOrEqualTo(1).LessThanOrEqualTo(100);
     v.RuleFor(x => x.Current).GreaterThanOrEqualTo(1);
 }
예제 #17
0
 public void SetupValidationRules(ModelValidator <PluginsSearchModel> v)
 {
     v.RuleFor(x => x.Current).GreaterThan(0);
     v.RuleFor(x => x.RowCount).LessThanOrEqualTo(30).GreaterThanOrEqualTo(0);
 }
예제 #18
0
 public void SetupValidationRules(ModelValidator <WidgetModel> v)
 {
     v.RuleFor(x => x.ZoneName).NotEmpty();
     v.RuleFor(x => x.WidgetSystemName).NotEmpty();
     v.RuleFor(x => x.PluginSystemName).NotEmpty();
 }
예제 #19
0
 public void SetupValidationRules(ModelValidator <VendorModel> v)
 {
     v.RuleFor(x => x.Name).NotEmpty();
     v.RuleFor(x => x.Address).NotEmpty();
 }
예제 #20
0
 public void SetupValidationRules(ModelValidator <DiscountModel> v)
 {
     v.RuleFor(x => x.Name).NotEmpty();
 }
예제 #21
0
 public void SetupValidationRules(ModelValidator <SubscriptionModel> v)
 {
     v.RuleFor(x => x.SubscriptionGuid).NotEmpty();
     v.RuleFor(x => x.Email).NotEmpty().EmailAddress().When(x => ApplicationEngine.CurrentUser.IsVisitor());
 }
예제 #22
0
 public void SetupValidationRules(ModelValidator <AffiliateSettingsModel> v)
 {
     v.RuleFor(x => x.AffiliateCookieName).NotEmpty().When(x => x.EnableAffiliates);
 }
예제 #23
0
 public void SetupValidationRules(ModelValidator <PaymentMethodModel> v)
 {
     v.RuleFor(x => x.SystemName).NotEmpty().When(x => !x.UseStoreCredits);
 }
 public void SetupValidationRules(ModelValidator <GenerateInvitationLinkModel> v)
 {
     v.RuleFor(x => x.Email).EmailAddress();
 }
예제 #25
0
 public void SetupValidationRules(ModelValidator <SettingsModel> v)
 {
     v.RuleFor(x => x.ClientSecret).NotEmpty();
     v.RuleFor(x => x.ClientId).NotEmpty();
 }
예제 #26
0
 public void SetupValidationRules(ModelValidator <MediaUploadModel> v)
 {
     v.RuleFor(x => x.MediaFile).NotNull().Must(x => x.Length != 0);
 }
예제 #27
0
 public void SetupValidationRules(ModelValidator <ReviewModel> v)
 {
     v.RuleFor(x => x.Rating).GreaterThan(0).LessThan(6);
 }
예제 #28
0
 public void SetupValidationRules(ModelValidator <UserModel> v)
 {
     v.RuleFor(x => x.Email).NotEmpty().EmailAddress();
     v.RuleFor(x => x.FirstName).NotEmpty();
     v.RuleFor(x => x.LastName).NotEmpty();
 }
예제 #29
0
 public void SetupValidationRules(ModelValidator <StateOrProvinceModel> v)
 {
     v.RuleFor(x => x.CountryId).GreaterThan(0);
     v.RuleFor(x => x.Name).NotEmpty();
 }
예제 #30
0
 public void SetupValidationRules(ModelValidator <ProductAttributeValueModel> v)
 {
     v.RuleFor(x => x.AttributeValue).NotEmpty().When(x => x.Id == 0);
 }