Got the sliders extracted to their own page
This commit is contained in:
@@ -3,22 +3,20 @@
|
||||
using OpenArchival.DataAccess;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
public class ArtifactEntryValidationModel
|
||||
public class ArtifactEntryValidationModel:IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Used when translating between the validation model and the database model
|
||||
/// </summary>
|
||||
public int? Id { get; set; }
|
||||
|
||||
[Required(AllowEmptyStrings = false, ErrorMessage = "An artifact numbering must be supplied")]
|
||||
public string? ArtifactNumber { get; set; }
|
||||
public string ArtifactNumber { get; set; }
|
||||
|
||||
[Required(AllowEmptyStrings = false, ErrorMessage = "A title must be provided")]
|
||||
public string? Title { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? Type { get; set; }
|
||||
public string Type { get; set; }
|
||||
|
||||
public string? StorageLocation { get; set; }
|
||||
|
||||
@@ -94,4 +92,19 @@ public class ArtifactEntryValidationModel
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Title))
|
||||
yield return new ValidationResult("An artifact title must be provided.", [nameof(Title)]);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(ArtifactNumber))
|
||||
yield return new ValidationResult("An artifact numbering must be supplied.", [nameof(ArtifactNumber)]);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Type))
|
||||
yield return new ValidationResult("An artifact type must be provided.", [nameof(Type)]);
|
||||
|
||||
if (string.IsNullOrEmpty(StorageLocation))
|
||||
yield return new ValidationResult("An artifact storage location must be provided.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user