public FTPTransporter() { InitializeComponent(); Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); try { this.Settings = SettingsContainer.GetSettings(); } catch (Exception ex) { EventLog.Source = "FtpTransporter"; EventLog.WriteEntry(string.Format("{0}: {1}. {2}", ex.StackTrace, ex.Message, "Error to initialization settings from database.")); } this.CanStop = true; this.CanPauseAndContinue = true; this.AutoLog = true; this.ServiceName = this.Settings.ServiceName; EventLog.Source = this.ServiceName; this.Logger = new Logger(string.Format("{0}.{1}", this.ServiceName, "log"), this.ServiceName); this.Timer = new Timer(); this.FtpManager = new ManagerFtp(this.Settings.FtpUri, Convert.ToBoolean(this.Settings.FtpIsPassive), this.Settings.FtpTimeoutSec, this.Logger); this.WayBillRepository = new WayBillRepository(); this.TradeObjectRepository = new TradeObjectRepository(); }
public void AddTest() { TradeObjectRepository repo = new TradeObjectRepository(); Assert.IsTrue(repo.AddEntity(new TradeObject { ID = 1, Name = "to3", Address = "to2", GLN = "to2", ClientID = 1 })); }
public void GetAllTest() { TradeObjectRepository repo = new TradeObjectRepository(); List <TradeObject> objects = repo.GetAllEntities(); foreach (var item in objects) { Console.WriteLine(item.ToString()); } }
public void GetEntityTest() { TradeObjectRepository repo = new TradeObjectRepository(); Console.WriteLine(repo.GetEntity(0)?.ToString()); }