当前位置: 首页>>代码示例>>C#>>正文


C# GiftBatchTDS.RejectChanges方法代码示例

本文整理汇总了C#中GiftBatchTDS.RejectChanges方法的典型用法代码示例。如果您正苦于以下问题:C# GiftBatchTDS.RejectChanges方法的具体用法?C# GiftBatchTDS.RejectChanges怎么用?C# GiftBatchTDS.RejectChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GiftBatchTDS的用法示例。


在下文中一共展示了GiftBatchTDS.RejectChanges方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SubmitRecurringGiftBatch


//.........这里部分代码省略.........

                                GMainDS.AGift.Rows.Add(gift);
                                //TODO (not here, but in the client or while posting) Check for Ex-OM Partner
                                //TODO (not here, but in the client or while posting) Check for expired key ministry (while Posting)

                                foreach (ARecurringGiftDetailRow recGiftDetail in RMainDS.ARecurringGiftDetail.Rows)
                                {
                                    //decimal amtIntl = 0M;
                                    decimal amtBase = 0M;
                                    decimal amtTrans = 0M;

                                    if ((recGiftDetail.GiftTransactionNumber == recGift.GiftTransactionNumber)
                                        && (recGiftDetail.BatchNumber == ABatchNumber) && (recGiftDetail.LedgerNumber == ALedgerNumber)
                                        && ((recGiftDetail.StartDonations == null) || (recGiftDetail.StartDonations <= AEffectiveDate))
                                        && ((recGiftDetail.EndDonations == null) || (recGiftDetail.EndDonations >= AEffectiveDate))
                                        )
                                    {
                                        AGiftDetailRow detail = GMainDS.AGiftDetail.NewRowTyped();
                                        detail.LedgerNumber = gift.LedgerNumber;
                                        detail.BatchNumber = gift.BatchNumber;
                                        detail.GiftTransactionNumber = gift.GiftTransactionNumber;
                                        detail.DetailNumber = ++gift.LastDetailNumber;

                                        amtTrans = recGiftDetail.GiftAmount;
                                        detail.GiftTransactionAmount = amtTrans;
                                        batchTotal += amtTrans;
                                        amtBase = GLRoutines.Divide((decimal)amtTrans, AExchangeRateToBase);
                                        detail.GiftAmount = amtBase;

                                        if (!TransactionInIntlCurrency)
                                        {
                                            detail.GiftAmountIntl = GLRoutines.Divide((decimal)amtBase, AExchangeRateIntlToBase);
                                        }
                                        else
                                        {
                                            detail.GiftAmountIntl = amtTrans;
                                        }

                                        detail.RecipientKey = recGiftDetail.RecipientKey;
                                        detail.RecipientLedgerNumber = recGiftDetail.RecipientLedgerNumber;

                                        detail.ChargeFlag = recGiftDetail.ChargeFlag;
                                        detail.ConfidentialGiftFlag = recGiftDetail.ConfidentialGiftFlag;
                                        detail.TaxDeductible = recGiftDetail.TaxDeductible;
                                        detail.MailingCode = recGiftDetail.MailingCode;

                                        if (detail.MailingCode.Length == 0)
                                        {
                                            detail.SetMailingCodeNull();
                                        }

                                        detail.MotivationGroupCode = recGiftDetail.MotivationGroupCode;
                                        detail.MotivationDetailCode = recGiftDetail.MotivationDetailCode;

                                        detail.GiftCommentOne = recGiftDetail.GiftCommentOne;
                                        detail.CommentOneType = recGiftDetail.CommentOneType;
                                        detail.GiftCommentTwo = recGiftDetail.GiftCommentTwo;
                                        detail.CommentTwoType = recGiftDetail.CommentTwoType;
                                        detail.GiftCommentThree = recGiftDetail.GiftCommentThree;
                                        detail.CommentThreeType = recGiftDetail.CommentThreeType;

                                        if (TaxDeductiblePercentageEnabled)
                                        {
                                            // Sets TaxDeductiblePct and uses it to calculate the tax deductibility amounts for a Gift Detail
                                            TGift.SetDefaultTaxDeductibilityData(ref detail, gift.DateEntered, Transaction);
                                        }

                                        GMainDS.AGiftDetail.Rows.Add(detail);
                                    }
                                }

                                batch.BatchTotal = batchTotal;
                            }
                        }
                    }
                }

                AGiftBatchAccess.SubmitChanges(GMainDS.AGiftBatch, Transaction);

                ALedgerAccess.SubmitChanges(LedgerTable, Transaction);

                AGiftAccess.SubmitChanges(GMainDS.AGift, Transaction);

                AGiftDetailAccess.SubmitChanges(GMainDS.AGiftDetail, Transaction);

                DBAccess.GDBAccessObj.CommitTransaction();

                GMainDS.AcceptChanges();
            }
            catch (Exception Exc)
            {
                TLogging.Log("An Exception occured during the submission of a Recurring Gift Batch:" + Environment.NewLine + Exc.ToString());

                DBAccess.GDBAccessObj.RollbackTransaction();

                GMainDS.RejectChanges();

                throw;
            }
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:Gift.Transactions.cs


注:本文中的GiftBatchTDS.RejectChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。