...
This commit is contained in:
@@ -94,16 +94,16 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
ثبت تغییرات
|
||||
</Button>
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||
حذف
|
||||
</Button>
|
||||
@if (_UsedInTheInvoice)
|
||||
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Link" @onclick="OnClickGoToInvoice" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Link" @onclick="OnClickGoToInvoice" Type="ButtonType.Button">
|
||||
صورتحساب های مرتبط
|
||||
</Button>
|
||||
}
|
||||
@@ -139,6 +139,7 @@ else
|
||||
Hidealert = true;
|
||||
alertMessage = "";
|
||||
await UsedInTheInvoice();
|
||||
SpinnerVisible = false;
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
}
|
||||
|
@@ -30,11 +30,11 @@
|
||||
<label class="col-sm-4 col-form-label" style="color:red" for="inputFullName">نام کامل</label>
|
||||
@if (Cus.ID == 0 || !_UsedInTheInvoice)
|
||||
{
|
||||
<InputText @bind-Value="Cus.FullName" type="text" class="form-control" id="inputFullName" placeholder="نام کامل" />
|
||||
<InputText style="text-align:center" @bind-Value="Cus.FullName" type="text" class="form-control" id="inputFullName" placeholder="نام کامل" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<InputText @bind-Value="Cus.FullName" type="text" class="form-control" id="inputFullName" placeholder="نام کامل" readonly />
|
||||
<InputText style="text-align:center" @bind-Value="Cus.FullName" type="text" class="form-control" id="inputFullName" placeholder="نام کامل" readonly />
|
||||
}
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@@ -52,81 +52,85 @@
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">تلفن</label>
|
||||
<InputText @bind-Value="Cus.Phone" type="text" class="form-control" id="inputPhone" placeholder="تلفن" />
|
||||
<InputText style="text-align:center" dir="ltr" @bind-Value="Cus.Phone" type="number" class="form-control" id="inputPhone" placeholder="تلفن" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">آدرس</label>
|
||||
<InputText @bind-Value="Cus.Address" type="text" class="form-control" id="inputAddress" placeholder="آدرس" />
|
||||
<InputText style="text-align:center" @bind-Value="Cus.Address" type="text" class="form-control" id="inputAddress" placeholder="آدرس" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">پست الکترونیک</label>
|
||||
<InputText @bind-Value="Cus.Email" type="email" class="form-control" id="inputEmail" placeholder="پست الکترونیک" />
|
||||
<InputText @bind-Value="Cus.Email" style="text-align:center" dir="ltr" type="email" class="form-control" id="inputEmail" placeholder="پست الکترونیک" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">کد پستی</label>
|
||||
<InputText @bind-Value="Cus.ZipCode" type="text" class="form-control" id="inputZipCode" placeholder="کد پستی" />
|
||||
<InputText style="text-align:center" dir="ltr" @bind-Value="Cus.ZipCode" type="number" class="form-control" id="inputZipCode" placeholder="کد پستی" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">کد اقتصادی</label>
|
||||
<InputText @bind-Value="Cus.EconomicCode" type="text" class="form-control" id="inputEconomicCode" placeholder="کد اقتصادی" />
|
||||
<InputText @bind-Value="Cus.EconomicCode" type="number" style="text-align:center" dir="ltr" class="form-control" id="inputEconomicCode" placeholder="کد اقتصادی" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">کدملی / شناسه ملی</label>
|
||||
<InputText @bind-Value="Cus.MeliCode" type="text" class="form-control" id="inputMeliCode" placeholder="کدملی / شناسه ملی" />
|
||||
<label class="col-sm-4 col-form-label">کد/شناسه ملی</label>
|
||||
<InputText @bind-Value="Cus.MeliCode" type="number" style="text-align:center" dir="ltr" class="form-control" id="inputMeliCode" placeholder="کدملی / شناسه ملی" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">کد شعبه</label>
|
||||
<InputText @bind-Value="Cus.BranchID" type="text" class="form-control" id="inputBranchID" placeholder="کد شعبه" />
|
||||
<InputText @bind-Value="Cus.BranchID" type="number" style="text-align:center" dir="ltr" class="form-control" id="inputBranchID" placeholder="کد شعبه" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="col-sm-4 col-form-label">شماره گذرنامه</label>
|
||||
<InputText @bind-Value="Cus.PassportNumber" type="text" class="form-control" id="inputPassportNumber" placeholder="شماره گذرنامه" />
|
||||
<InputText @bind-Value="Cus.PassportNumber" type="number" style="text-align:center" dir="ltr" class="form-control" id="inputPassportNumber" placeholder="شماره گذرنامه" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<label class="col-sm-4 col-form-label">توضیحات</label>
|
||||
<InputTextArea @bind-Value="Cus.Info" class="form-control" id="inputMeliInfo" placeholder="توضیحات" rows="3"></InputTextArea>
|
||||
<InputTextArea @bind-Value="Cus.Info" style="text-align:right" class="form-control" id="inputMeliInfo" placeholder="توضیحات" rows="3"></InputTextArea>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-10">
|
||||
@if (Cus.ID == 0)
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
||||
جدید
|
||||
</Button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
ثبت تغییرات
|
||||
</Button>
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||
حذف
|
||||
</Button>
|
||||
@if (_UsedInTheInvoice)
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Link" @onclick="OnClickGoToInvoice" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Link" @onclick="OnClickGoToInvoice" Type="ButtonType.Button">
|
||||
صورتحساب های مرتبط
|
||||
</Button>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-2" style="align-content:center">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
</div>
|
||||
@code {
|
||||
public bool SpinnerVisible { get; set; } = false;
|
||||
// alert
|
||||
AlertColor alertColor = AlertColor.Primary;
|
||||
IconName alertIconName = IconName.CheckCircleFill;
|
||||
@@ -150,6 +154,7 @@ else
|
||||
Hidealert = true;
|
||||
alertMessage = "";
|
||||
await UsedInTheInvoice();
|
||||
SpinnerVisible = false;
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
}
|
||||
@@ -174,7 +179,7 @@ else
|
||||
}
|
||||
public async Task OnClickDelete()
|
||||
{
|
||||
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
var rsp = await hc.Delete($"Customer/Delete/{Cus.ID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -193,13 +198,14 @@ else
|
||||
ShowDangerAlert("مشتری با این شناسه یافت نشد");
|
||||
}
|
||||
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
|
||||
|
||||
|
||||
}
|
||||
public async Task OnClickUpdate()
|
||||
{
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
if (ItemSearchCustomertype > 0 && !string.IsNullOrEmpty(Cus.FullName))
|
||||
{
|
||||
if (ItemSearchCustomertype > 0)
|
||||
@@ -224,9 +230,11 @@ else
|
||||
}
|
||||
}
|
||||
else ShowDangerAlert("فیلدهای قرمز باید مقدار دهی شوند");
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
}
|
||||
public async Task OnClickAdd()
|
||||
{
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
if (ItemSearchCustomertype > 0 && !string.IsNullOrEmpty(Cus.FullName))
|
||||
{
|
||||
if (ItemSearchCustomertype > 0)
|
||||
@@ -255,9 +263,11 @@ else
|
||||
}
|
||||
}
|
||||
else ShowDangerAlert("فیلدهای قرمز باید مقدار دهی شوند");
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
}
|
||||
public async Task UsedInTheInvoice()
|
||||
{
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
if (Cus.ID!=0)
|
||||
{
|
||||
var rsp = await hc.Get($"Customer/UsedInTheInvoice/{Cus.ID}");
|
||||
@@ -266,6 +276,7 @@ else
|
||||
|
||||
else _UsedInTheInvoice = false;
|
||||
}
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
|
||||
}
|
||||
private async Task ShowConfirmationDeleteAsync()
|
||||
|
Reference in New Issue
Block a user