| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 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("Nummer wird benötigt")
- .MaximumLength(10)
- .WithMessage("Muss unter 10 Zeichen sein");
- RuleFor(m => m.Description)
- .NotEmpty()
- .WithMessage("Beschreibung wird benötigt");
- //RuleFor(m => m.ReceiptDate)
- // .NotEmpty()
- // .WithMessage("Einreichdatum wird benötigt");
- RuleFor(m => m.Value)
- .NotEmpty()
- .WithMessage("Eine Schätzung wird benötigt");
- RuleFor(m => m.Percentage)
- .NotEmpty()
- .WithMessage("Eine Bewertung wird benötigt");
- RuleFor(m => m.StatusId)
- .NotEmpty()
- .WithMessage("Ein Status muss gewählt werden");
- RuleFor(m => m.DisturbanceValues)
- .Must(r => r.Count > 0)
- .WithMessage("Eine Kategorie muss ausgewählt werden");
- RuleFor(m => m.KindId)
- .NotEmpty()
- .WithMessage("Eine Art muss gewählt werden");
- RuleFor(m => m.Comment)
- .NotEmpty()
- .WithMessage("Ein Kommentar wird benötigt");
- }
- }
- }
|