Esempio n. 1
0
        public override IController CreateController(RequestContext requestContext, string controllerName)
        {
            if (controllerName == "Home")
            {
                var fuse8Context = new Fuse8Context();

                var credentials = new NetworkCredential(
                    requestContext.HttpContext.Request.Form.Get("username"),
                    requestContext.HttpContext.Request.Form.Get("password"));

                var smtpClient = new SmtpClient(
                    requestContext.HttpContext.Request.Form.Get("smtp"),
                    ToInt32(requestContext.HttpContext.Request.Form.Get("port")));
                smtpClient.Credentials = credentials;
                smtpClient.EnableSsl   = true;

                var mailSender = new MailSender(smtpClient);

                var orderRepository = new OrderRepository(fuse8Context.Orders.Include("OrderDetails.Product"));

                var reportExporter = new ReportExporter();

                var reportSender = new ReportSender(mailSender);

                return(new HomeController(orderRepository, reportExporter, reportSender));
            }

            return(base.CreateController(requestContext, controllerName));
        }
Esempio n. 2
0
 public void ExportReport(string aFileName)
 {
     if (ReportExporter != null)
     {
         ReportExporter.Export(aFileName);
     }
 }
        public void Reports_ExportExcel2007Test()
        {
            var reportPath = Path.Combine(Directory.GetCurrentDirectory(), "Integration", "Reports", "NoDBTestReport.rdl");

            using (MemoryStream stream = ReportExporter.ExportToMemoryStream(new Uri(reportPath), OutputPresentationType.Excel2007)) {
                var file = stream.GetBuffer();
                Assert.That(file.Length, Is.GreaterThan(1), "Размер файла должен быть больше 1 байта.");
            }
        }
        public void ExportTest()
        {
            var sut = new ReportExporter();

            var stream  = sut.Export(contextFixture.Context.Orders.ToList());
            var package = new ExcelPackage(stream);

            AssertRow(package.Workbook.Worksheets[1], 2, 1, new DateTime(2010, 1, 2), 1, "ProductA", 1, 10.00m);
            AssertRow(package.Workbook.Worksheets[1], 3, 2, new DateTime(2011, 2, 3), 1, "ProductA", 2, 15.00m);
            AssertRow(package.Workbook.Worksheets[1], 4, 2, new DateTime(2011, 2, 3), 2, "ProductB", 3, 20.00m);
            AssertRow(package.Workbook.Worksheets[1], 5, 3, new DateTime(2012, 3, 4), 2, "ProductB", 4, 25.00m);
            AssertRow(package.Workbook.Worksheets[1], 6, 3, new DateTime(2012, 3, 4), 3, "ProductC", 5, 30.00m);
        }
        protected string ExportPdf(IReportDocument report)
        {
            Utility.Utilities.CreateDir(FileSavePath);
            string fullPath = FileSavePath + "\\" + Utility.Utilities.CleanInvalidFileName(this.file_name) + ".pdf";

            Exception exportException;

            ReportExporter.SaveReport(report, fullPath, out exportException);

            if (exportException != null)
            {
                throw exportException;
            }
            return(fullPath);
        }
        void exportWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                PurchaseReturnExportObject exportObject = (PurchaseReturnExportObject)e.Argument;
                IExportStrategy            strategy     = new PurchaseReturnExportStrategy(exportObject);

                var exporter = new ReportExporter(strategy);
                exporter.ExportReport();
            }
            catch (Exception ex)
            {
                ClientHelper.LogException(ex);
                ClientHelper.ShowErrorMessage("An error occurred while exporting. Please try again.");
            }
        }
