...
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user