cus end
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-auto">
|
||||
<button type="submit" @onclick="()=>CustomerItem(null)" class="btn btn-primary">جدید</button>
|
||||
<button type="submit" @onclick="()=>CustomerItem(0)" class="btn btn-primary">جدید</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,7 +77,7 @@
|
||||
@* data *@
|
||||
@if (request != null)
|
||||
{
|
||||
<LTable ModelinComponent="request?.list" />
|
||||
<LTable ModelinComponent="request?.list" OnMultipleOfThree="EventCallback.Factory.Create<int>(this,CustomerItem)" />
|
||||
@* pagination *@
|
||||
<p style="color:red">@request?.RowCount آیتم یافت شد</p>
|
||||
<nav aria-label="Page navigation">
|
||||
@@ -172,10 +172,10 @@
|
||||
if (result.Action == ComponentAction.add)
|
||||
{
|
||||
if (result.Status==ComponentStatus.success)
|
||||
ShowSuccessAlert("مشتری جدید با موفقیت اضافه شد");
|
||||
|
||||
ShowSuccessAlert("مشتری جدید با موفقیت اضافه شد");
|
||||
|
||||
}
|
||||
else if (result.Action == ComponentAction.update)
|
||||
else if (result.Action == ComponentAction.update)
|
||||
{
|
||||
if (result.Status == ComponentStatus.success)
|
||||
ShowSuccessAlert("اطلاعات مشتری با موفقیت ویرایش شد");
|
||||
@@ -183,23 +183,25 @@
|
||||
else if (result.Action == ComponentAction.delete)
|
||||
{
|
||||
if (result.Status == ComponentStatus.success)
|
||||
ShowSuccessAlert("مشتری با موفقیت حذف شد");
|
||||
ShowSuccessAlert("مشتری با موفقیت حذف شد");
|
||||
}
|
||||
|
||||
if (result.Status == ComponentStatus.success)
|
||||
await LoadCus(1);
|
||||
await LoadCus(1);
|
||||
|
||||
await modal.HideAsync();
|
||||
}
|
||||
public async Task CustomerItem(int? ID)
|
||||
public async Task CustomerItem(int ID)
|
||||
{
|
||||
|
||||
var parameters = new Dictionary<string, object>();
|
||||
|
||||
if(ID == null) parameters.Add("Cus", new RCustomer(){ID=-1});
|
||||
else parameters.Add("Cus", request.list.Where(w=>w.ID==ID));
|
||||
if(ID == 0) parameters.Add("Cus", new RCustomer(){ID=0});
|
||||
else parameters.Add("Cus", request.list.Where(w=>w.ID==ID).First().Clone());
|
||||
|
||||
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBackCustomerItem));
|
||||
await modal.ShowAsync<CustomerItem>(title: ID == null ? "مشتری جدید" : "ویرایش اطلاعات", parameters: parameters);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user