Feature: stock replenishment

This commit is contained in:
Bobbie Hodgetts
2024-05-09 13:23:33 +01:00
committed by GitHub
parent 91ef9acc78
commit 270eebca9a
30 changed files with 721 additions and 249 deletions

View File

@@ -15,12 +15,12 @@ namespace bnhtrade.Core.Logic.Account
readAccountCode = new Data.Database.Account.ReadAccountCode();
}
public List<Model.Account.AccountCode> GetAll()
public Dictionary<uint, Model.Account.Account> GetAll()
{
return readAccountCode.All();
}
public Model.Account.AccountCode ByAccountCode(int accountCode)
public Model.Account.Account ByAccountCode(int accountCode)
{
var list = ByAccountCode(new List<int> { accountCode });
if (list.Any())
@@ -33,14 +33,14 @@ namespace bnhtrade.Core.Logic.Account
}
}
public List<Model.Account.AccountCode> ByAccountCode(List<int> accountCodeList)
public List<Model.Account.Account> ByAccountCode(List<int> accountCodeList)
{
return readAccountCode.ByAccountCode(accountCodeList);
}
public Dictionary<int, Model.Account.AccountCode> ConvertToDictionary(List<Model.Account.AccountCode> accountCodeList)
public Dictionary<int, Model.Account.Account> ConvertToDictionary(List<Model.Account.Account> accountCodeList)
{
var returnDict = new Dictionary<int, Model.Account.AccountCode>();
var returnDict = new Dictionary<int, Model.Account.Account>();
if (accountCodeList == null)
{
@@ -49,9 +49,9 @@ namespace bnhtrade.Core.Logic.Account
foreach (var accountCode in accountCodeList)
{
if (!returnDict.ContainsKey(accountCode.AccountCodeId))
if (!returnDict.ContainsKey((int)accountCode.AccountCode))
{
returnDict.Add(accountCode.AccountCodeId, accountCode);
returnDict.Add((int)accountCode.AccountCode, accountCode);
}
}
return returnDict;