mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 14:37:16 +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:
47
src/bnhtrade.Core/Config.cs
Normal file
47
src/bnhtrade.Core/Config.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
public string GetAppDataPath()
|
||||
{
|
||||
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\bnhtrade\";
|
||||
return path;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// return the directory path for temp files, just add file name onto end
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetTempFileDirectoryPath()
|
||||
{
|
||||
string directoryPath = Path.GetTempPath()
|
||||
+ "_" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
|
||||
System.IO.Directory.CreateDirectory(directoryPath);
|
||||
return directoryPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns configuration file from local users directory
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal Configuration GetConfiguration()
|
||||
{
|
||||
string path = new bnhtrade.Core.Config().GetAppDataPath();
|
||||
string configFileName = "app.local.config";
|
||||
|
||||
ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
|
||||
configMap.ExeConfigFilename = path + configFileName;
|
||||
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user