public FtpJob( FtpLoader ftpLoader, FileNameMatcher fileNameMatcher, IFtpJobRepository ftpJobRepository) { var fromDateSetting = ConfigurationManager.AppSettings["startDate"]; if (string.IsNullOrEmpty(fromDateSetting)) { throw new ConfigurationErrorsException("Please add 'startDate' settigns to .config file."); } var jobInterval = ConfigurationManager.AppSettings["job:FtpJobInterval"]; if (string.IsNullOrEmpty(jobInterval)) { throw new ConfigurationErrorsException("Please add 'job:FtpJobInterval' settigns to .config file."); } _fromDate = DateTime.ParseExact(fromDateSetting, "yyyy-MM-dd", CultureInfo.InvariantCulture); JobInterval = int.Parse(jobInterval); _ftpJobRepository = ftpJobRepository; _ftpLoader = ftpLoader; _fileNameMatcher = fileNameMatcher; }
public FtpJob( FtpLoader ftpLoader, InMemoryCache <TradeMasterAccountModel> tradeMasterAccountModel, IContract wcf, FileNameMatcher fileNameMatcher, IFtpJobRepository ftpJobRepository, IImportRepository importRepository) : base(wcf) { _job = Job.Ftp; _ftpLoader = ftpLoader; _tradeMasterAccountModel = tradeMasterAccountModel; _ftpJobRepository = ftpJobRepository; _importRepository = importRepository; _fileNameMatcher = fileNameMatcher; //using (_ftpJobRepository.BeginOperation()) //{ // foreach (var ftpFile in ftpJobRepository.ImportedFilesQuery()) // { // _existingFiles.Add(ftpFile.OriginalFileName); // } //} }