/// <summary>
        /// Check for ex-worker or anonymous gift
        /// </summary>
        /// <param name="AGiftDetailsDT">GiftDetails for the recurring batch that is to be submitted</param>
        /// <returns></returns>
        public bool GiftHasExWorkerOrAnon(DataTable AGiftDetailsDT)
        {
            // alert the user to any recipients who are Ex-Workers
            // or alert the user to any gift that are not marked confidential but have an anonymous donor
            if (!TExtraGiftBatchChecks.CanContinueWithAnyExWorkers(TExtraGiftBatchChecks.GiftBatchAction.SUBMITTING,
                                                                   FMainDS,
                                                                   FPetraUtilsObject,
                                                                   AGiftDetailsDT) ||
                !TExtraGiftBatchChecks.CanContinueWithAnyAnonymousDonors(FMainDS)
                )
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
        /// <summary>
        /// Checks to be made before saving and posting
        /// </summary>
        /// <param name="APostingGiftDetails">GiftDetails for the batch that is to be posted</param>
        /// <param name="ACancelledDueToExWorkerOrAnonDonor">True if batch posting has been cancelled by the user because of an Ex-Worker recipient
        /// or an anonymous donor for a gift that is not marked as confidential</param>
        /// <returns>True if Save is successful</returns>
        public bool SaveChangesForPosting(DataTable APostingGiftDetails, out bool ACancelledDueToExWorkerOrAnonDonor)
        {
            // first alert the user to any recipients who are Ex-Workers
            ACancelledDueToExWorkerOrAnonDonor = !TExtraGiftBatchChecks.CanContinueWithAnyExWorkers(TExtraGiftBatchChecks.GiftBatchAction.POSTING,
                                                                                                    FMainDS,
                                                                                                    FPetraUtilsObject,
                                                                                                    APostingGiftDetails);

            // if save is continuing then alert the user to any gift that are not marked confidential but have an anonymous donor
            if (!ACancelledDueToExWorkerOrAnonDonor)
            {
                ACancelledDueToExWorkerOrAnonDonor = !TExtraGiftBatchChecks.CanContinueWithAnyAnonymousDonors(FMainDS);
            }

            if (!ACancelledDueToExWorkerOrAnonDonor)
            {
                return(SaveChanges());
            }

            return(false);
        }