public virtual Validation.ValidationResult GetValidationResult(Validation.Level exceptionOverLevel) { var result = Validation.ValidationResult.Create(this); if (this.Id == null) { result.Add(exceptionOverLevel, "Id", Validation.Level.Error, "IDNULL", "Id can't be null"); } return(result); }
public static MessageType Convert(this Validation.Level type) { switch (type) { default: case Validation.Level.Info: return(MessageType.Info); case Validation.Level.Warning: return(MessageType.Warning); case Validation.Level.Error: return(MessageType.Error); } }
public override Validation.ValidationResult GetValidationResult(Validation.Level exceptionOverLevel) { var result = base.GetValidationResult(exceptionOverLevel); if (Code == null || Code == string.Empty) { result.Add(exceptionOverLevel, "Code", Validation.Level.Error, "NULLEMPTY", "This field cant't be null or empty"); } if (Name == null || Name == string.Empty) { result.Add(exceptionOverLevel, "Name", Validation.Level.Error, "NULLEMPTY", "This field cant't be null or empty"); } if (Description == null || Description == string.Empty) { result.Add(exceptionOverLevel, "Description", Validation.Level.Error, "NULLEMPTY", "This field cant't be null or empty"); } return(result); }
public virtual Validation.ValidationResult GetValidationResult(Validation.Level exceptionOverLevel) { return(Validation.ValidationResult.Create(this)); }