...
This commit is contained in:
@@ -170,5 +170,9 @@ namespace Back.Services
|
||||
|
||||
}
|
||||
}
|
||||
public async Task<bool> UsedInTheInvoice(int codID)
|
||||
{
|
||||
return await _CODRepo.Get(w => w.invoiceDetails.Any(a=>a.CODID==codID)).AnyAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -9,12 +9,13 @@ namespace Back.Services
|
||||
public class servCustomer
|
||||
{
|
||||
private readonly IAsyncRepository<Customer> _repoCus;
|
||||
private readonly IAsyncRepository<Invoice> _repoInvoice;
|
||||
private readonly CheckPermission _checkPermission;
|
||||
public servCustomer(IAsyncRepository<Customer> repoCus, CheckPermission checkPermission)
|
||||
public servCustomer(IAsyncRepository<Customer> repoCus, CheckPermission checkPermission, IAsyncRepository<Invoice> repoInvoice)
|
||||
{
|
||||
_repoCus = repoCus;
|
||||
_checkPermission = checkPermission;
|
||||
|
||||
_repoInvoice = repoInvoice;
|
||||
}
|
||||
public async Task<PagingDto<RCustomer>?> GetCustomers(int CompanyID, ItemSerchGetCustomer itemSerch)
|
||||
{
|
||||
@@ -189,6 +190,10 @@ namespace Back.Services
|
||||
|
||||
}
|
||||
}
|
||||
public async Task<bool> UsedInTheInvoice(int cusID)
|
||||
{
|
||||
return await _repoInvoice.Get(w => w.CustomerID == cusID).AnyAsync();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -125,6 +125,9 @@ namespace Back.Services
|
||||
|
||||
if (itemSerch.refInvoiceID != null)
|
||||
invok = invok.Where(w => w.BillReference==itemSerch.refInvoiceID);
|
||||
|
||||
if(itemSerch.CodID != null)
|
||||
invok = invok.Where(w => w.invoiceDetails.Any(wa=>wa.CODID== itemSerch.CodID));
|
||||
//foreach (InputObj item in inputObjs)
|
||||
// invok = invok.Where(ExMethod.GetFunc<Customer>(item.Param, item.Value));
|
||||
|
||||
|
Reference in New Issue
Block a user