Exemplo n.º 1
0
        static partial void ValidateGiftDetailManual(ref TVerificationResultCollection AVerificationResult,
                                                     TTypedDataTable ASubmitTable)
        {
            TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();

            ValidationControlsDict.Add(ASubmitTable.Columns[AGiftDetailTable.ColumnGiftCommentOneId],
                                       new TValidationControlsData(null, AGiftDetailTable.GetGiftCommentOneDBName()));

            TPartnerClass RecipientPartnerClass;
            string        RecipientDescription;

            for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
            {
                if (ASubmitTable.Rows[Counter].RowState != DataRowState.Deleted)
                {
                    TPartnerServerLookups.GetPartnerShortName(((GiftBatchTDSAGiftDetailRow)ASubmitTable.Rows[Counter]).RecipientKey,
                                                              out RecipientDescription,
                                                              out RecipientPartnerClass);
                    GiftBatchTDSAGiftDetailRow Row = (GiftBatchTDSAGiftDetailRow)ASubmitTable.Rows[Counter];
                    Row.RecipientClass = RecipientPartnerClass.ToString();

                    TSharedFinanceValidation_Gift.ValidateGiftDetailManual("TTransactionWebConnector" +
                                                                           " (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
                                                                           Row, ref AVerificationResult,
                                                                           ValidationControlsDict);
                }
            }
        }
Exemplo n.º 2
0
        private void ValidateDataDetailsManual(ARecurringGiftBatchRow ARow)
        {
            if (ARow == null)
            {
                return;
            }

            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            //Hash total special case in view of the textbox handling
            ParseHashTotal(ARow);

            TSharedFinanceValidation_Gift.ValidateRecurringGiftBatchManual(this, ARow, ref VerificationResultCollection,
                                                                           FValidationControlsDict);

            //TODO: remove this once database definition is set for Batch Description to be NOT NULL
            // Description is mandatory then make sure it is set
            if (txtDetailBatchDescription.Text.Length == 0)
            {
                DataColumn          ValidationColumn;
                TVerificationResult VerificationResult = null;
                object ValidationContext;

                ValidationColumn  = ARow.Table.Columns[ARecurringGiftBatchTable.ColumnBatchDescriptionId];
                ValidationContext = String.Format("Recurring Batch number {0}",
                                                  ARow.BatchNumber);

                VerificationResult = TStringChecks.StringMustNotBeEmpty(ARow.BatchDescription,
                                                                        "Description of " + ValidationContext,
                                                                        this, ValidationColumn, null);

                // Handle addition/removal to/from TVerificationResultCollection
                VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn, true);
            }
        }
Exemplo n.º 3
0
 static partial void ValidateRecurringGiftDetailManual(ref TVerificationResultCollection AVerificationResult,
                                                       TTypedDataTable ASubmitTable)
 {
     for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
     {
         TSharedFinanceValidation_Gift.ValidateRecurringGiftDetailManual("TTransactionWebConnector" +
                                                                         " (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
                                                                         (GiftBatchTDSARecurringGiftDetailRow)ASubmitTable.Rows[Counter], ref AVerificationResult);
     }
 }
Exemplo n.º 4
0
        private void ValidateTaxDeductiblePct(GiftBatchTDSAGiftDetailRow ARow, ref TVerificationResultCollection AVerificationResultCollection)
        {
            int PreValidationResultCount = AVerificationResultCollection.Count;

            TSharedFinanceValidation_Gift.ValidateTaxDeductiblePct(this, ARow, ref AVerificationResultCollection, FValidationControlsDict);

            //No validation errors occurred
            if (PreValidationResultCount == AVerificationResultCollection.Count)
            {
                ReconcileTaxDeductibleAmounts(ARow);
            }
        }
Exemplo n.º 5
0
        private void ValidateDataDetailsManual(ARecurringGiftBatchRow ARow)
        {
            if (ARow == null)
            {
                return;
            }

            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            //Hash total special case in view of the textbox handling
            ParseHashTotal(ARow);

            TSharedFinanceValidation_Gift.ValidateRecurringGiftBatchManual(this, ARow, ref VerificationResultCollection,
                                                                           FValidationControlsDict);
        }
