| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using FluentValidation;
- using GreenTree.Nachtragsmanagement.Web.Models.Deviation;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace GreenTree.Nachtragsmanagement.Web.Validation.Admin.User
- {
- public class DeviationDataModelValidator : AbstractValidator<DeviationDataModel>
- {
- public DeviationDataModelValidator()
- {
- RuleFor(m => m.CustomNumber)
- .NotEmpty()
- .WithMessage("Eigene ID wird benötigt")
- .MaximumLength(10)
- .WithMessage("Muss unter 10 Zeichen sein");
- RuleFor(m => m.ReceiptDate)
- .NotEmpty()
- .WithMessage("Eingangsdatum wird benötigt");
- RuleFor(m => m.Value)
- .NotEmpty()
- .WithMessage("Ein Wert wird benötigt");
- RuleFor(m => m.StatusId)
- .NotEmpty()
- .WithMessage("Ein Status muss gewählt werden");
- RuleFor(m => m.DisturbanceId)
- .NotEmpty()
- .WithMessage("Ein Status muss gewählt werden");
- RuleFor(m => m.KindId)
- .NotEmpty()
- .WithMessage("Ein Status muss gewählt werden");
- RuleFor(m => m.Comment)
- .NotEmpty()
- .WithMessage("Ein Kommentar wird benötigt");
- }
- }
- }
|