Exemplo n.º 1
0
        private void SubmitBatch(System.Object sender, System.EventArgs e)
        {
            bool Success = false;

            bool             LoadDialogVisible = false;
            TFrmStatusDialog dlgStatus         = new TFrmStatusDialog(FPetraUtilsObject.GetForm());

            if ((GetSelectedRowIndex() < 0) || (FPreviouslySelectedDetailRow == null))
            {
                MessageBox.Show(Catalog.GetString("Please select a Recurring Batch before submitting."));
                return;
            }

            try
            {
                bool submittingAlreadyConfirmed = false;

                Cursor = Cursors.WaitCursor;

                dlgStatus.Show();
                LoadDialogVisible       = true;
                dlgStatus.Heading       = String.Format(Catalog.GetString("Recurring Gift Batch {0}"), FSelectedBatchNumber);
                dlgStatus.CurrentStatus = Catalog.GetString("Loading gifts ready for submitting...");

                if (!LoadAllBatchData(FSelectedBatchNumber))
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(Catalog.GetString("The Recurring Gift Batch is empty!"), Catalog.GetString("Posting failed"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Stop);

                    dlgStatus.Close();
                    LoadDialogVisible = false;
                    return;
                }

                dlgStatus.CurrentStatus = Catalog.GetString("Checking for inactive values...");

                if (!AllowInactiveFieldValues(ref submittingAlreadyConfirmed))
                {
                    dlgStatus.Close();
                    LoadDialogVisible = false;
                    return;
                }

                dlgStatus.Close();
                LoadDialogVisible = false;

                Success = FSubmitLogicObject.SubmitBatch(FPreviouslySelectedDetailRow,
                                                         txtDetailHashTotal,
                                                         ref submittingAlreadyConfirmed);
            }
            catch (Exception ex)
            {
                TLogging.LogException(ex, Utilities.GetMethodSignature());
                throw;
            }
            finally
            {
                if (LoadDialogVisible)
                {
                    dlgStatus.Close();
                    LoadDialogVisible = false;
                }

                Cursor = Cursors.Default;
            }
        }
Exemplo n.º 2
0
        private void SubmitBatch(System.Object sender, System.EventArgs e)
        {
            bool Success = false;

            if ((GetSelectedRowIndex() < 0) || (FPreviouslySelectedDetailRow == null))
            {
                MessageBox.Show(Catalog.GetString("Please select a Recurring Gift Batch before submitting!"));
                return;
            }

            TFrmRecurringGiftBatch MainForm  = (TFrmRecurringGiftBatch)ParentForm;
            TFrmStatusDialog       dlgStatus = new TFrmStatusDialog(FPetraUtilsObject.GetForm());
            bool LoadDialogVisible           = false;

            try
            {
                Cursor = Cursors.WaitCursor;
                MainForm.FCurrentGiftBatchAction = TExtraGiftBatchChecks.GiftBatchAction.SUBMITTING;

                dlgStatus.Show();
                LoadDialogVisible       = true;
                dlgStatus.Heading       = String.Format(Catalog.GetString("Recurring Gift Batch {0}"), FSelectedBatchNumber);
                dlgStatus.CurrentStatus = Catalog.GetString("Loading gifts ready for submitting...");

                if (!LoadAllBatchData(FSelectedBatchNumber))
                {
                    Cursor = Cursors.Default;
                    MessageBox.Show(Catalog.GetString("The Recurring Gift Batch is empty!"),
                                    Catalog.GetString("Submit Gift Batch"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Stop);

                    dlgStatus.Close();
                    LoadDialogVisible = false;
                    return;
                }

                dlgStatus.Close();
                LoadDialogVisible = false;

                Success = FSubmitLogicObject.SubmitBatch(FPreviouslySelectedDetailRow,
                                                         FWarnOfInactiveValuesOnSubmitting,
                                                         FDonorZeroIsValid,
                                                         FRecipientZeroIsValid);
            }
            catch (Exception ex)
            {
                TLogging.LogException(ex, Utilities.GetMethodSignature());
                throw;
            }
            finally
            {
                if (LoadDialogVisible)
                {
                    dlgStatus.Close();
                    LoadDialogVisible = false;
                }

                MainForm.FCurrentGiftBatchAction = TExtraGiftBatchChecks.GiftBatchAction.NONE;
                Cursor = Cursors.Default;
            }
        }