Bug fix in ExportSalesInvoice and converted more code over to repository and service pattern

This commit is contained in:
2025-07-07 15:22:21 +01:00
parent 5900a6e6e4
commit 5cd653d700
64 changed files with 2623 additions and 2517 deletions
@@ -3,21 +3,22 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace bnhtrade.Core.Logic.Account
{
public class GetTaxCodeInfo
public class GetTaxCodeInfo : UnitOfWorkBase
{
private Data.Database.Account.ReadTaxCode dbRead;
public GetTaxCodeInfo()
{
dbRead = new Data.Database.Account.ReadTaxCode();
}
public List<Model.Account.TaxCodeInfo> GetByTaxCode(List<string> taxCodeList)
{
return dbRead.GetByTaxCode(taxCodeList);
return WithUnitOfWork(uow =>
{
return uow.AccountTaxRepository.ReadTaxCodeInfo(null, taxCodeList).Values.ToList();
});
}
public Model.Account.TaxCodeInfo GetByTaxCode(string taxCode)
@@ -48,7 +49,11 @@ namespace bnhtrade.Core.Logic.Account
}
// get db list
var dbList = dbRead.GetTaxCodeBySkuNumber(skuNumberList);
var dbList = WithUnitOfWork(uow =>
{
return uow.AccountTaxRepository.GetTaxCodeBySkuNumber(skuNumberList);
});
// build dictionary
foreach (var item in dbList)