setting
This commit is contained in:
27
Back/Services/servTaxPayer.cs
Normal file
27
Back/Services/servTaxPayer.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Back.Common.Enums;
|
||||
using Back.Data.Contracts;
|
||||
using Back.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Back.Services
|
||||
{
|
||||
public class servTaxPayer
|
||||
{
|
||||
private readonly IAsyncRepository<SentTax> _repoSentTax;
|
||||
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax)
|
||||
{
|
||||
_repoSentTax = repoSentTax;
|
||||
}
|
||||
public async Task<bool> ExistSuccessfulorSendorpendingInvoiceinCompanyID(int CompanyID)
|
||||
{
|
||||
return await _repoSentTax.Get(w => w.invoice.CompanyID == CompanyID && (w.SentStatus == SentStatus.Successful || w.SentStatus == SentStatus.Send || w.SentStatus == SentStatus.pending)).AnyAsync();
|
||||
}
|
||||
public async Task<bool> CheckingTheCompanyKeyInformation(int CompanyID, string UniqeMemory, string PrivateKey, string EconomicCode)
|
||||
{
|
||||
return await _repoSentTax.Get(w => (w.invoice.company.UniqeMemory == UniqeMemory || w.invoice.company.PrivateKey == PrivateKey || w.invoice.company.EconomicCode == EconomicCode)
|
||||
&& (w.SentStatus == SentStatus.Successful || w.SentStatus == SentStatus.Send || w.SentStatus == SentStatus.pending)
|
||||
&& w.invoice.CompanyID != CompanyID).AnyAsync();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user