mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-05-18 19:48:23 +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:
@@ -17,7 +17,7 @@ namespace bnhtrade.Core.Data.Database.Log
|
||||
/// Gets the Date and Time by a unique string.
|
||||
/// </summary>
|
||||
/// <param name="logDateTimeId">Unique string</param>
|
||||
/// <returns>UTC DateTime or null</returns>
|
||||
/// <returns>UTC DateTime</returns>
|
||||
public DateTime GetDateTimeUtc(string logDateTimeId)
|
||||
{
|
||||
using (SqlConnection conn = new SqlConnection(SqlConnectionString))
|
||||
@@ -52,7 +52,10 @@ namespace bnhtrade.Core.Data.Database.Log
|
||||
|
||||
public void SetDateTimeUtc(string logDateTimeID, DateTime utcDateTime)
|
||||
{
|
||||
utcDateTime = DateTime.SpecifyKind(utcDateTime, DateTimeKind.Utc);
|
||||
if (utcDateTime.Kind != DateTimeKind.Utc)
|
||||
{
|
||||
throw new Exception("Datetime kind is not set to UTC");
|
||||
}
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(SqlConnectionString))
|
||||
{
|
||||
@@ -86,7 +89,10 @@ namespace bnhtrade.Core.Data.Database.Log
|
||||
if (string.IsNullOrWhiteSpace(LogDateTimeId))
|
||||
{ throw new Exception("Invalid LogDateTimeID"); }
|
||||
|
||||
utcDateTime = DateTime.SpecifyKind(utcDateTime, DateTimeKind.Utc);
|
||||
if (utcDateTime.Kind != DateTimeKind.Utc)
|
||||
{
|
||||
throw new Exception("Datetime kind is not set to UTC");
|
||||
}
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(SqlConnectionString))
|
||||
{
|
||||
@@ -111,7 +117,7 @@ namespace bnhtrade.Core.Data.Database.Log
|
||||
{
|
||||
var nowTime = DateTime.UtcNow;
|
||||
cmd.Parameters.AddWithValue("@logDateTimeId", LogDateTimeId);
|
||||
cmd.Parameters.AddWithValue("@utcDateTime", utcDateTime);
|
||||
cmd.Parameters.AddWithValue("@utcDateTime", utcDateTime.ToUniversalTime());
|
||||
if (string.IsNullOrWhiteSpace(comments)) { cmd.Parameters.AddWithValue("@comments", DBNull.Value); }
|
||||
else { cmd.Parameters.AddWithValue("@comments", comments); }
|
||||
cmd.Parameters.AddWithValue("@recordModified", nowTime.ToUniversalTime());
|
||||
|
||||
Reference in New Issue
Block a user