58 lines
2.3 KiB
Plaintext
58 lines
2.3 KiB
Plaintext
@using TaxBaik.Application.Services
|
|
@using Microsoft.FluentUI.AspNetCore.Components
|
|
|
|
<form class="admin-form" @onsubmit="HandleSubmit" @onsubmit:preventDefault>
|
|
<FluentTextInput Label="회사 코드" @bind-CurrentValue="model.CompanyCode" />
|
|
<FluentTextInput Label="회사명" @bind-CurrentValue="model.CompanyName" />
|
|
<FluentTextInput Label="담당자명" @bind-CurrentValue="model.ContactPerson" />
|
|
<FluentTextInput Label="전화번호" @bind-CurrentValue="model.Phone" />
|
|
<FluentTextInput Label="이메일" @bind-CurrentValue="model.Email" />
|
|
<FluentTextArea Label="메모" @bind-CurrentValue="model.Memo" />
|
|
<label class="admin-checkbox-row">
|
|
<input type="checkbox" @bind="model.IsActive" />
|
|
<span>활성</span>
|
|
</label>
|
|
<div class="admin-form-actions">
|
|
<button type="submit" class="admin-login-submit">@ButtonText</button>
|
|
<button type="button" class="admin-secondary-button" @onclick="OnCancel">취소</button>
|
|
</div>
|
|
</form>
|
|
|
|
@code {
|
|
[Parameter, EditorRequired] public string ButtonText { get; set; } = "저장";
|
|
[Parameter] public EventCallback<CompanyFormModel> 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;
|
|
}
|
|
}
|