Esempio n. 7
0
        private void ExportReport(ReportParameter param, string fileName)
        {
            ReportExporter  exporter = new ReportExporter();
            ReportGenerator gen      = new ReportGenerator(_checkRepository, _deptRepository, _bankRepository);

            if (param.Type == ReportType.Daily)
            {
                var dailyReportModel = gen.GetDaily(param);
                exporter.ExporDailytReport(dailyReportModel, fileName);
            }
            if (param.Type == ReportType.Weekly)
            {
                var weeklyReportModel = gen.GetWeekly(param);
                exporter.ExportWeeklyReport(weeklyReportModel, fileName);
            }
        }
        private static async Task <EmailAttachment> PrepareDocument(IEmailableDocument document, CounterpartyEmailType counterpartyEmailType)
        {
            bool       wasHideSignature;
            ReportInfo ri;

            wasHideSignature       = document.HideSignature;
            document.HideSignature = false;

            ri = document.GetReportInfo();

            document.HideSignature = wasHideSignature;

            using MemoryStream stream = ReportExporter.ExportToMemoryStream(ri.GetReportUri(), ri.GetParametersString(), QSMain.ConnectionString, OutputPresentationType.PDF, true);

            string documentDate = document.DocumentDate.HasValue ? "_" + document.DocumentDate.Value.ToString("ddMMyyyy") : "";

            string fileName = counterpartyEmailType.ToString();

            switch (counterpartyEmailType)
            {
            case CounterpartyEmailType.OrderDocument:
                fileName += $"_{ document.Order.Id }";
                break;

            default:
                fileName += $"_{ document.Id }";
                break;
            }

            fileName += $"_{ documentDate }.pdf";

            return(await new ValueTask <EmailAttachment>(
                       new EmailAttachment
            {
                Filename = fileName,
                ContentType = "application/pdf",
                Base64Content = Convert.ToBase64String(stream.GetBuffer())
            }));
        }
        private Email CreateDocumentEmail(string clientName, string organizationName, OrderDocument document)
        {
            if (document.Type == OrderDocumentType.Bill)
            {
                var billDocument     = document as BillDocument;
                var wasHideSignature = billDocument.HideSignature;
                billDocument.HideSignature = false;
                ReportInfo ri = billDocument.GetReportInfo();
                billDocument.HideSignature = wasHideSignature;

                EmailTemplate template = billDocument.GetEmailTemplate();
                Email         email    = new Email();
                email.Title    = string.Format("{0} {1}", template.Title, billDocument.Title);
                email.Text     = template.Text;
                email.HtmlText = template.TextHtml;
                foreach (var item in template.Attachments)
                {
                    email.AddInlinedAttachment(item.Key, item.Value.MIMEType, item.Value.FileName, item.Value.Base64Content);
                }

                email.Recipient         = new EmailContact(clientName, yvalidatedentryEmail.Text);
                email.Sender            = new EmailContact(organizationName, ParametersProvider.Instance.GetParameterValue("email_for_email_delivery"));
                email.Order             = document.Order.Id;
                email.OrderDocumentType = document.Type;
                using (MemoryStream stream = ReportExporter.ExportToMemoryStream(ri.GetReportUri(), ri.GetParametersString(), ri.ConnectionString, OutputPresentationType.PDF, true)) {
                    string billDate = billDocument.DocumentDate.HasValue ? "_" + billDocument.DocumentDate.Value.ToString("ddMMyyyy") : "";
                    email.AddAttachment($"Bill_{billDocument.Order.Id}{billDate}.pdf", stream);
                }
                return(email);
            }
            else
            {
                //для других документов не реализована отправка почты
                return(null);
            }
        }
