FieldConfig.cs 816 B

1234567891011121314151617181920212223242526272829
  1. namespace TravelAgencyWinForms.Models;
  2. public enum FieldKind
  3. {
  4. Text,
  5. Integer,
  6. Decimal,
  7. Date,
  8. Boolean,
  9. Lookup,
  10. Enum,
  11. Password
  12. }
  13. public sealed class FieldConfig
  14. {
  15. public string Name { get; init; } = string.Empty;
  16. public string Label { get; init; } = string.Empty;
  17. public FieldKind Kind { get; init; } = FieldKind.Text;
  18. public bool Required { get; init; }
  19. public bool IsKey { get; init; }
  20. public bool AutoIdentity { get; init; }
  21. public bool ShowInGrid { get; init; } = true;
  22. public bool ReadOnlyOnEdit { get; init; }
  23. public string? LookupSql { get; init; }
  24. public string LookupValueColumn { get; init; } = "id";
  25. public string LookupDisplayColumn { get; init; } = "name";
  26. public string[] Options { get; init; } = Array.Empty<string>();
  27. }