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


C# GiftBatchTDS类代码示例

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


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

示例1: TaxDeductiblePctAdjustment

        // carry out the adjustment
        /// <summary>
        /// Carry out a Tax Deductible Pct adjustment.
        /// </summary>
        /// <param name="ARecipientKey"></param>
        /// <param name="ANewPct"></param>
        /// <param name="AValidFrom"></param>
        /// <param name="ANoReceipt"></param>
        /// <param name="AParentForm"></param>
        public static void TaxDeductiblePctAdjustment(Int64 ARecipientKey, decimal ANewPct, DateTime AValidFrom, bool ANoReceipt, Form AParentForm)
        {
            GiftBatchTDS GiftBatchDS = new GiftBatchTDS();

            // get all the data needed for this Field Adjustment
            if (!GetAllDataNeeded(ref GiftBatchDS, ARecipientKey, ANewPct, AValidFrom, AParentForm))
            {
                return;
            }

            // show the list of gifts to be adjusted and ask the user for confirmation
            TFrmGiftFieldAdjustmentConfirmation ConfirmationForm = new TFrmGiftFieldAdjustmentConfirmation(AParentForm);
            ConfirmationForm.MainDS = GiftBatchDS;
            ConfirmationForm.Text = Catalog.GetString("Confirm Tax Deductible Percentage Adjustment");

            if (ConfirmationForm.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }

            // Carry out the gift adjustment
            TFrmGiftFieldAdjustment.GiftAdjustment(GiftBatchDS, ANewPct, ANoReceipt, AParentForm);

            // refresh gift batch screen
            TFormsMessage broadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcRefreshGiftBatches, AParentForm.ToString());
            TFormsList.GFormsList.BroadcastFormMessage(broadcastMessage);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:36,代码来源:GiftTaxDedutiblePctAdjustment.cs

示例2: LoadMotivationDetails

        public static GiftBatchTDS LoadMotivationDetails(Int32 ALedgerNumber)
        {
            GiftBatchTDS MainDS = new GiftBatchTDS();

            TDBTransaction Transaction = null;

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted,
                TEnforceIsolationLevel.eilMinimum,
                ref Transaction,
                delegate
                {
                    ALedgerAccess.LoadByPrimaryKey(MainDS, ALedgerNumber, Transaction);
                    AMotivationGroupAccess.LoadViaALedger(MainDS, ALedgerNumber, Transaction);
                    AMotivationDetailAccess.LoadViaALedger(MainDS, ALedgerNumber, Transaction);
                    AMotivationDetailFeeAccess.LoadViaALedger(MainDS, ALedgerNumber, Transaction);
                });

            // Accept row changes here so that the Client gets 'unmodified' rows
            MainDS.AcceptChanges();

            // Remove all Tables that were not filled with data before remoting them.
            MainDS.RemoveEmptyTables();

            return MainDS;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:25,代码来源:Gift.Setup.cs

