/// <summary> /// Landing point, execution starts here /// </summary> protected override void ExecuteTask() { EmbeddedResourceHelper.Bind(this); if (LoadDefaultVendor() && LoadDefaultLanguage() && LoadDefaultConnector() && LoadProductExporterSettings()) { if (LoadDatabaseCache()) { IFtpClient ftpClient; try { ftpClient = FtpClientFactory.Create(new Uri(ExportSettings.Server), ExportSettings.UserName, ExportSettings.Password); ftpClient.Update(); } catch (Exception ex) { TraceError("Unable to establish FTP connection to remote server \"{0}\" for exporting BizTalk files.", ExportSettings.Server); return; } ExportProducts(ftpClient); } else { TraceError("Could not cache Concentrator database data, further processing not possible now."); } } else { TraceError("Could not load context data, further processing not possible now."); } }
public ProductMediaRepository(Database database, string sourceDatabaseName, string destinationDatabaseName) { _database = database; SourceDatabaseName = sourceDatabaseName; DestinationDatabaseName = destinationDatabaseName; EmbeddedResourceHelper.Bind(GetType()); }
public FirebirdRepository(String connectionString, DateTime?lastExecutionTime = null) { EmbeddedResourceHelper.Bind(this); Connection = new FbConnection(connectionString); Connection.Open(); LastExecutionTime = lastExecutionTime; }
protected override void ExecuteConnectorTask() { EmbeddedResourceHelper.Bind(GetType()); Init(); var productToProcess = ProductMediaRepository.GetProductsForSync(); foreach (var productToSync in productToProcess) { SyncMedia(productToSync); } }
protected override void ExecuteConnectorTask() { TraceVerbose("Processing export media files"); EmbeddedResourceHelper.Bind(this); if (LoadMediaTypes()) { var transferResources = GetTransferResources(); if (transferResources != null) { if (EnableFullExport) { TraceInformation("Start full export for {0} products.", transferResources.Count()); TransferService .Default .Process( transferResources, TraceSource, new { FingerprintArchiveFile }); } else { TraceInformation("Start partial export for {0} products.", transferResources.Count()); TransferService .Partial .Process( transferResources, TraceSource, new { FingerprintArchiveFile }); } } } TraceVerbose("Ended export media files"); }
protected override void ExecutePricatTask() { EmbeddedResourceHelper.Bind(typeof(BrandImporter)); using (var connection = new SqlConnection(Environments.Current.Connection)) { connection.Open(); connection.Execute(CreateBrandTable); using (var brandDataTable = GetPricatBrands()) using (var bulkCopy = new SqlBulkCopy(connection)) { bulkCopy.DestinationTableName = "#Brand"; bulkCopy.WriteToServer(brandDataTable); } using (var transaction = connection.BeginTransaction()) { try { var importCount = connection.Execute(MergeBrands, null, transaction); connection.Execute(string.Format(MergeBrandVendor, DefaultVendor.VendorID), null, transaction); transaction.Commit(); TraceVerbose("{0} brand(s) created or updated.", importCount); } catch (Exception exception) { transaction.Rollback(); TraceError("Unable to import the brands. {0}", exception.Message); } } } }
public AssortmentGeneratorTask() { EmbeddedResourceHelper.Bind(this); }