public static void Main(string[] args) { LabelService labelService = new LabelService(new CountryRepo()); OrderExporter orderExporter = new OrderExporter(new InvoiceExporter(labelService), labelService); orderExporter.Export("en"); // orderExporter.Export("fr"); Console.ReadLine(); }
protected override void Process() { _monitoring.Notify(Name, 0); using (var unit = GetUnitOfWork()) { foreach (Connector connector in base.Connectors.Where(c => ((ConnectorType)c.ConnectorType).Has(ConnectorType.OrderHandling))) { #if DEBUG if (connector.ConnectorID != 7) { continue; } #endif notifyMonitor = (c) => { _monitoring.Notify(Name, c); }; string singleProduct = string.Empty; try { log.DebugFormat("Start Magento Order Synchronization for {0}", connector.Name); if (connector.ConnectorSystemType == null) { log.AuditError(string.Format("No Connector System Settings found for {0}, Magento Export can not be executed!", connector.Name), "Magento Export"); continue; } DateTime start = DateTime.Now; OrderExporter orderExporter = new OrderExporter(connector, log, GetConfiguration(), notifyMonitor); orderExporter.Process(); log.DebugFormat("Finished Magento Order Synchronization For {0}", connector.Name); } catch (Exception ex) { log.Error("Error in Magento Plugin", ex); _monitoring.Notify(Name, -1); } } } _monitoring.Notify(Name, 1); }
private void CreateOrderExportFile(IList <Order> list) { if (list.Count > 0) { OrderExporter exporter = new OrderExporter(); MemoryStream memStream = exporter.ExportToStream(list); Exception ex; WebUtilities.CreateExportFile(System.Web.HttpContext.Current.ApplicationInstance, memStream, "ExportOrder.csv", out ex); if (ex != null) { uxMessage.DisplayError(Resources.ExportDataMessage.Error + ex.GetType().ToString()); } } else { uxMessage.DisplayError(Resources.ExportDataMessage.CannotDownload); } }
protected override void Process() { var connectorOverridesSetting = GetConfiguration().AppSettings.Settings["OrderConnectorOverrides"]; List <int> connectorOverrides = null; if (connectorOverridesSetting != null) { connectorOverrides = (from p in connectorOverridesSetting.Value.Split(',') select int.Parse(p)).ToList(); } _monitoring.Notify(Name, 0); using (var unit = GetUnitOfWork()) { foreach (Connector connector in base.Connectors.Where(c => ((ConnectorType)c.ConnectorType).Has(ConnectorType.OrderHandling))) { Enumerable.Range(0, 100); if (connectorOverrides != null && !connectorOverrides.Contains(connector.ConnectorID)) { continue; } #if DEBUG if (connector.ConnectorID != 15) { continue; } #endif notifyMonitor = (c) => { _monitoring.Notify(Name, c); }; string singleProduct = string.Empty; try { log.DebugFormat("Start Magento Order Synchronization for {0}", connector.Name); if (connector.ConnectorSystemType == null) { log.AuditError(string.Format("No Connector System Settings found for {0}, Magento Export can not be executed!", connector.Name), "Magento Export"); continue; } DateTime start = DateTime.Now; OrderExporter orderExporter = new OrderExporter(connector, log, GetConfiguration(), notifyMonitor); orderExporter.Process(); log.DebugFormat("Finished Magento Order Synchronization For {0}", connector.Name); } catch (Exception ex) { log.Error("Error in Magento Plugin", ex); _monitoring.Notify(Name, -1); } } } _monitoring.Notify(Name, 1); }