Добавьте файлы проекта.

This commit is contained in:
FrigaT
2026-01-05 00:29:19 +03:00
committed by FrigaT
parent 76a09d80d4
commit d0653c2098
105 changed files with 6729 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
using SQLVision.Core.Enums;
using System.Text.Json.Serialization;
namespace SQLVision.Core.Models;
public class ScriptParameter
{
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
[JsonPropertyName("type")]
public ParameterType Type { get; set; } = ParameterType.String;
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("defaultValue")]
public object? DefaultValue { get; set; }
[JsonPropertyName("isRequired")]
public bool IsRequired { get; set; } = false;
[JsonPropertyName("order")]
public int Order { get; set; } = 0;
[JsonPropertyName("group")]
public string? Group { get; set; }
[JsonPropertyName("tableQuery")]
public string? TableQuery { get; set; }
[JsonPropertyName("valueMember")]
public string ValueMember { get; set; } = "Id";
[JsonPropertyName("displayMember")]
public string DisplayMember { get; set; } = "Name";
[JsonPropertyName("dependsOn")]
public string? DependsOn { get; set; }
[JsonPropertyName("dependencyValues")]
public Dictionary<string, object>? DependencyValues { get; set; }
[JsonPropertyName("validationRules")]
public Dictionary<string, object>? ValidationRules { get; set; }
[JsonPropertyName("watermark")]
public string? Watermark { get; set; }
[JsonPropertyName("icon")]
public string? Icon { get; set; }
[JsonIgnore]
public string EffectiveDisplayName => DisplayName ?? Name;
public bool Validate(object? value)
{
if (IsRequired && (value == null || string.IsNullOrWhiteSpace(value.ToString())))
return false;
return true;
}
}