@using TaxBaik.Application.Services
@using Microsoft.FluentUI.AspNetCore.Components
@code {
[Parameter, EditorRequired] public string ButtonText { get; set; } = "저장";
[Parameter] public EventCallback OnSubmit { get; set; }
[Parameter] public EventCallback OnCancel { get; set; }
[Parameter] public CompanyFormModel? InitialData { get; set; }
private CompanyFormModel model = new();
protected override void OnInitialized()
{
if (InitialData != null)
{
model = new CompanyFormModel
{
CompanyCode = InitialData.CompanyCode,
CompanyName = InitialData.CompanyName,
ContactPerson = InitialData.ContactPerson,
Phone = InitialData.Phone,
Email = InitialData.Email,
Memo = InitialData.Memo,
IsActive = InitialData.IsActive
};
}
}
private Task HandleSubmit() => OnSubmit.InvokeAsync(model);
public class CompanyFormModel
{
public string CompanyCode { get; set; } = "";
public string CompanyName { get; set; } = "";
public string? ContactPerson { get; set; }
public string? Phone { get; set; }
public string? Email { get; set; }
public string? Memo { get; set; }
public bool IsActive { get; set; } = true;
}
}