Esempio n. 10
0
        public void ResendEmailWithErrorSendingStatus(DateTime date)
        {
            IEmailService service = EmailServiceSetting.GetEmailService();

            if (service == null)
            {
                return;
            }

            IList <StoredEmail> errorSendedEmails;

            using (var uowLocal = UnitOfWorkFactory.CreateWithoutRoot()) {
                StoredEmail unsendedEmailAlias        = null;
                StoredEmail alreadyResendedEmailAlias = null;

                var dateCriterion = Projections.SqlFunction(
                    new SQLFunctionTemplate(
                        NHibernateUtil.Date,
                        "Date(?1)"
                        ),
                    NHibernateUtil.Date,
                    Projections.Property <StoredEmail>(x => x.SendDate)
                    );
                ICriterion dateResctict   = Restrictions.Eq(dateCriterion, date.Date);
                ICriterion dateResctictGe = Restrictions.Ge(dateCriterion, date.Date);

                var resendedQuery = QueryOver.Of <StoredEmail>()
                                    .Where(Restrictions.EqProperty(Projections.Property <StoredEmail>(x => x.Order.Id), Projections.Property(() => unsendedEmailAlias.Order.Id)))
                                    .Where(x => x.State != StoredEmailStates.SendingError)
                                    .Where(dateResctictGe)
                                    .Select(Projections.Count(Projections.Id()));

                errorSendedEmails = uowLocal.Session.QueryOver <StoredEmail>(() => unsendedEmailAlias)
                                    .Where(x => x.State == StoredEmailStates.SendingError)
                                    .Where(dateResctict)
                                    .WithSubquery.WhereValue(0).Eq(resendedQuery)
                                    .List();

                foreach (var sendedEmail in errorSendedEmails)
                {
                    var billDocument = sendedEmail.Order.OrderDocuments.FirstOrDefault(y => y.Type == OrderDocumentType.Bill) as BillDocument;
                    if (billDocument == null)
                    {
                        continue;
                    }

                    billDocument.HideSignature = false;
                    ReportInfo ri = billDocument.GetReportInfo();

                    var   billTemplate = billDocument.GetEmailTemplate();
                    Email email        = new Email {
                        Title             = string.Format("{0} {1}", billTemplate.Title, billDocument.Title),
                        Text              = billTemplate.Text,
                        HtmlText          = billTemplate.TextHtml,
                        Recipient         = new EmailContact("", sendedEmail.RecipientAddress),
                        Sender            = new EmailContact("vodovoz-spb.ru", ParametersProvider.Instance.GetParameterValue("email_for_email_delivery")),
                        Order             = billDocument.Order.Id,
                        OrderDocumentType = OrderDocumentType.Bill
                    };
                    foreach (var item in billTemplate.Attachments)
                    {
                        email.AddInlinedAttachment(item.Key, item.Value.MIMEType, item.Value.FileName, item.Value.Base64Content);
                    }
                    using (MemoryStream stream = ReportExporter.ExportToMemoryStream(ri.GetReportUri(), ri.GetParametersString(), ri.ConnectionString, OutputPresentationType.PDF, true)) {
                        string billDate = billDocument.DocumentDate.HasValue ? "_" + billDocument.DocumentDate.Value.ToString("ddMMyyyy") : "";
                        email.AddAttachment($"Bill_{billDocument.Order.Id}{billDate}.pdf", stream);
                    }
                    email.AuthorId      = sendedEmail.Author.Id;
                    email.ManualSending = sendedEmail.ManualSending ?? false;

                    service.SendEmail(email);
                }
            }
        }