Exemplo n.º 6
0
        static partial void ValidateRecurringGiftBatchManual(ref TVerificationResultCollection AVerificationResult,
                                                             TTypedDataTable ASubmitTable)
        {
            TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();

            ValidationControlsDict.Add(ASubmitTable.Columns[ARecurringGiftBatchTable.ColumnBatchDescriptionId],
                                       new TValidationControlsData(null, ARecurringGiftBatchTable.GetBatchDescriptionDBName()));

            for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
            {
                TSharedFinanceValidation_Gift.ValidateRecurringGiftBatchManual("TTransactionWebConnector" +
                                                                               " (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
                                                                               (ARecurringGiftBatchRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
                                                                               ValidationControlsDict);
            }
        }
Exemplo n.º 7
0
        private void ValidateDataDetailsManual(AMotivationDetailRow ARow)
        {
            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;
            DataColumn ValidationColumn;
            TValidationControlsData ValidationControlsData;
            TVerificationResult     VerificationResult;
            Boolean KeyMinistryActive;

            // Partner Key must be for a Key Ministry and Key Ministry must not be deactivated
            if (Convert.ToInt64(txtDetailRecipientKey.Text) != 0)
            {
                ValidationColumn = FMainDS.AMotivationDetail[0].Table.Columns[AMotivationDetailTable.ColumnRecipientKeyId];

                if (FPetraUtilsObject.ValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
                {
                    if (TRemote.MFinance.Gift.WebConnectors.KeyMinistryExists(Convert.ToInt64(txtDetailRecipientKey.Text), out KeyMinistryActive))
                    {
                        if (!KeyMinistryActive)
                        {
                            // Key Ministry is deactivated and therefore can't be used here
                            VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                       ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_KEY_MINISTRY_DEACTIVATED)),
                                                                               ValidationColumn, ValidationControlsData.ValidationControl);

                            // Handle addition to/removal from TVerificationResultCollection.
                            VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn);
                        }
                    }
                    else
                    {
                        // Partner Key does not refer to Key Ministry
                        VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                   ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_NOT_A_KEY_MINISTRY)),
                                                                           ValidationColumn, ValidationControlsData.ValidationControl);

                        // Handle addition to/removal from TVerificationResultCollection.
                        VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn);
                    }
                }
            }

            TSharedFinanceValidation_Gift.ValidateGiftMotivationSetupManual(this,
                                                                            ARow, FTaxDeductiblePercentageEnabled,
                                                                            ref VerificationResultCollection,
                                                                            FPetraUtilsObject.ValidationControlsDict);
        }
        private void ValidateDataDetailsManual(AGiftBatchRow ARow)
        {
            if ((ARow == null) || (ARow.BatchStatus != MFinanceConstants.BATCH_UNPOSTED))
            {
                return;
            }

            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            //Hash total special case in view of the textbox handling
            ParseHashTotal(ARow);

            //Check if the user has made a Bank Cost Centre or Account Code inactive
            //this was removed because of speed issues!
            //TODO: Revisit this
            //RefreshBankCostCentreAndAccountCodes();

            TSharedFinanceValidation_Gift.ValidateGiftBatchManual(this, ARow, ref VerificationResultCollection,
                                                                  FValidationControlsDict, FAccountTable, FCostCentreTable);
        }
Exemplo n.º 9
0
        private void ValidateDataDetailsManual(AGiftBatchRow ARow)
        {
            if ((ARow == null) || (ARow.BatchStatus != MFinanceConstants.BATCH_UNPOSTED))
            {
                return;
            }

            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            //Hash total special case in view of the textbox handling
            ParseHashTotal(ARow);

            //Check if the user has made a Bank Cost Centre or Account Code inactive
            //this was removed because of speed issues!
            //TODO: Revisit this
            //RefreshBankCostCentreAndAccountCodes();

            TSharedFinanceValidation_Gift.ValidateGiftBatchManual(this, ARow, ref VerificationResultCollection,
                                                                  FValidationControlsDict, FAccountTable, FCostCentreTable);

            //TODO: remove this once database definition is set for Batch Description to be NOT NULL
            // Description is mandatory then make sure it is set
            if (txtDetailBatchDescription.Text.Length == 0)
            {
                DataColumn          ValidationColumn;
                TVerificationResult VerificationResult = null;
                object ValidationContext;

                ValidationColumn  = ARow.Table.Columns[AGiftBatchTable.ColumnBatchDescriptionId];
                ValidationContext = String.Format("Batch number {0}",
                                                  ARow.BatchNumber);

                VerificationResult = TStringChecks.StringMustNotBeEmpty(ARow.BatchDescription,
                                                                        "Description of " + ValidationContext,
                                                                        this, ValidationColumn, null);

                // Handle addition/removal to/from TVerificationResultCollection
                VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn, true);
            }
        }
 private void ValidateTaxDeductiblePct(GiftBatchTDSAGiftDetailRow ARow, ref TVerificationResultCollection AVerificationResultCollection)
 {
     TSharedFinanceValidation_Gift.ValidateTaxDeductiblePct(this, ARow, ref AVerificationResultCollection, FValidationControlsDict);
 }