This commit is contained in:
mmrbnjd
2024-06-27 19:18:50 +03:30
parent 6c8aaadac3
commit a44b27b8a7
9 changed files with 109 additions and 16 deletions

View File

@@ -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();
}
}