Esempio n. 11
0
        //Thread to start serial archivation
        private void ArchivateSeria() // after begin of correct ----- doesnt WORK NOW !!!
        {
            if (numIterations.Value % 4 != 0)
            {
                SetStatusMessage("Число итераций должно быть кратно четырём");
                return;
            }
            if (!File.Exists(openFD.FileName))
            {
                MessageBox.Show("Проверьте, существует ли указанный файл", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            try
            {
                ReportExporter rp = new ReportExporter(
                    (int)numIterations.Value,
                    Path.GetFileNameWithoutExtension(openFD.FileName)
                    );

                bool isBlocks   = true;
                bool isPositive = true;
                int  k          = 0;
                for (int i = 0; i < numIterations.Value; i++)
                {
                    if (i < numIterations.Value / 4)
                    {
                        k = i;
                    }
                    else if (i < numIterations.Value / 2)
                    {
                        k = i - (int)numIterations.Value / 4;
                    }
                    else if (i < numIterations.Value * 3 / 4)
                    {
                        k = i - (int)numIterations.Value / 2;
                    }
                    else
                    {
                        k = i - (int)numIterations.Value * 3 / 4;
                    }

                    isPositive = i < numIterations.Value / 2;
                    isBlocks   = (i < numIterations.Value / 2 && i < numIterations.Value / 4 || i >= numIterations.Value / 2 && i < numIterations.Value * 3 / 4);
                    Session session = new Session(
                        (int)(numElementLen.Value + numStep.Value * k),
                        isPositive,
                        isBlocks);
                    var final = Archivate(session, i + 1, isPositive, isBlocks);
                    if (final == false || !(session.ElementLength > 0))
                    {
                        SetStatusMessage("Interrupted " + final + " " + session.ElementLength);
                        return;
                    }
                    rp.WriteExcel(session, i);
                    SetMultiProgressValue((int)(100 * (i + 1) / numIterations.Value));
                }
                rp.Finish();
            }
            catch (Exception ex)
            {
                SetStatusMessage(ex.Message);
                return;
            }
        }
 public void ExportReport(Report report)
 {
     ReportExporter.Export(report);
 }
        public void Convert()
        {
            try
            {
                ExportErrorMessage = string.Empty;
                HasExportError     = false;

                //loading proffix address numbers from database
                var nrOfAddressesFromProffixRead = _dataManager.ReadProffixDatabase();

                if (ImportFileName.ToLower().EndsWith(".csv") == false)
                {
                    var directory = new DirectoryInfo(ImportFileName);
                    var lastFile  = directory.GetFiles().OrderByDescending(f => f.LastWriteTime).FirstOrDefault();

                    if (lastFile == null)
                    {
                        OnLogEventRaised("Konnte keine aktuelle Datei zum Importieren finden!");
                        throw new ApplicationException($"Konnte keine aktuelle Datei zum Importieren in Verzeichnis {ImportFileName} finden!");
                    }

                    ImportFileName = lastFile.FullName;
                    OnLogEventRaised($"Verwende Datei: {ImportFileName}");
                }

                _logEntries = new List <string>();
                var flightBoxDataList = ReadFile();
                var proffixDataList   = new List <ProffixData>();
                CreationTimeStamp = DateTime.Now;

                OnLogEventRaised("Bereinige Basis-Daten...");

                if (Settings.Default.ReadProffixDbData)
                {
                    OnLogEventRaised($"Mitgliedernummern werden anhand der Proffix-Datenbank überprüft. {nrOfAddressesFromProffixRead} Adressen aus Proffix geladen.");
                }
                else
                {
                    OnLogEventRaised("Proffix-Datenbank wird für die Mitgliedernummer-Prüfung nicht verwendet!");
                }

                foreach (var flightBoxData in flightBoxDataList)
                {
                    var proffixData = new ProffixData(flightBoxData);

                    //check movement date within the valid import range
                    //we won't import old movement data into proffix
                    var minMovementDate = new DateTime(DateTime.Now.AddMonths(-1).Year, DateTime.Now.AddMonths(-1).Month, 1);

                    if (flightBoxData.MovementDateTime < minMovementDate)
                    {
                        // found movement older than the previous months
                        flightBoxData.IsOlderMovementDate = true;
                        OnLogEventRaised(
                            $"Alte Flugbewegung gefunden vom {flightBoxData.MovementDateTime.ToShortDateString()} (Zeile: {flightBoxData.LineNumber}).");

                        if (_ignoreDateRange == false)
                        {
                            ExportErrorMessage = "Alte Flugbewegung wurde gefunden und Warnung bei alten Daten darf nicht ignoriert werden. Verarbeitung wird abgebrochen.";
                            HasExportError     = true;
                            WriteLogFile();
                            ExportFinished?.Invoke(this, EventArgs.Empty);
                            return;
                        }
                    }

                    // try to find MemberNumber based on name if no MemberNumber is set
                    if (string.IsNullOrWhiteSpace(flightBoxData.MemberNumber) || flightBoxData.MemberNumber == "000000")
                    {
                        if (_dataManager.FindLastnameAndSetMemberNumber(proffixData))
                        {
                            OnLogEventRaised(
                                $"MemberNumber {proffixData.MemberNumber} für {flightBoxData.Lastname} mit {flightBoxData.Immatriculation} gesetzt (Zeile: {flightBoxData.LineNumber}).");
                        }
                    }

                    // set MemberNumber based on immatriculation
                    if (_dataManager.FindImmatriculationAndMapMemberNumber(proffixData))
                    {
                        OnLogEventRaised($"Setze spezielle Mitgliedernummer für {proffixData.FlightBoxData.Immatriculation} (Zeile: {flightBoxData.LineNumber}): Alte Mitgliedernummer {proffixData.FlightBoxData.MemberNumber}, neue Mitgliedernummer {proffixData.MemberNumber}");
                    }

                    if (Settings.Default.ReadProffixDbData && _dataManager.FindMemberNumberInProffix(proffixData) == false)
                    {
                        OnLogEventRaised($"Mitgliedernummer {proffixData.MemberNumber} für {proffixData.FlightBoxData.Lastname} mit {proffixData.FlightBoxData.Immatriculation} in Proffix-Datenbank nicht gefunden (Zeile: {flightBoxData.LineNumber})");
                    }

                    proffixDataList.Add(proffixData);
                }

                Thread.Sleep(50);

                WriteBaseFile(proffixDataList);

                Thread.Sleep(50);

                foreach (var proffixData in proffixDataList)
                {
                    if (_dataManager.IsNoLdgTaxMember(proffixData))
                    {
                        proffixData.FlightBoxData.IgnoreLandingTax = true;
                    }

                    if (proffixData.MemberNumber == "999605" &&
                        proffixData.FlightBoxData.TypeOfTraffic == (int)TypeOfTraffic.Instruction)
                    {
                        // Heli Sitterdorf is always private tax not training
                        proffixData.FlightBoxData.TypeOfTraffic = (int)TypeOfTraffic.Private;
                    }

                    if ((proffixData.MemberNumber == "999998" || proffixData.MemberNumber == "383909") &&
                        proffixData.FlightBoxData.TypeOfTraffic == (int)TypeOfTraffic.Instruction)
                    {
                        // Stoffel Aviation is external on instruction
                        proffixData.FlightBoxData.IsHomebased = false;
                    }

                    //TODO: Handle maintenance flights from Seiferle

                    // filtering for tow flights and departure movements are handled within the FlightBoxData class directly

                    if (string.IsNullOrWhiteSpace(proffixData.MemberNumber) || proffixData.MemberNumber == "000000")
                    {
                        proffixData.MemberNumberInProffixNotFound = true;

                        ExportErrorMessage +=
                            $"{Environment.NewLine}Fehlerhafte MemberNumber {proffixData.MemberNumber} für {proffixData.FlightBoxData.Lastname} mit {proffixData.FlightBoxData.Immatriculation} gefunden (Zeile: {proffixData.FlightBoxData.LineNumber}).";
                        OnLogEventRaised(
                            $"Fehlerhafte MemberNumber {proffixData.MemberNumber} für {proffixData.FlightBoxData.Lastname} mit {proffixData.FlightBoxData.Immatriculation} gefunden (Zeile: {proffixData.FlightBoxData.LineNumber}).");
                    }

                    CalculateLandingTax(proffixData);
                }

                if (HasExportError)
                {
                    WriteLogFile();
                    ExportFinished?.Invoke(this, EventArgs.Empty);
                    return;
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);
                var folder         = Path.Combine(ExportFolderName, CreationTimeStamp.ToString("yyyy-MM-dd"));
                var exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_LdgTaxes_without_Remarks (to Import in Proffix).csv");
                var listToExport   = proffixDataList.Where(x => x.FlightBoxData.IsDepartureMovement == false &&
                                                           x.FlightBoxData.IsMaintenanceFlight == false &&
                                                           x.FlightBoxData.IsTowFlight == false &&
                                                           x.FlightBoxData.IgnoreLandingTax == false &&
                                                           string.IsNullOrWhiteSpace(x.FlightBoxData.Remarks) &&
                                                           x.MemberNumberInProffixNotFound == false)
                                     .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised($"Exportiere Proffix-Daten ohne Bemerkungen in Datei: {exportFilename}");
                    var exporter = new ProffixDataCsvExporter(exportFilename, listToExport);
                    exporter.Export();
                    OnLogEventRaised(
                        $"{exporter.NumberOfLinesExported} Proffix-Daten ohne Bemerkungen erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Proffix-Daten ohne Bemerkungen exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);

                exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_LdgTaxes_With_MemberNumberNotFound_Error (to correct and Import in Proffix).csv");
                listToExport   = proffixDataList.Where(x => x.FlightBoxData.IsDepartureMovement == false &&
                                                       x.FlightBoxData.IsMaintenanceFlight == false &&
                                                       x.FlightBoxData.IsTowFlight == false &&
                                                       x.FlightBoxData.IgnoreLandingTax == false &&
                                                       x.MemberNumberInProffixNotFound)
                                 .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised($"Exportiere Proffix-Daten mit fehlerhaften Mitgliedernummern in Datei: {exportFilename}");
                    var exporter = new ProffixDataCsvExporter(exportFilename, listToExport);
                    exporter.Export();
                    OnLogEventRaised(
                        $"{exporter.NumberOfLinesExported} Proffix-Daten mit fehlerhaften Mitgliedernummern erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Proffix-Daten mit fehlerhaften Mitgliedernummern exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);

                exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_LdgTaxes_with_Remarks (to check and import in Proffix).csv");
                listToExport   = proffixDataList.Where(x => x.FlightBoxData.IsDepartureMovement == false &&
                                                       x.FlightBoxData.IsMaintenanceFlight == false &&
                                                       x.FlightBoxData.IsTowFlight == false &&
                                                       x.FlightBoxData.IgnoreLandingTax == false &&
                                                       string.IsNullOrWhiteSpace(x.FlightBoxData.Remarks) == false &&
                                                       x.MemberNumberInProffixNotFound == false)
                                 .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised(
                        $"Exportiere Daten mit Bemerkungen zur Prüfung und Importieren in Proffix in Datei: {exportFilename}");
                    var exporter = new ProffixDataCsvExporter(exportFilename, listToExport);
                    exporter.Export();
                    OnLogEventRaised(
                        $"{exporter.NumberOfLinesExported} Daten mit Bemerkungen zur Prüfung und Importieren in Proffix erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Daten mit Bemerkungen zur Prüfung und Importieren in Proffix exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);

                exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_No_LdgTaxes_without_Remarks (not to import).csv");
                listToExport   = proffixDataList.Where(x => (x.FlightBoxData.IsMaintenanceFlight ||
                                                             x.FlightBoxData.IsTowFlight ||
                                                             x.FlightBoxData.IgnoreLandingTax) &&
                                                       string.IsNullOrWhiteSpace(x.FlightBoxData.Remarks))
                                 .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised($"Exportiere Nicht-Proffix-Daten ohne Bemerkungen in Datei: {exportFilename}");
                    var exporter = new ProffixDataCsvExporter(exportFilename, listToExport);
                    exporter.Export();
                    OnLogEventRaised(
                        $"{exporter.NumberOfLinesExported} Nicht-Proffix-Daten ohne Bemerkungen erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Nicht-Proffix-Daten ohne Bemerkungen exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);

                exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_No_LdgTaxes_with_Remarks (to check and NO import in Proffix).csv");
                listToExport   = proffixDataList.Where(x => (x.FlightBoxData.IsMaintenanceFlight ||
                                                             x.FlightBoxData.IsTowFlight ||
                                                             x.FlightBoxData.IgnoreLandingTax) &&
                                                       string.IsNullOrWhiteSpace(x.FlightBoxData.Remarks) == false)
                                 .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised(
                        $"Exportiere Daten mit Bemerkungen zur Prüfung und NICHT importieren in Proffix in Datei: {exportFilename}");
                    var exporter = new ProffixDataCsvExporter(exportFilename, listToExport);
                    exporter.Export();
                    OnLogEventRaised(
                        $"{exporter.NumberOfLinesExported} Daten mit Bemerkungen zur Prüfung und NICHT importieren in Proffix erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Daten mit Bemerkungen zur Prüfung und NICHT importieren in Proffix exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);

                exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_Heli Sitterdorf.csv");
                listToExport   = proffixDataList.Where(x => x.MemberNumber == "999605" && x.FlightBoxData.IsDepartureMovement == false)
                                 .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised($"Exportiere Daten für Heli Sitterdorf in Datei: {exportFilename}");
                    var reportExporter = new ReportExporter(exportFilename, listToExport);
                    reportExporter.Export();
                    OnLogEventRaised(
                        $"{reportExporter.NumberOfLinesExported} Daten für Heli Sitterdorf erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Daten für Heli Sitterdorf exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);

                exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_Skydive.csv");
                listToExport   = proffixDataList.Where(x => x.MemberNumber == "703100" && x.FlightBoxData.IsDepartureMovement == false)
                                 .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised($"Exportiere Daten für Skydive in Datei: {exportFilename}");
                    var reportExporter = new ReportExporter(exportFilename, listToExport);
                    reportExporter.Export();
                    OnLogEventRaised(
                        $"{reportExporter.NumberOfLinesExported} Daten für Skydive erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Daten für Skydive exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);
                OnLogEventRaised(string.Empty);

                exportFilename = Path.Combine(folder, $"{CreationTimeStamp.ToString("yyyy-MM-dd-HHmm")}_Swiss oldies.csv");
                listToExport   = proffixDataList.Where(x => x.MemberNumber == "28" && x.FlightBoxData.IsDepartureMovement == false)
                                 .ToList();

                if (listToExport.Any())
                {
                    OnLogEventRaised($"Exportiere Daten für Swiss oldies in Datei: {exportFilename}");
                    var reportExporter = new ReportExporter(exportFilename, listToExport);
                    reportExporter.Export();
                    OnLogEventRaised(
                        $"{reportExporter.NumberOfLinesExported} Daten für Swiss oldies erfolgreich exportiert.");
                }
                else
                {
                    OnLogEventRaised(
                        $"Keine Daten für Swiss oldies exportiert. Datei: {exportFilename} wurde nicht erzeugt!");
                }

                Thread.Sleep(50);

                WriteLogFile();

                Thread.Sleep(50);

                ExportFinished?.Invoke(this, EventArgs.Empty);
            }
            catch (Exception e)
            {
                HasExportError     = true;
                ExportErrorMessage = e.Message;
                OnLogEventRaised("Fehler beim Convertieren..." + Environment.NewLine + "Fehlermeldung: " + e.Message);
                ExportFinished?.Invoke(this, EventArgs.Empty);
            }
        }