2024-05-07 13:55:11 +03:30
|
|
|
@using Shared.DTOs
|
2024-05-07 17:49:02 +03:30
|
|
|
<form>
|
|
|
|
<div class="row g-3">
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label class="col-sm-4 col-form-label" style="color:red" for="inputFullName">نام کامل</label>
|
|
|
|
<InputText @bind-Value="Cus.FullName" type="text" class="form-control" id="inputFullName" placeholder="نام کامل"/>
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-md-6">
|
|
|
|
<label class="col-sm-4 col-form-label" style="color:red" for="inputcustomertype">نوع مشتری</label>
|
2024-05-07 18:00:21 +03:30
|
|
|
<select @bind="ItemSearchCustomertype" class="form-control" aria-label="Default select example" id="inputcustomertype">
|
2024-05-07 17:49:02 +03:30
|
|
|
<option value="0" style="color: #b5b5b5" selected>انتخاب کنید...</option>
|
|
|
|
<option value="1">حقیقی</option>
|
|
|
|
<option value="2">حقوقی</option>
|
|
|
|
<option value="3">مشارکت مدنی</option>
|
|
|
|
<option value="4">اتباع غیر ایرانی</option>
|
|
|
|
</select>
|
|
|
|
</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.Phone" type="text" 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="آدرس"/>
|
|
|
|
</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="پست الکترونیک"/>
|
|
|
|
</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="کد پستی"/>
|
|
|
|
</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="کد اقتصادی"/>
|
|
|
|
</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="کدملی"/>
|
|
|
|
</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="کد شعبه"/>
|
|
|
|
</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="شماره گذرنامه"/>
|
|
|
|
</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>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
2024-05-07 13:55:11 +03:30
|
|
|
@if (Cus.ID==-1)
|
|
|
|
{
|
|
|
|
<Button 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>
|
|
|
|
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="OnClickDelete" Type="ButtonType.Button">
|
|
|
|
حذف
|
|
|
|
</Button>
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
|
|
|
[Parameter] public RCustomer Cus { get; set; }
|
2024-05-07 18:00:21 +03:30
|
|
|
public int? ItemSearchCustomertype { get; set; }
|
2024-05-07 13:55:11 +03:30
|
|
|
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
|
|
|
|
|
|
|
|
public ActionInResultComponent result { get; set; }
|
|
|
|
protected override Task OnParametersSetAsync()
|
|
|
|
{
|
2024-05-07 18:00:21 +03:30
|
|
|
result = new ActionInResultComponent();
|
2024-05-07 13:55:11 +03:30
|
|
|
return base.OnParametersSetAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@functions{
|
|
|
|
public async Task OnClickDelete(){
|
|
|
|
result.Action = ComponentAction.delete;
|
2024-05-07 17:49:02 +03:30
|
|
|
await OnMultipleOfThree.InvokeAsync(result);
|
2024-05-07 13:55:11 +03:30
|
|
|
}
|
|
|
|
public async Task OnClickUpdate()
|
|
|
|
{
|
|
|
|
result.Action = ComponentAction.update;
|
|
|
|
await OnMultipleOfThree.InvokeAsync(result);
|
|
|
|
}
|
|
|
|
public async Task OnClickAdd()
|
|
|
|
{
|
2024-05-07 18:00:21 +03:30
|
|
|
if (ItemSearchCustomertype > 0)
|
|
|
|
Cus.CustomerType = (CustomerType)ItemSearchCustomertype;
|
|
|
|
Cus.ID = null;
|
|
|
|
|
2024-05-07 13:55:11 +03:30
|
|
|
result.Action = ComponentAction.add;
|
|
|
|
await OnMultipleOfThree.InvokeAsync(result);
|
|
|
|
}
|
|
|
|
}
|