...
This commit is contained in:
@@ -28,15 +28,15 @@
|
||||
{
|
||||
|
||||
<option value="@Convert.ToInt32(i)">@i.GetEnumDisplayName()</option>
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input @bind-value="itemsearch.Title" placeholder="عنوان" style="text-align:center;" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<AutoComplete @bind-Value="customerName"
|
||||
TItem="ForCustomerSearch"
|
||||
@@ -114,11 +114,11 @@
|
||||
@code {
|
||||
private string? customerName;
|
||||
public IEnumerable<ForCustomerSearch>? customers;
|
||||
|
||||
public List<IdName<int>> Patterns { get; set; }
|
||||
private async Task<AutoCompleteDataProviderResult<ForCustomerSearch>> CustomersDataProvider(AutoCompleteDataProviderRequest<ForCustomerSearch> request)
|
||||
{
|
||||
if (customers is null) // pull customers only one time for client-side autocomplete
|
||||
customers =await GetCustomers(); // call a service or an API to pull the customers
|
||||
customers = await GetCustomers(); // call a service or an API to pull the customers
|
||||
|
||||
return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName)));
|
||||
}
|
||||
@@ -160,8 +160,8 @@
|
||||
}
|
||||
public async Task LoadInvoice(int pi)
|
||||
{
|
||||
if (ItemSearchInvoicetype == 100 || ItemSearchInvoicetype==null)
|
||||
itemsearch.invoiceType = null;
|
||||
if (ItemSearchInvoicetype == 100 || ItemSearchInvoicetype == null)
|
||||
itemsearch.invoiceType = null;
|
||||
else
|
||||
itemsearch.invoiceType = (InvoiceType)ItemSearchInvoicetype;
|
||||
|
||||
@@ -210,11 +210,28 @@
|
||||
}
|
||||
public async Task InvoiceItem(int ID)
|
||||
{
|
||||
if (customers is null)
|
||||
customers = await GetCustomers();
|
||||
if (Patterns == null || Patterns.Count < 0)
|
||||
{
|
||||
var rsp = await hc.Get("Invoice/GetPatterns");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
Patterns = await rsp.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||
}
|
||||
}
|
||||
var parameters = new Dictionary<string, object>();
|
||||
|
||||
if (ID == 0) parameters.Add("Invoice", new InvoiceDTO() { ID = 0 });
|
||||
if (ID == 0) parameters.Add("Invoice", new InvoiceDTO()
|
||||
{
|
||||
ID = 0,
|
||||
InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||
InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||
Udate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront()
|
||||
});
|
||||
else parameters.Add("invoice", request.list.Where(w => w.ID == ID).First().Clone());
|
||||
|
||||
parameters.Add("Patterns", Patterns);
|
||||
parameters.Add("Cus", customers);
|
||||
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBackCustomerItem));
|
||||
await modal.ShowAsync<InvoiceItem>(title: ID == 0 ? "صورتحساب جدید" : "ویرایش اطلاعات", parameters: parameters);
|
||||
|
||||
|
Reference in New Issue
Block a user