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


C# GLBatchTDS.Copy方法代码示例

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


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

示例1: ProcessRecurringTransAndAttributesForDeletion

        public static GLBatchTDS ProcessRecurringTransAndAttributesForDeletion(GLBatchTDS AMainDS,
            Int32 ALedgerNumber,
            Int32 ABatchNumber,
            Int32 AJournalNumber,
            Int32 AHighestTransactionNumber,
            Int32 ATransactionToDelete)
        {
            #region Validate Arguments

            if (AMainDS == null)
            {
                throw new EFinanceSystemDataObjectNullOrEmptyException(String.Format(Catalog.GetString(
                            "Function:{0} - The Recurring GL Batch dataset is null!"),
                        Utilities.GetMethodName(true)));
            }

            if (ALedgerNumber <= 0)
            {
                throw new EFinanceSystemInvalidLedgerNumberException(String.Format(Catalog.GetString(
                            "Function:{0} - The Ledger number must be greater than 0!"),
                        Utilities.GetMethodName(true)), ALedgerNumber);
            }
            else if (ABatchNumber <= 0)
            {
                throw new EFinanceSystemInvalidBatchNumberException(String.Format(Catalog.GetString(
                            "Function:{0} - The Recurring Batch number must be greater than 0!"),
                        Utilities.GetMethodName(true)), ALedgerNumber, ABatchNumber);
            }
            else if (AJournalNumber <= 0)
            {
                throw new ArgumentException(String.Format(Catalog.GetString("Function:{0} - The Recurring Journal number must be greater than 0!"),
                        Utilities.GetMethodName(true)));
            }
            else if (AHighestTransactionNumber <= 0)
            {
                throw new ArgumentException(String.Format(Catalog.GetString(
                            "Function:{0} - The highest Transaction number in the Recurring Journal must be greater than 0!"),
                        Utilities.GetMethodName(true)));
            }
            else if (ATransactionToDelete <= 0)
            {
                throw new ArgumentException(String.Format(Catalog.GetString(
                            "Function:{0} - The number of the Transaction to delete must be greater than 0!"),
                        Utilities.GetMethodName(true)));
            }

            #endregion Validate Arguments

            GLBatchTDS MainDSCopy = (GLBatchTDS)AMainDS.Copy();
            MainDSCopy.Merge(AMainDS);
            MainDSCopy.AcceptChanges();

            GLBatchTDS SubmitDS = (GLBatchTDS)AMainDS.Copy();
            SubmitDS.Merge(AMainDS);
            SubmitDS.AcceptChanges();

            TDBTransaction Transaction = null;
            bool SubmissionOK = false;

            try
            {
                DBAccess.GDBAccessObj.BeginAutoTransaction(IsolationLevel.Serializable,
                    ref Transaction,
                    ref SubmissionOK,
                    delegate
                    {
                        //Delete current row+ (attributes first).
                        DataView attributesDV = new DataView(MainDSCopy.ARecurringTransAnalAttrib);
                        attributesDV.RowFilter = String.Format("{0}={1} AND {2}={3} AND {4}>={5}",
                            ARecurringTransAnalAttribTable.GetBatchNumberDBName(),
                            ABatchNumber,
                            ARecurringTransAnalAttribTable.GetJournalNumberDBName(),
                            AJournalNumber,
                            ARecurringTransAnalAttribTable.GetTransactionNumberDBName(),
                            ATransactionToDelete);

                        foreach (DataRowView attrDRV in attributesDV)
                        {
                            ARecurringTransAnalAttribRow attrRow = (ARecurringTransAnalAttribRow)attrDRV.Row;
                            attrRow.Delete();
                        }

                        DataView transactionsDV = new DataView(MainDSCopy.ARecurringTransaction);
                        transactionsDV.RowFilter = String.Format("{0}={1} AND {2}={3} AND {4}>={5}",
                            ARecurringTransactionTable.GetBatchNumberDBName(),
                            ABatchNumber,
                            ARecurringTransactionTable.GetJournalNumberDBName(),
                            AJournalNumber,
                            ARecurringTransactionTable.GetTransactionNumberDBName(),
                            ATransactionToDelete);

                        foreach (DataRowView transDRV in transactionsDV)
                        {
                            ARecurringTransactionRow tranRow = (ARecurringTransactionRow)transDRV.Row;
                            tranRow.Delete();
                        }

                        //Need to save changes before deleting any transactions
                        GLBatchTDSAccess.SubmitChanges(MainDSCopy);

//.........这里部分代码省略.........
开发者ID:Davincier,项目名称:openpetra,代码行数:101,代码来源:GL.Transactions.cs


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