private void ExportBatches(System.Object sender, System.EventArgs e) { if (FPetraUtilsObject.HasChanges) { // without save the server does not have the current changes, so forbid it. MessageBox.Show(Catalog.GetString("Please save changed Data before the Export!"), Catalog.GetString("Export Error")); return; } TFrmGiftBatchExport exportForm = new TFrmGiftBatchExport(FPetraUtilsObject.GetForm()); exportForm.LedgerNumber = FLedgerNumber; exportForm.Show(); }
private void ExportGiftBatchThread(bool AWithInteractionOnSuccess) { TVerificationResultCollection VerificationResult; Int32 GiftBatchNumber = FPluginRemote.WebConnectors.CreateGiftBatch( FLedgerNumber, CurrentStatement.StatementKey, -1, out VerificationResult); if (GiftBatchNumber != -1) { if ((VerificationResult != null) && (VerificationResult.Count > 0)) { MessageBox.Show( VerificationResult.BuildVerificationResultString(), Catalog.GetString("Info: gift batch has been created")); } // export to csv TFrmGiftBatchExport exportForm = new TFrmGiftBatchExport(FPetraUtilsObject.GetForm()); exportForm.LedgerNumber = FLedgerNumber; exportForm.FirstBatchNumber = GiftBatchNumber; exportForm.LastBatchNumber = GiftBatchNumber; exportForm.IncludeUnpostedBatches = true; if (TAppSettingsManager.HasValue("NumberFormat")) { exportForm.NumberFormat = TAppSettingsManager.GetValue("NumberFormat"); } exportForm.TransactionsOnly = true; exportForm.ExtraColumns = false; exportForm.OutputFilename = TAppSettingsManager.GetValue("BankImport.GiftBatchExportFilename", TAppSettingsManager.GetValue("OpenPetra.PathTemp") + Path.DirectorySeparatorChar + "giftBatch" + GiftBatchNumber.ToString("000000") + ".csv"); exportForm.ExportBatches(AWithInteractionOnSuccess); } else { if (VerificationResult != null) { MessageBox.Show( VerificationResult.BuildVerificationResultString(), Catalog.GetString("Problem: No gift batch has been created")); } else { MessageBox.Show( Catalog.GetString("Problem: No gift batch has been created")); } } }