Got the sliders extracted to their own page

This commit is contained in:
2026-03-08 18:36:49 -04:00
parent dde9ffcedb
commit 28d90fcc18
375 changed files with 2646 additions and 1035 deletions

View File

@@ -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.");
}
}