using MudBlazor; using static HotelPms.Client.Blazor.Util.SystemEnum; namespace HotelPms.Client.Blazor.ViewModel { public class ValidField { public int Index { get; set; } = -1; public MudTextField Ref { get; set; } /// /// コード・名称の制御有効かどうか /// public bool DispNameEnabled { get; set; } = false; /// /// 表示名称 /// public string DispText { get; set; } = String.Empty; /// /// 表示名称の幅 /// public int DispWidthUnit { get; set; } = 6; /// /// コード・名称の制御の /// 名称表示コントロール /// public MudField RefDispName { get; set; } /// /// 名称(キーとして使用) /// DBの列名と一致すること /// public string Name { get; set; } = string.Empty; public string Caption { get; set; } = string.Empty; //private string m_Text = string.Empty; /// /// @bind-Value用項目 /// public string Text { get; set; } = string.Empty; /// /// フォーカス入る時点の値の退避 /// public string OrgText { get; set; } = string.Empty; /// /// DB中の値 /// public object Value { get; set; } /// /// 必要な時使う /// public object Tag { get; set; } public bool Error { get; set; } /// /// 使用不可 /// public bool Disabled { get; set; } /// /// 一覧検索時のフィルター対象かどうか /// public bool GridFilter { get; set; } /// /// 一覧表示時の順番 /// public int GridOrder { get; set; } /// /// 入力エラーメッセージ /// public string ErrorText { get; set; } = string.Empty; /// /// 入力必須かどうか /// public bool Required { get; set; } public EInputChar InputChar { get; set; } = EInputChar.None; public EShowStyle ShowStyle { get; set; } = EShowStyle.None; public string ThousandFormat { get; set; } = "N0"; public EInputStyle InputStyle { get; set; } = EInputStyle.Normal; public int MaxLenth { get; set; } = 50; /// /// 入力範囲 /// "'A','E','F'" OR "'1','2','21'" OR "[1,10]" OR "(1,10)" OR "[1,10)" OR "(1,10]" /// ※空白の時しない /// public string Range { get; set; } = string.Empty; /// /// textareaかどうか /// public bool MultiLine { get; set; } /// /// xsモードで一行最大12単位 /// public int WidthUnit { get; set; } = 6; /// /// 配置した後に改行するかしないか /// public bool NewLine { get; set; } = false; public bool ReadOnly { get; set; } = false; /// /// 値をクリアする /// public void Clear() { Disabled = false; Text = string.Empty; Value = null; OrgText = string.Empty; Error = false; ErrorText = string.Empty; } } }