moving code our of program file

This commit is contained in:
Bobbie Hodgetts
2024-04-17 16:03:15 +01:00
parent c1e6da7a6f
commit f8452d274a
23 changed files with 122 additions and 592 deletions

View File

@@ -15,7 +15,7 @@ namespace bnhtrade.Core.Logic.Import
{
string operation = "Import Amazon Settlement Reports";
MiscFunction.EventLogInsert("Started '" + operation + "' operation.");
new Logic.Log.LogEvent().EventLogInsert("Started '" + operation + "' operation.");
// get avaiable reports from amazon api
var spapiReportIdList = amazonReport.ListAvaliableReports();
@@ -23,7 +23,7 @@ namespace bnhtrade.Core.Logic.Import
if (reportCount == 0)
{
MiscFunction.EventLogInsert("Exiting '" + operation + "' operation. No settlement reports availble on Amazon SP-API.");
new Logic.Log.LogEvent().EventLogInsert("Exiting '" + operation + "' operation. No settlement reports availble on Amazon SP-API.");
return;
}
@@ -47,7 +47,7 @@ namespace bnhtrade.Core.Logic.Import
if (!spapiReportIdList.Any())
{
MiscFunction.EventLogInsert("Exiting '" + operation + "' operation. No new reports to import (" + reportCount + " avaibale).");
new Logic.Log.LogEvent().EventLogInsert("Exiting '" + operation + "' operation. No new reports to import (" + reportCount + " avaibale).");
return;
}
@@ -58,7 +58,7 @@ namespace bnhtrade.Core.Logic.Import
UI.Console.WriteLine("Importing settlement report " + (i + 1) + " of " + spapiReportIdList.Count() + " (ReportID:" + spapiReportIdList[i] + ").");
var filePath = amazonReport.GetFile(spapiReportIdList[i]);
bool ack = dbImport.ByFlatFile(filePath, spapiReportIdList[i]);
MiscFunction.EventLogInsert("Settlment Report imported (ReportID:" + spapiReportIdList[i] + ").");
new Logic.Log.LogEvent().EventLogInsert("Settlment Report imported (ReportID:" + spapiReportIdList[i] + ").");
}
return;