示例3: CreateANewGiftBatchRow

        /// <summary>
        /// create a new batch with a consecutive batch number in the ledger
        /// for call inside a server function
        /// for performance reasons submitting (save the data in the database) is done later (not here)
        /// </summary>
        /// <param name="MainDS"></param>
        /// <param name="Transaction"></param>
        /// <param name="LedgerTable"></param>
        /// <param name="ALedgerNumber"></param>
        /// <param name="ADateEffective"></param>
        /// <param name="AForceEffectiveDateToFit"></param>
        /// <returns>the new gift batch row</returns>
        public static AGiftBatchRow CreateANewGiftBatchRow(ref GiftBatchTDS MainDS,
            ref TDBTransaction Transaction,
            ref ALedgerTable LedgerTable,
            Int32 ALedgerNumber,
            DateTime ADateEffective,
            bool AForceEffectiveDateToFit = true)
        {
            AGiftBatchRow NewRow = MainDS.AGiftBatch.NewRowTyped(true);

            NewRow.LedgerNumber = ALedgerNumber;
            LedgerTable[0].LastGiftBatchNumber++;
            NewRow.BatchNumber = LedgerTable[0].LastGiftBatchNumber;
            Int32 BatchYear, BatchPeriod;
            // if DateEffective is outside the range of open periods, use the most fitting date
            TFinancialYear.GetLedgerDatePostingPeriod(ALedgerNumber,
                ref ADateEffective,
                out BatchYear,
                out BatchPeriod,
                Transaction,
                AForceEffectiveDateToFit);
            NewRow.BatchYear = BatchYear;
            NewRow.BatchPeriod = BatchPeriod;
            NewRow.GlEffectiveDate = ADateEffective;
            NewRow.ExchangeRateToBase = 1.0M;
            NewRow.BatchDescription = "PLEASE ENTER A DESCRIPTION";
            NewRow.BankAccountCode = TLedgerInfo.GetDefaultBankAccount(ALedgerNumber);
            NewRow.BankCostCentre = TLedgerInfo.GetStandardCostCentre(ALedgerNumber);
            NewRow.CurrencyCode = LedgerTable[0].BaseCurrency;
            MainDS.AGiftBatch.Rows.Add(NewRow);
            return NewRow;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:43,代码来源:Gift.Batch.cs

示例4: TUC_GiftBatches_Cancel

        /// <summary>
        /// Constructor
        /// </summary>
        public TUC_GiftBatches_Cancel(TFrmPetraEditUtils APetraUtilsObject, Int32 ALedgerNumber, GiftBatchTDS AMainDS)
        {
            FPetraUtilsObject = APetraUtilsObject;
            FLedgerNumber = ALedgerNumber;
            FMainDS = AMainDS;

            FMyForm = (TFrmGiftBatch)FPetraUtilsObject.GetForm();
        }
开发者ID:Kingefosa,项目名称:openpetra,代码行数:11,代码来源:UC_GiftBatches.Cancel.ManualCode.cs

示例5: TUC_GiftBatches_AccountAndCostCentre

        /// <summary>
        /// Constructor
        /// </summary>
        public TUC_GiftBatches_AccountAndCostCentre(Int32 ALedgerNumber,
            GiftBatchTDS AMainDS,
            TCmbAutoPopulated ACmbBankAccountCode,
            TCmbAutoPopulated ACmbCostCentreCode)
        {
            FLedgerNumber = ALedgerNumber;
            FMainDS = AMainDS;

            FCmbBankAccountCode = ACmbBankAccountCode;
            FCmbCostCentreCode = ACmbCostCentreCode;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:14,代码来源:UC_GiftBatches.AccountAndCostCentre.ManualCode.cs

示例6: GetGiftsForReverseAdjust

        public static bool GetGiftsForReverseAdjust(
            Hashtable requestParams, ref GiftBatchTDS AGiftDS, out TVerificationResultCollection AMessages)
        {
            GiftAdjustmentFunctionEnum Function = (GiftAdjustmentFunctionEnum)requestParams["Function"];
            Int32 LedgerNumber = (Int32)requestParams["ALedgerNumber"];
            Int32 GiftDetailNumber = (Int32)requestParams["GiftDetailNumber"];
            Int32 GiftNumber = (Int32)requestParams["GiftNumber"];
            Int32 BatchNumber = (Int32)requestParams["BatchNumber"];

            AMessages = new TVerificationResultCollection();
            GiftBatchTDS MainDS = new GiftBatchTDS();

            TDBTransaction Transaction = null;

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted,
                TEnforceIsolationLevel.eilMinimum,
                ref Transaction,
                delegate
                {
                    // get data needed for new gifts
                    if (Function.Equals(GiftAdjustmentFunctionEnum.ReverseGiftBatch))
                    {
                        AGiftAccess.LoadViaAGiftBatch(MainDS, LedgerNumber, BatchNumber, Transaction);

                        foreach (AGiftRow gift in MainDS.AGift.Rows)
                        {
                            AGiftDetailAccess.LoadViaAGift(MainDS, LedgerNumber, BatchNumber, gift.GiftTransactionNumber, Transaction);
                        }
                    }
                    else
                    {
                        AGiftAccess.LoadByPrimaryKey(MainDS, LedgerNumber, BatchNumber, GiftNumber, Transaction);

                        if (Function.Equals(GiftAdjustmentFunctionEnum.ReverseGiftDetail))
                        {
                            AGiftDetailAccess.LoadByPrimaryKey(MainDS, LedgerNumber, BatchNumber, GiftNumber, GiftDetailNumber, Transaction);
                        }
                        else
                        {
                            AGiftDetailAccess.LoadViaAGift(MainDS, LedgerNumber, BatchNumber, GiftNumber, Transaction);
                        }
                    }
                });

            AGiftDS = MainDS;

            return CheckGiftsNotPreviouslyReversed(AGiftDS, out AMessages);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:48,代码来源:Gift.Adjustment.cs

示例7: GetAllDataNeeded

        private static bool GetAllDataNeeded(ref GiftBatchTDS AGiftBatchDS, Int64 ARecipientKey, decimal ANewPct, DateTime AValidFrom, Form AForm)
        {
            Boolean ok;
            TVerificationResultCollection Messages;

            try
            {
                AForm.Cursor = Cursors.WaitCursor;

                ok = TRemote.MFinance.Gift.WebConnectors.GetGiftsForTaxDeductiblePctAdjustment(
                    ref AGiftBatchDS,
                    ARecipientKey,
                    AValidFrom,
                    ANewPct,
                    out Messages);
            }
            finally
            {
                AForm.Cursor = Cursors.Default;
            }

            // If one or more of the gifts have already been reversed.
            if (!ok)
            {
                if (Messages.Count > 0)
                {
                    foreach (TVerificationResult message in Messages)
                    {
                        if (message.ResultText.Length > 0)
                        {
                            MessageBox.Show(AForm.Text + Catalog.GetString(" cancelled. ") + message.ResultText,
                                Catalog.GetString("Tax Deductible Percentage Adjust"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }

                return false;
            }

            // if there are no gifts to be adjusted
            if ((AGiftBatchDS.AGiftDetail == null) || (AGiftBatchDS.AGiftDetail.Rows.Count == 0))
            {
                MessageBox.Show(Catalog.GetString("There are no gifts to adjust."));
                return false;
            }

            return true;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:48,代码来源:GiftTaxDedutiblePctAdjustment.cs

示例8: UpdateRecord

        public void UpdateRecord()
        {
            TDBTransaction ReadTransaction = null;
            GiftBatchTDS MainDS = new GiftBatchTDS();

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(
                IsolationLevel.ReadCommitted, TEnforceIsolationLevel.eilMinimum, ref ReadTransaction,
                delegate
                {
                    ALedgerAccess.LoadAll(MainDS, ReadTransaction);
                });

            MainDS.ALedger[0].LastGiftBatchNumber++;

            AGiftBatchRow batch = MainDS.AGiftBatch.NewRowTyped();
            batch.LedgerNumber = MainDS.ALedger[0].LedgerNumber;
            batch.BatchNumber = MainDS.ALedger[0].LastGiftBatchNumber;
            batch.BankAccountCode = "6000";
            batch.BatchYear = 0;
            batch.BatchPeriod = 1;
            batch.CurrencyCode = "EUR";
            batch.BatchDescription = "test";
            batch.BankCostCentre = (MainDS.ALedger[0].LedgerNumber * 100).ToString("0000");
            batch.LastGiftNumber = 0;
            batch.HashTotal = 83;
            MainDS.AGiftBatch.Rows.Add(batch);

            GiftBatchTDSAccess.SubmitChanges(MainDS);
            MainDS.AcceptChanges();

            MainDS.AGiftBatch[0].BatchDescription = "test2";
            GiftBatchTDSAccess.SubmitChanges(MainDS);


            TDBTransaction transaction = null;
            AGiftBatchTable batches = null;
            DBAccess.GDBAccessObj.BeginAutoReadTransaction(ref transaction,
                delegate
                {
                    batches = AGiftBatchAccess.LoadByPrimaryKey(batch.LedgerNumber, batch.BatchNumber, transaction);
                });

            // some problems with sqlite and datagrid
            Assert.AreEqual(typeof(decimal), batches[0][AGiftBatchTable.ColumnHashTotalId].GetType(), "type decimal");
            Assert.AreEqual(83.0m, batches[0].HashTotal, "gift batch hashtotal does not equal");
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:46,代码来源:test.cs

示例9: PostBatches

        /// <summary>
        /// post all gift batches in the given period, but leave some (or none) unposted
        /// </summary>
        public static bool PostBatches(int AYear, int APeriod, int ALeaveBatchesUnposted = 0)
        {
            GiftBatchTDS MainDS = new GiftBatchTDS();

            AGiftBatchRow GiftBatchTemplateRow = MainDS.AGiftBatch.NewRowTyped(false);

            GiftBatchTemplateRow.LedgerNumber = FLedgerNumber;
            GiftBatchTemplateRow.BatchYear = AYear;
            GiftBatchTemplateRow.BatchPeriod = APeriod;
            GiftBatchTemplateRow.BatchStatus = MFinanceConstants.BATCH_UNPOSTED;
            AGiftBatchAccess.LoadUsingTemplate(MainDS, GiftBatchTemplateRow, null);

            int countUnPosted = MainDS.AGiftBatch.Count;

            List <Int32>GiftBatchesToPost = new List <int>();

            foreach (AGiftBatchRow batch in MainDS.AGiftBatch.Rows)
            {
                if (countUnPosted <= ALeaveBatchesUnposted)
                {
                    break;
                }

                countUnPosted--;

                GiftBatchesToPost.Add(batch.BatchNumber);
            }

            TVerificationResultCollection VerificationResult;

            if (!TGiftTransactionWebConnector.PostGiftBatches(FLedgerNumber, GiftBatchesToPost, out VerificationResult))
            {
                TLogging.Log(VerificationResult.BuildVerificationResultString());
                return false;
            }

            return true;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:41,代码来源:GenerateGiftBatches.cs

示例10: CreateAGiftBatch

        public static GiftBatchTDS CreateAGiftBatch(Int32 ALedgerNumber, DateTime ADateEffective, string ABatchDescription)
        {
            GiftBatchTDS MainDS = new GiftBatchTDS();

            TDBTransaction ReadWriteTransaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.Serializable);

            try
            {
                ALedgerTable LedgerTable = ALedgerAccess.LoadByPrimaryKey(ALedgerNumber, ReadWriteTransaction);

                TGiftBatchFunctions.CreateANewGiftBatchRow(ref MainDS, ref ReadWriteTransaction, ref LedgerTable, ALedgerNumber, ADateEffective);

                if (ABatchDescription.Length > 0)
                {
                    MainDS.AGiftBatch[0].BatchDescription = ABatchDescription;
                }

                AGiftBatchAccess.SubmitChanges(MainDS.AGiftBatch, ReadWriteTransaction);

                ALedgerAccess.SubmitChanges(LedgerTable, ReadWriteTransaction);

                MainDS.AGiftBatch.AcceptChanges();

                DBAccess.GDBAccessObj.CommitTransaction();
            }
            catch (Exception Exc)
            {
                TLogging.Log("An Exception occured during the creation of a Gift Batch record:" + Environment.NewLine + Exc.ToString());

                DBAccess.GDBAccessObj.RollbackTransaction();

                throw;
            }

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

示例11: CreateANewRecurringGiftBatchRow

        /// <summary>
        /// create a new batch with a consecutive batch number in the ledger
        /// for call inside a server function
        /// for performance reasons submitting (save the data in the database) is done later (not here)
        /// </summary>
        /// <param name="MainDS"></param>
        /// <param name="Transaction"></param>
        /// <param name="LedgerTable"></param>
        /// <param name="ALedgerNumber"></param>
        /// <returns>the new gift batch row</returns>
        public static ARecurringGiftBatchRow CreateANewRecurringGiftBatchRow(ref GiftBatchTDS MainDS,
            ref TDBTransaction Transaction,
            ref ALedgerTable LedgerTable,
            Int32 ALedgerNumber)
        {
            GiftBatchTDS Temp = new GiftBatchTDS();

            ARecurringGiftBatchAccess.LoadViaALedger(Temp, LedgerTable[0].LedgerNumber, Transaction);

            DataView RecurringGiftBatchDV = new DataView(Temp.ARecurringGiftBatch);
            RecurringGiftBatchDV.RowFilter = string.Empty;
            RecurringGiftBatchDV.Sort = string.Format("{0} DESC",
                ARecurringGiftBatchTable.GetBatchNumberDBName());

            //Recurring batch numbers can be reused so check each time for current highest number
            if (RecurringGiftBatchDV.Count > 0)
            {
                LedgerTable[0].LastRecGiftBatchNumber = (int)(RecurringGiftBatchDV[0][ARecurringGiftBatchTable.GetBatchNumberDBName()]);
            }
            else
            {
                LedgerTable[0].LastRecGiftBatchNumber = 0;
            }

            ARecurringGiftBatchRow NewRow = MainDS.ARecurringGiftBatch.NewRowTyped(true);

            NewRow.LedgerNumber = ALedgerNumber;
            NewRow.BatchNumber = ++LedgerTable[0].LastRecGiftBatchNumber;
            NewRow.BatchDescription = Catalog.GetString("Please enter recurring batch description");
            NewRow.BankAccountCode = TLedgerInfo.GetDefaultBankAccount(ALedgerNumber);
            NewRow.BankCostCentre = TLedgerInfo.GetStandardCostCentre(ALedgerNumber);
            NewRow.CurrencyCode = LedgerTable[0].BaseCurrency;
            MainDS.ARecurringGiftBatch.Rows.Add(NewRow);
            return NewRow;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:45,代码来源:Gift.Batch.cs

示例12: StoreManualCode

        // This manual method lets us peek at the data that is about to be saved...
        // The data has already been collected from the contols and validated and there is definitely something to save...
        private TSubmitChangesResult StoreManualCode(ref GiftBatchTDS SubmitDS, out TVerificationResultCollection VerificationResult)
        {
            FLatestSaveIncludedForex = false;

            if (SubmitDS.AGiftBatch != null)
            {
                // Check whether we are saving any rows that are in foreign currency
                foreach (AGiftBatchRow row in SubmitDS.AGiftBatch.Rows)
                {
                    if (row.CurrencyCode != FMainDS.ALedger[0].BaseCurrency)
                    {
                        FLatestSaveIncludedForex = true;
                        break;
                    }
                }
            }

            // Now do the standard call to save the changes
            return TRemote.MFinance.Gift.WebConnectors.SaveGiftBatchTDS(ref SubmitDS, out VerificationResult);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:22,代码来源:GiftBatch.ManualCode.cs

示例13: StoreManualCode

        private TSubmitChangesResult StoreManualCode(ref GiftBatchTDS ASubmitChanges, out TVerificationResultCollection AVerificationResult)
        {
            AVerificationResult = null;

            TSubmitChangesResult result = TRemote.MFinance.Gift.WebConnectors.SaveMotivationDetails(ref ASubmitChanges);

            if (result == TSubmitChangesResult.scrOK)
            {
                TDataCache.TMFinance.RefreshCacheableFinanceTable(TCacheableFinanceTablesEnum.MotivationGroupList, FLedgerNumber);
            }

            return result;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:13,代码来源:MotivationGroupSetup.ManualCode.cs

示例14: GetGiftsForTaxDeductiblePctAdjustment

        public static bool GetGiftsForTaxDeductiblePctAdjustment(ref GiftBatchTDS AGiftDS,
            Int64 ARecipientKey,
            DateTime ADateFrom,
            decimal ANewPct,
            out TVerificationResultCollection AMessages)
        {
            TDBTransaction Transaction = null;
            GiftBatchTDS MainDS = new GiftBatchTDS();

            AMessages = new TVerificationResultCollection();

            DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.ReadCommitted, ref Transaction,
                delegate
                {
                    string Query = "SELECT a_gift_detail.*" +

                                   " FROM a_gift_detail, a_gift_batch" +

                                   " WHERE a_gift_detail.p_recipient_key_n = " + ARecipientKey +
                                   " AND a_gift_detail.a_tax_deductible_pct_n <> " + ANewPct +
                                   " AND a_gift_detail.a_modified_detail_l <> true" +
                                   " AND a_gift_detail.a_tax_deductible_l = true" +
                                   " AND a_gift_batch.a_ledger_number_i = a_gift_detail.a_ledger_number_i" +
                                   " AND a_gift_batch.a_batch_number_i = a_gift_detail.a_batch_number_i" +
                                   " AND a_gift_batch.a_ledger_number_i = a_gift_detail.a_ledger_number_i" +
                                   " AND a_gift_batch.a_batch_status_c = 'Posted' " +
                                   " AND a_gift_batch.a_gl_effective_date_d >= '" + ADateFrom.ToString("yyyy-MM-dd") + "'";

                    DBAccess.GDBAccessObj.Select(MainDS, Query, MainDS.AGiftDetail.TableName, Transaction);

                    // get additional data
                    foreach (GiftBatchTDSAGiftDetailRow Row in MainDS.AGiftDetail.Rows)
                    {
                        AGiftBatchAccess.LoadByPrimaryKey(MainDS, Row.LedgerNumber, Row.BatchNumber, Transaction);
                        AGiftRow GiftRow =
                            AGiftAccess.LoadByPrimaryKey(MainDS, Row.LedgerNumber, Row.BatchNumber, Row.GiftTransactionNumber, Transaction);

                        Row.DateEntered = GiftRow.DateEntered;
                        Row.DonorKey = GiftRow.DonorKey;
                        Row.DonorName = PPartnerAccess.LoadByPrimaryKey(Row.DonorKey, Transaction)[0].PartnerShortName;
                    }
                });

            AGiftDS = MainDS;

            return TAdjustmentWebConnector.CheckGiftsNotPreviouslyReversed(AGiftDS, out AMessages);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:47,代码来源:Gift.TaxDeductiblePct.cs

示例15: GetRecipientFundNumberInner

        private static Int64 GetRecipientFundNumberInner(GiftBatchTDS AMainDS, Int64 APartnerKey, DateTime? AGiftDate = null)
        {
            #region Validate Arguments

            if (AMainDS == null)
            {
                throw new EFinanceSystemDataObjectNullOrEmptyException(String.Format(Catalog.GetString(
                            "Function:{0} - The Gift Batch dataset is null!"),
                        Utilities.GetMethodName(true)));
            }
            else if (APartnerKey < 0)
            {
                throw new ArgumentException(String.Format(Catalog.GetString("Function:{0} - The Partner Key must be greater than 0!"),
                        Utilities.GetMethodName(true)));
            }

            #endregion Validate Arguments

            TDBTransaction Transaction = null;

            if (APartnerKey == 0)
            {
                return 0;
            }

            //Look in RecipientFamily table
            PFamilyRow FamilyRow = (PFamilyRow)AMainDS.RecipientFamily.Rows.Find(APartnerKey);

            if (FamilyRow != null)
            {
                return GetGiftDestinationForRecipient(APartnerKey, AGiftDate);
            }

            //Look in RecipientPerson table
            PPersonRow PersonRow = (PPersonRow)AMainDS.RecipientPerson.Rows.Find(APartnerKey);

            if (PersonRow != null)
            {
                return GetGiftDestinationForRecipient(PersonRow.FamilyKey, AGiftDate);
            }

            //Check that LedgerPartnertypes are already loaded
            if ((AMainDS.LedgerPartnerTypes != null) && (AMainDS.LedgerPartnerTypes.Count == 0))
            {
                PPartnerTypeTable PPTTable = null;

                DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted,
                    TEnforceIsolationLevel.eilMinimum,
                    ref Transaction,
                    delegate
                    {
                        PPTTable = PPartnerTypeAccess.LoadViaPType(MPartnerConstants.PARTNERTYPE_LEDGER, Transaction);

                        #region Validate Data

                        if ((PPTTable == null) || (PPTTable.Count == 0))
                        {
                            throw new EFinanceSystemDataTableReturnedNoDataException(String.Format(Catalog.GetString(
                                        "Function:{0} - Ledger Partner Types data does not exist or could not be accessed!"),
                                    Utilities.GetMethodName(true)));
                        }

                        #endregion Validate Data
                    });

                AMainDS.LedgerPartnerTypes.Merge(PPTTable);
            }

            if ((AMainDS.LedgerPartnerTypes != null)
                && (AMainDS.LedgerPartnerTypes.Rows.Find(new object[] { APartnerKey, MPartnerConstants.PARTNERTYPE_LEDGER }) != null))
            {
                //TODO Warning on inactive Fund from p_partner table
                return APartnerKey;
            }

            UmUnitStructureTable UnitStructTbl = null;

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted,
                TEnforceIsolationLevel.eilMinimum,
                ref Transaction,
                delegate
                {
                    UnitStructTbl = UmUnitStructureAccess.LoadViaPUnitChildUnitKey(APartnerKey, Transaction);
                });

            if ((UnitStructTbl != null) && (UnitStructTbl.Rows.Count > 0))
            {
                UmUnitStructureRow structureRow = UnitStructTbl[0];

                if (structureRow.ParentUnitKey == structureRow.ChildUnitKey)
                {
                    // should not get here
                    TLogging.Log("GetRecipientFundNumberInner: - should not get here");
                    return 0;
                }

                // recursive call until we find a partner that has partnertype LEDGER
                return GetRecipientFundNumberInner(AMainDS, structureRow.ParentUnitKey);
            }
            else
//.........这里部分代码省略.........
开发者ID:Davincier,项目名称:openpetra,代码行数:101,代码来源:Gift.Transactions.cs


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