Migrated projects to dotnet8

migrated all projects over to .net8
incomplete feature for gui shipments
This commit is contained in:
Bobbie Hodgetts
2024-11-20 16:37:42 +00:00
committed by GitHub
parent 270eebca9a
commit 7a12b49b44
78 changed files with 4127 additions and 1339 deletions

View File

@@ -10,7 +10,6 @@ namespace bnhtrade.Core.Data.Database.Account
public class ReadAccountCode : Connection
{
private Data.Database.SqlWhereBuilder sqlWhere = new SqlWhereBuilder();
private List<Model.Account.Account> resultList;
public ReadAccountCode()
{
@@ -27,26 +26,45 @@ namespace bnhtrade.Core.Data.Database.Account
var dictionary = new Dictionary<uint, Model.Account.Account>();
foreach (var item in list)
{
dictionary.Add(item.Id, item);
dictionary.Add(item.Value.Id, item.Value);
}
return dictionary;
}
public List<Model.Account.Account> ByAccountCode(List<int> accountCodeList)
public Dictionary<uint, Model.Account.Account> ByAccountId(List<uint> accountIdList)
{
Innit();
var resultDict = new Dictionary<uint, Model.Account.Account>();
if (accountIdList == null || !accountIdList.Any())
{
return resultDict;
}
sqlWhere.In("tblAccountChartOf.AccountChartOfID", accountIdList, " WHERE ");
resultDict = Execute(sqlWhere.SqlWhereString, sqlWhere.ParameterList);
return resultDict;
}
public Dictionary<uint, Model.Account.Account> ByAccountCode(List<int> accountCodeList)
{
Innit();
var resultDict = new Dictionary<uint, Model.Account.Account>();
if (accountCodeList == null || !accountCodeList.Any())
{
return resultList;
return resultDict;
}
sqlWhere.In("tblAccountChartOf.AccountCode", accountCodeList, " WHERE ");
return Execute(sqlWhere.SqlWhereString, sqlWhere.ParameterList);
resultDict = Execute(sqlWhere.SqlWhereString, sqlWhere.ParameterList);
return resultDict;
}
private List<Model.Account.Account> Execute(string sqlWhere, Dictionary<string, object> parameters)
private Dictionary<uint, Model.Account.Account> Execute(string sqlWhere, Dictionary<string, object> parameters)
{
var resultDict = new Dictionary<uint, Model.Account.Account>();
//build sql query
string sqlString = @"
SELECT tblAccountChartOf.AccountChartOfID
@@ -91,18 +109,18 @@ namespace bnhtrade.Core.Data.Database.Account
int multiplier = reader.GetInt32(6);
var result = new Model.Account.Account(tablePk, accountCode, title, description, type, basicType, multiplier);
resultList.Add(result);
resultDict.Add(tablePk, result);
}
}
return resultList;
}
}
}
return resultDict;
}
private void Innit()
{
resultList = new List<Model.Account.Account>();
sqlWhere.Init();
}
}
}