using FluentValidation; using GreenTree.Nachtragsmanagement.Web.Models.Appendix; using GreenTree.Nachtragsmanagement.Web.Models.Deviation; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace GreenTree.Nachtragsmanagement.Web.Validation.Appendix { public class AppendixDataModelValidator : AbstractValidator { public AppendixDataModelValidator() { 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.OfferingDate) .NotEmpty() .WithMessage("Einreichdatum wird benötigt"); RuleFor(m => m.OfferingValue) .NotEmpty() .WithMessage("Eine Angebotssumme wird benötigt"); RuleFor(m => m.Comment) .NotEmpty() .WithMessage("Ein Kommentar wird benötigt"); } } }