mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 06:27:15 +00:00
SP-API stock reconciliation
Amazon had depreciated a number of reports that were used for stock reconciliation. Application now uses the new fba ledger report to reconcile. It is currently untested, as this requires data from Amazon. Methods that require testing will return a 'NotImplementedException'. Also, removed the depreciated ILMerge and replaced with ILRepack. Plus much more tidying up, and improvements.
This commit is contained in:
@@ -20,14 +20,62 @@ namespace bnhtrade.Core.Data.Database
|
||||
|
||||
public Connection()
|
||||
{
|
||||
var config = new Config().GetConfiguration();
|
||||
|
||||
// attempt to retrive credentials from app.local.config
|
||||
try
|
||||
{
|
||||
var dbCredentials = new bnhtrade.Core.Model.Credentials.bnhtradeDB(
|
||||
ConfigurationManager.AppSettings["DbDataSource"]
|
||||
, ConfigurationManager.AppSettings["DbUserId"]
|
||||
, ConfigurationManager.AppSettings["DbUserPassword"]
|
||||
);
|
||||
string dataSource = config.AppSettings.Settings["DbDataSource"].Value;
|
||||
string userId = config.AppSettings.Settings["DbUserId"].Value;
|
||||
string pass = config.AppSettings.Settings["DbUserPassword"].Value;
|
||||
|
||||
// check
|
||||
if (string.IsNullOrEmpty(dataSource))
|
||||
{
|
||||
throw new ArgumentException("Could not retrive 'DbDataSource' from config file");
|
||||
}
|
||||
else if (string.IsNullOrEmpty(userId))
|
||||
{
|
||||
throw new ArgumentException("Could not retrive 'DbUserId' from config file");
|
||||
}
|
||||
else if (string.IsNullOrEmpty(pass))
|
||||
{
|
||||
throw new ArgumentException("Could not retrive 'DbUserPassword' from config file");
|
||||
}
|
||||
|
||||
var dbCredentials = new bnhtrade.Core.Model.Credentials.bnhtradeDB(dataSource, userId, pass);
|
||||
this.dbCredentials = dbCredentials;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("Unable to retirve DB credentials: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void ConnectionOld()
|
||||
{
|
||||
// attempt to retrive credentials from app.local.config
|
||||
try
|
||||
{
|
||||
string dataSource = ConfigurationManager.AppSettings["DbDataSource"];
|
||||
string userId = ConfigurationManager.AppSettings["DbUserId"];
|
||||
string pass = ConfigurationManager.AppSettings["DbUserPassword"];
|
||||
|
||||
// check
|
||||
if (string.IsNullOrEmpty(dataSource))
|
||||
{
|
||||
throw new ArgumentException("Could not retrive 'DbDataSource' from config file");
|
||||
}
|
||||
else if (string.IsNullOrEmpty(userId))
|
||||
{
|
||||
throw new ArgumentException("Could not retrive 'DbUserId' from config file");
|
||||
}
|
||||
else if (string.IsNullOrEmpty(pass))
|
||||
{
|
||||
throw new ArgumentException("Could not retrive 'DbUserPassword' from config file");
|
||||
}
|
||||
|
||||
var dbCredentials = new bnhtrade.Core.Model.Credentials.bnhtradeDB(dataSource, userId, pass);
|
||||
this.dbCredentials = dbCredentials;
|
||||
}
|
||||
catch(Exception ex)
|
||||
@@ -43,6 +91,7 @@ namespace bnhtrade.Core.Data.Database
|
||||
{
|
||||
throw new Exception("DB credentials object is null");
|
||||
}
|
||||
this.dbCredentials = dbCredentials;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user