fix: CRM 다이얼로그의 ClientId 바인딩을 Nullable int? 로 변경하고 CompanyName null 대비 Fallback 이름을 Name으로 매핑하여 MudSelect 초기 렌더링 Circuit 크래시 원천 차단
TaxBaik CI/CD / build-and-deploy (push) Failing after 37s
TaxBaik CI/CD / build-and-deploy (push) Failing after 37s
This commit is contained in:
@@ -107,10 +107,10 @@
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<MudForm @ref="form">
|
||||
<MudSelect T="int" @bind-Value="contractForm.ClientId" Label="고객" Required="true" Variant="Variant.Outlined" FullWidth="true" Class="mb-4">
|
||||
<MudSelect T="int?" @bind-Value="contractForm.ClientId" Label="고객" Required="true" Variant="Variant.Outlined" FullWidth="true" Class="mb-4" RequiredError="고객을 선택하세요.">
|
||||
@foreach (var client in clients)
|
||||
{
|
||||
<MudSelectItem Value="@client.Id">@client.CompanyName</MudSelectItem>
|
||||
<MudSelectItem Value="@((int?)client.Id)">@(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName)</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudTextField T="string" @bind-Value="contractForm.ContractNumber" Label="계약번호" Variant="Variant.Outlined" FullWidth="true" Class="mb-4" Required="true" />
|
||||
@@ -180,7 +180,7 @@
|
||||
{
|
||||
contractForm = new ContractForm
|
||||
{
|
||||
ClientId = clients.FirstOrDefault()?.Id ?? 0,
|
||||
ClientId = clients.FirstOrDefault()?.Id,
|
||||
StartDate = DateTime.Today
|
||||
};
|
||||
isDialogOpen = true;
|
||||
@@ -200,8 +200,9 @@
|
||||
|
||||
try
|
||||
{
|
||||
if (contractForm.ClientId == null) return;
|
||||
var newId = await ContractClient.CreateAsync(
|
||||
contractForm.ClientId,
|
||||
contractForm.ClientId.Value,
|
||||
contractForm.ContractNumber,
|
||||
contractForm.ServiceType,
|
||||
contractForm.StartDate ?? DateTime.Now,
|
||||
@@ -254,7 +255,7 @@
|
||||
|
||||
private class ContractForm
|
||||
{
|
||||
public int ClientId { get; set; }
|
||||
public int? ClientId { get; set; }
|
||||
public string ContractNumber { get; set; } = "";
|
||||
public string ServiceType { get; set; } = "";
|
||||
public DateTime? StartDate { get; set; }
|
||||
|
||||
@@ -117,16 +117,17 @@
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<MudForm @ref="form">
|
||||
<MudSelect T="int"
|
||||
<MudSelect T="int?"
|
||||
@bind-Value="scheduleForm.ClientId"
|
||||
Label="고객"
|
||||
Required="true"
|
||||
Variant="Variant.Outlined"
|
||||
FullWidth="true"
|
||||
Class="mb-4">
|
||||
Class="mb-4"
|
||||
RequiredError="고객을 선택하세요.">
|
||||
@foreach (var client in clients)
|
||||
{
|
||||
<MudSelectItem Value="@client.Id">@client.CompanyName</MudSelectItem>
|
||||
<MudSelectItem Value="@((int?)client.Id)">@(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName)</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudSelect T="string" @bind-Value="scheduleForm.FilingType" Label="신고 유형" Variant="Variant.Outlined" FullWidth="true" Class="mb-4" Required="true">
|
||||
@@ -197,7 +198,7 @@
|
||||
{
|
||||
FilingYear = DateTime.Now.Year,
|
||||
DueDate = DateTime.Today,
|
||||
ClientId = clients.FirstOrDefault()?.Id ?? 0
|
||||
ClientId = clients.FirstOrDefault()?.Id
|
||||
};
|
||||
isDialogOpen = true;
|
||||
}
|
||||
@@ -216,8 +217,9 @@
|
||||
|
||||
try
|
||||
{
|
||||
if (scheduleForm.ClientId == null) return;
|
||||
var newId = await TaxFilingClient.CreateAsync(
|
||||
scheduleForm.ClientId,
|
||||
scheduleForm.ClientId.Value,
|
||||
scheduleForm.FilingType,
|
||||
scheduleForm.DueDate ?? DateTime.Today,
|
||||
scheduleForm.FilingYear);
|
||||
|
||||
@@ -84,10 +84,10 @@ else
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<MudForm @ref="form">
|
||||
<MudSelect T="int" @bind-Value="profileForm.ClientId" Label="고객" Required="true" Variant="Variant.Outlined" FullWidth="true" Class="mb-4">
|
||||
<MudSelect T="int?" @bind-Value="profileForm.ClientId" Label="고객" Required="true" Variant="Variant.Outlined" FullWidth="true" Class="mb-4" RequiredError="고객을 선택하세요.">
|
||||
@foreach (var client in clients)
|
||||
{
|
||||
<MudSelectItem Value="@client.Id">@client.CompanyName</MudSelectItem>
|
||||
<MudSelectItem Value="@((int?)client.Id)">@(string.IsNullOrEmpty(client.CompanyName) ? client.Name : client.CompanyName)</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudSelect T="string" @bind-Value="profileForm.BusinessType" Label="사업 유형" Variant="Variant.Outlined" FullWidth="true" Class="mb-4" Required="true">
|
||||
@@ -166,7 +166,7 @@ else
|
||||
editingProfile = null;
|
||||
profileForm = new TaxProfileForm
|
||||
{
|
||||
ClientId = clients.FirstOrDefault()?.Id ?? 0,
|
||||
ClientId = clients.FirstOrDefault()?.Id,
|
||||
TaxRiskLevel = "normal",
|
||||
NextFilingDueDate = DateTime.Today.AddMonths(1)
|
||||
};
|
||||
@@ -202,15 +202,11 @@ else
|
||||
|
||||
try
|
||||
{
|
||||
if (isEditMode)
|
||||
if (isEditMode && editingProfile != null)
|
||||
{
|
||||
await TaxProfileClient.UpdateAsync(
|
||||
editingProfile!.Id,
|
||||
profileForm.BusinessType,
|
||||
null,
|
||||
profileForm.NextFilingDueDate,
|
||||
profileForm.TaxRiskLevel);
|
||||
Snackbar.Add("세무 프로필이 업데이트되었습니다.", Severity.Success);
|
||||
await TaxProfileClient.UpdateAsync(editingProfile.Id, profileForm.BusinessType,
|
||||
null, profileForm.NextFilingDueDate, profileForm.TaxRiskLevel);
|
||||
Snackbar.Add("세무 프로필이 수정되었습니다.", Severity.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user