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


C# GLBatchTDS类代码示例

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


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

示例1: TUC_GLBatches_Cancel

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

            FMyForm = (TFrmGLBatch)FPetraUtilsObject.GetForm();
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:11,代码来源:UC_GLBatches.Cancel.ManualCode.cs

示例2: TUC_GLBatches_Post

        /// <summary>
        /// Constructor
        /// </summary>
        public TUC_GLBatches_Post(TFrmPetraEditUtils APetraUtilsObject, Int32 ALedgerNumber, GLBatchTDS AMainDS, IUC_GLBatches AUserControl)
        {
            FPetraUtilsObject = APetraUtilsObject;
            FLedgerNumber = ALedgerNumber;
            FMainDS = AMainDS;
            FMyUserControl = AUserControl;

            FMyForm = (TFrmGLBatch)FPetraUtilsObject.GetForm();
        }
开发者ID:Kingefosa,项目名称:openpetra,代码行数:12,代码来源:UC_GLBatches.Post.ManualCode.cs

示例3: RefreshAnalysisAttributesGrid

        private void RefreshAnalysisAttributesGrid(object sender, GLBatchTDS ADS)
        {
            TSgrdDataGridPaged Grid = null;
            int TransactionNumber = 0;
            string AccountCode = "";

            if ((sender as SourceGrid.Selection.RowSelection) != null)
            {
                Grid = grdFromAnalAttributes;
                TransactionNumber = FJournal.LastTransactionNumber + 1;
                AccountCode = FPreviouslySelectedAccountsRow[AGeneralLedgerMasterTable.GetAccountCodeDBName()].ToString();
            }
            else
            {
                Grid = grdToAnalAttributes;
                TransactionNumber = FCurrentTransactionNumber;
                AccountCode = cmbDetailAccountCode.GetSelectedString();
            }

            //Empty the grid
            ADS.ATransAnalAttrib.DefaultView.RowFilter = "1=2";
            FPSAttributesRow = null;

            if (!TRemote.MFinance.Setup.WebConnectors.AccountHasAnalysisAttributes(FLedgerNumber, AccountCode,
                    true))
            {
                if (Grid.Enabled)
                {
                    Grid.Enabled = false;
                }

                return;
            }
            else
            {
                if (!Grid.Enabled)
                {
                    Grid.Enabled = true;
                }
            }

            FAnalysisAttributesLogic.SetTransAnalAttributeDefaultView(ADS, true, TransactionNumber);

            Grid.DataSource = new DevAge.ComponentModel.BoundDataView(ADS.ATransAnalAttrib.DefaultView);

            if (Grid.Rows.Count > 1)
            {
                Grid.SelectRowWithoutFocus(1);
                AnalysisAttributesGrid_RowSelected(Grid, null);
            }
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:51,代码来源:ReallocationJournalDialog.ManualCode.cs

示例4: SetupAnalysisAttributeGrid

        private void SetupAnalysisAttributeGrid(TSgrdDataGridPaged AGrid, ref SourceGrid.Cells.Editors.ComboBox AGridCombo)
        {
            AGrid.DataSource = null;
            GLBatchTDS DS = null;
            SourceGrid.Cells.Editors.ComboBox ATempCombo = null;

            if (AGrid.Name == grdFromAnalAttributes.Name)
            {
                FTempFromDS = (GLBatchTDS)FMainDS.Clone();
                DS = FTempFromDS;
            }
            else
            {
                DS = FMainDS;
            }

            if (AGrid.Columns.Count == 0)
            {
                ATempCombo = new SourceGrid.Cells.Editors.ComboBox(typeof(string));
                ATempCombo.EnableEdit = true;
                ATempCombo.EditableMode = EditableMode.Focus;
                AGrid.Columns.Clear();
                AGrid.AddTextColumn(Catalog.GetString("Type"), FMainDS.ATransAnalAttrib.ColumnAnalysisTypeCode, 99);
                AGrid.AddTextColumn(Catalog.GetString("Value"),
                    DS.ATransAnalAttrib.Columns[ATransAnalAttribTable.GetAnalysisAttributeValueDBName()], 150,
                    ATempCombo);
            }

            FAnalysisAttributesLogic.SetTransAnalAttributeDefaultView(DS, true);
            DS.ATransAnalAttrib.DefaultView.AllowNew = false;
            AGrid.DataSource = new DevAge.ComponentModel.BoundDataView(DS.ATransAnalAttrib.DefaultView);
            AGrid.SetHeaderTooltip(0, Catalog.GetString("Type"));
            AGrid.SetHeaderTooltip(1, Catalog.GetString("Value"));

            AGrid.Selection.SelectionChanged += AnalysisAttributesGrid_RowSelected;

            //Prepare Analysis attributes grid to highlight inactive analysis codes
            // Create a cell view for special conditions
            SourceGrid.Cells.Views.Cell strikeoutCell2 = new SourceGrid.Cells.Views.Cell();
            strikeoutCell2.Font = new System.Drawing.Font(AGrid.Font, FontStyle.Strikeout);

            // Create a condition, apply the view when true, and assign a delegate to handle it
            SourceGrid.Conditions.ConditionView conditionAnalysisCodeActive = new SourceGrid.Conditions.ConditionView(strikeoutCell2);
            conditionAnalysisCodeActive.EvaluateFunction = delegate(SourceGrid.DataGridColumn column2, int gridRow2, object itemRow2)
            {
                DataRowView row2 = (DataRowView)itemRow2;
                string analysisCode = row2[ATransAnalAttribTable.ColumnAnalysisTypeCodeId].ToString();

                if (AGrid.Name == grdFromAnalAttributes.Name)
                {
                    return !FAnalysisAttributesLogic.AnalysisCodeIsActive(
                        FPreviouslySelectedAccountsRow[AGeneralLedgerMasterTable.GetAccountCodeDBName()].ToString(), FCacheDS.AAnalysisAttribute,
                        analysisCode);
                }

                return !FAnalysisAttributesLogic.AnalysisCodeIsActive(
                    cmbDetailAccountCode.GetSelectedString(), FCacheDS.AAnalysisAttribute, analysisCode);
            };

            // Create a condition, apply the view when true, and assign a delegate to handle it
            SourceGrid.Conditions.ConditionView conditionAnalysisAttributeValueActive = new SourceGrid.Conditions.ConditionView(strikeoutCell2);
            conditionAnalysisAttributeValueActive.EvaluateFunction = delegate(SourceGrid.DataGridColumn column2, int gridRow2, object itemRow2)
            {
                if (itemRow2 != null)
                {
                    DataRowView row2 = (DataRowView)itemRow2;
                    string analysisCode = row2[ATransAnalAttribTable.ColumnAnalysisTypeCodeId].ToString();
                    string analysisAttributeValue = row2[ATransAnalAttribTable.ColumnAnalysisAttributeValueId].ToString();
                    return !TAnalysisAttributes.AnalysisAttributeValueIsActive(ref ATempCombo,
                        FCacheDS.AFreeformAnalysis,
                        analysisCode,
                        analysisAttributeValue);
                }
                else
                {
                    return false;
                }
            };

            //Add conditions to columns
            int indexOfAnalysisCodeColumn = 0;
            int indexOfAnalysisAttributeValueColumn = 1;

            AGrid.Columns[indexOfAnalysisCodeColumn].Conditions.Add(conditionAnalysisCodeActive);
            AGrid.Columns[indexOfAnalysisAttributeValueColumn].Conditions.Add(conditionAnalysisAttributeValueActive);

            AGridCombo = ATempCombo;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:88,代码来源:ReallocationJournalDialog.ManualCode.cs

示例5: SaveGLBatchTDS

        public static TSubmitChangesResult SaveGLBatchTDS(ref GLBatchTDS AInspectDS,
            out TVerificationResultCollection AVerificationResult)
        {
            AVerificationResult = new TVerificationResultCollection();
            TVerificationResultCollection VerificationResult = AVerificationResult;

            // make sure that empty tables are removed
            AInspectDS = AInspectDS.GetChangesTyped(true);

            bool batchTableInDataSet = (AInspectDS.ABatch != null);
            bool journalTableInDataSet = (AInspectDS.AJournal != null);
            bool transTableInDataSet = (AInspectDS.ATransaction != null);
            bool attrTableInDataSet = (AInspectDS.ATransAnalAttrib != null);
            bool recurrBatchTableInDataSet = (AInspectDS.ARecurringBatch != null);
            bool recurrJournalTableInDataSet = (AInspectDS.ARecurringJournal != null);
            bool recurrTransTableInDataSet = (AInspectDS.ARecurringTransaction != null);

            //bool newTransaction = false;
            TDBTransaction Transaction = null;

            GLBatchTDS InspectDS = AInspectDS;

            // calculate debit and credit sums for journal and batch? but careful: we only have the changed parts!
            // no, we calculate the debit and credit sums before the posting, with GLRoutines.UpdateTotalsOfBatch

            // check added and modified and deleted rows: are they related to a posted or cancelled batch? we must not save adjusted posted batches!
            List <Int32>BatchNumbersInvolved = new List <int>();
            Int32 LedgerNumber = -1;

            //Check if saving recurring tables
            if (recurrBatchTableInDataSet
                || recurrJournalTableInDataSet
                || recurrTransTableInDataSet)
            {
                if (batchTableInDataSet || journalTableInDataSet || transTableInDataSet || attrTableInDataSet)
                {
                    throw new Exception(
                        "SaveGLBatchTDS: need to call GetChangesTyped before saving, otherwise confusion about recurring or normal gl batch");
                }

                return SaveRecurringGLBatchTDS(ref AInspectDS);
            }

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.Serializable,
                ref Transaction,
                delegate
                {
                    if (batchTableInDataSet)
                    {
                        LedgerNumber = ((ABatchRow)InspectDS.ABatch.Rows[0]).LedgerNumber;

                        foreach (ABatchRow batch in InspectDS.ABatch.Rows)
                        {
                            if (batch.RowState != DataRowState.Added)
                            {
                                Int32 BatchNumber;

                                try
                                {
                                    BatchNumber = batch.BatchNumber;
                                }
                                catch (Exception)
                                {
                                    // for deleted batches
                                    BatchNumber = (Int32)batch[ABatchTable.ColumnBatchNumberId, DataRowVersion.Original];
                                }

                                if (!BatchNumbersInvolved.Contains(BatchNumber))
                                {
                                    BatchNumbersInvolved.Add(BatchNumber);
                                }
                            }

                            int PeriodNumber, YearNr;

                            if (TFinancialYear.IsValidPostingPeriod(LedgerNumber,
                                    batch.DateEffective,
                                    out PeriodNumber,
                                    out YearNr,
                                    Transaction))
                            {
                                batch.BatchYear = YearNr;
                                batch.BatchPeriod = PeriodNumber;
                            }
                        }
                    }

                    if (journalTableInDataSet)
                    {
                        if (LedgerNumber == -1)
                        {
                            LedgerNumber = ((AJournalRow)InspectDS.AJournal.Rows[0]).LedgerNumber;
                        }

                        foreach (GLBatchTDSAJournalRow journal in InspectDS.AJournal.Rows)
                        {
                            Int32 BatchNumber;

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

示例6: LoadARecurringTransAnalAttrib

        public static GLBatchTDS LoadARecurringTransAnalAttrib(Int32 ALedgerNumber,
            Int32 ABatchNumber,
            Int32 AJournalNumber,
            Int32 ATransactionNumber)
        {
            Boolean NewTransaction = false;

            TDBTransaction Transaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.ReadCommitted,
                TEnforceIsolationLevel.eilMinimum,
                out NewTransaction);

            GLBatchTDS MainDS = new GLBatchTDS();

            ARecurringTransAnalAttribAccess.LoadViaARecurringTransaction(MainDS,
                ALedgerNumber,
                ABatchNumber,
                AJournalNumber,
                ATransactionNumber,
                Transaction);

            if (NewTransaction)
            {
                DBAccess.GDBAccessObj.RollbackTransaction();
            }

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

示例7: LoadARecurringBatchAndContent

        public static GLBatchTDS LoadARecurringBatchAndContent(Int32 ALedgerNumber, Int32 ABatchNumber)
        {
            Boolean NewTransaction = false;

            TDBTransaction Transaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.ReadCommitted,
                TEnforceIsolationLevel.eilMinimum,
                out NewTransaction);


            GLBatchTDS MainDS = new GLBatchTDS();

            ARecurringBatchAccess.LoadByPrimaryKey(MainDS, ALedgerNumber, ABatchNumber, Transaction);
            ARecurringJournalAccess.LoadViaARecurringBatch(MainDS, ALedgerNumber, ABatchNumber, Transaction);

            ARecurringTransactionTable TransactionTable = new ARecurringTransactionTable();
            ARecurringTransactionRow TemplateTransactionRow = TransactionTable.NewRowTyped(false);
            TemplateTransactionRow.LedgerNumber = ALedgerNumber;
            TemplateTransactionRow.BatchNumber = ABatchNumber;
            ARecurringTransactionAccess.LoadUsingTemplate(MainDS, TemplateTransactionRow, Transaction);

            ARecurringTransAnalAttribTable TransAnalAttribTable = new ARecurringTransAnalAttribTable();
            ARecurringTransAnalAttribRow TemplateTransAnalAttribRow = TransAnalAttribTable.NewRowTyped(false);
            TemplateTransAnalAttribRow.LedgerNumber = ALedgerNumber;
            TemplateTransAnalAttribRow.BatchNumber = ABatchNumber;
            ARecurringTransAnalAttribAccess.LoadUsingTemplate(MainDS, TemplateTransAnalAttribRow, Transaction);

            if (NewTransaction)
            {
                DBAccess.GDBAccessObj.RollbackTransaction();
            }

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

示例8: LoadALedgerTable

        public static GLBatchTDS LoadALedgerTable(Int32 ALedgerNumber)
        {
            GLBatchTDS MainDS = new GLBatchTDS();

            TDBTransaction Transaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.ReadCommitted);

            ALedgerAccess.LoadByPrimaryKey(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();

            DBAccess.GDBAccessObj.RollbackTransaction();

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

示例9: SaveRecurringGLBatchTDS

        private static TSubmitChangesResult SaveRecurringGLBatchTDS(ref GLBatchTDS AInspectDS)
        {
            Int32 LedgerNumber;
            Int32 BatchNumber;
            Int32 JournalNumber;
            Int32 TransactionNumber;
            Int32 Counter;

            bool recurrBatchTableInDataSet = (AInspectDS.ARecurringBatch != null);
            bool recurrJournalTableInDataSet = (AInspectDS.ARecurringJournal != null);
            bool recurrTransactionTableInDataSet = (AInspectDS.ARecurringTransaction != null);
            bool recurrTransAnalTableInDataSet = (AInspectDS.ARecurringTransAnalAttrib != null);

            TSubmitChangesResult SubmissionResult = new TSubmitChangesResult();

            ARecurringJournalTable JournalTable = new ARecurringJournalTable();
            ARecurringJournalRow TemplateJournalRow = JournalTable.NewRowTyped(false);

            ARecurringTransactionTable TransactionTable = new ARecurringTransactionTable();
            ARecurringTransactionRow TemplateTransactionRow = TransactionTable.NewRowTyped(false);

            ARecurringTransAnalAttribTable TransAnalAttribTable = new ARecurringTransAnalAttribTable();
            ARecurringTransAnalAttribRow TemplateTransAnalAttribRow = TransAnalAttribTable.NewRowTyped(false);

            GLBatchTDS DeletedDS = new GLBatchTDS();
            ARecurringTransAnalAttribTable DeletedTransAnalAttribTable;

            // in this method we also think about deleted batches, journals, transactions where subsequent information
            // had not been loaded yet: a type of cascading delete is being used (real cascading delete currently does
            // not go down the number of levels needed).

            TDBTransaction Transaction = null;
            GLBatchTDS InspectDS = AInspectDS;

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.Serializable,
                ref Transaction,
                delegate
                {
                    if (recurrBatchTableInDataSet)
                    {
                        foreach (ARecurringBatchRow batch in InspectDS.ARecurringBatch.Rows)
                        {
                            if (batch.RowState == DataRowState.Deleted)
                            {
                                // need to use this way of retrieving data from deleted rows
                                LedgerNumber = (Int32)batch[ARecurringBatchTable.ColumnLedgerNumberId, DataRowVersion.Original];
                                BatchNumber = (Int32)batch[ARecurringBatchTable.ColumnBatchNumberId, DataRowVersion.Original];

                                // load all depending journals, transactions and attributes and make sure they are also deleted via the dataset
                                TemplateTransAnalAttribRow.LedgerNumber = LedgerNumber;
                                TemplateTransAnalAttribRow.BatchNumber = BatchNumber;
                                DeletedTransAnalAttribTable =
                                    ARecurringTransAnalAttribAccess.LoadUsingTemplate(TemplateTransAnalAttribRow, Transaction);

                                for (Counter = DeletedTransAnalAttribTable.Count - 1; Counter >= 0; Counter--)
                                {
                                    DeletedTransAnalAttribTable.Rows[Counter].Delete();
                                }

                                InspectDS.Merge(DeletedTransAnalAttribTable);

                                TemplateTransactionRow.LedgerNumber = LedgerNumber;
                                TemplateTransactionRow.BatchNumber = BatchNumber;
                                ARecurringTransactionAccess.LoadUsingTemplate(DeletedDS, TemplateTransactionRow, Transaction);

                                for (Counter = DeletedDS.ARecurringTransaction.Count - 1; Counter >= 0; Counter--)
                                {
                                    DeletedDS.ARecurringTransaction.Rows[Counter].Delete();
                                }

                                InspectDS.Merge(DeletedDS.ARecurringTransaction);

                                TemplateJournalRow.LedgerNumber = LedgerNumber;
                                TemplateJournalRow.BatchNumber = BatchNumber;
                                ARecurringJournalAccess.LoadUsingTemplate(DeletedDS, TemplateJournalRow, Transaction);

                                for (Counter = DeletedDS.ARecurringJournal.Count - 1; Counter >= 0; Counter--)
                                {
                                    DeletedDS.ARecurringJournal.Rows[Counter].Delete();
                                }

                                InspectDS.Merge(DeletedDS.ARecurringJournal);
                            }
                        }
                    }

                    if (recurrJournalTableInDataSet)
                    {
                        foreach (ARecurringJournalRow journal in InspectDS.ARecurringJournal.Rows)
                        {
                            if (journal.RowState == DataRowState.Deleted)
                            {
                                // need to use this way of retrieving data from deleted rows
                                LedgerNumber = (Int32)journal[ARecurringJournalTable.ColumnLedgerNumberId, DataRowVersion.Original];
                                BatchNumber = (Int32)journal[ARecurringJournalTable.ColumnBatchNumberId, DataRowVersion.Original];
                                JournalNumber = (Int32)journal[ARecurringJournalTable.ColumnJournalNumberId, DataRowVersion.Original];

                                // load all depending transactions and attributes and make sure they are also deleted via the dataset
                                TemplateTransAnalAttribRow.LedgerNumber = LedgerNumber;
                                TemplateTransAnalAttribRow.BatchNumber = BatchNumber;
//.........这里部分代码省略.........
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:GL.Transactions.cs

示例10: CheckRecurringTransAnalysisAttributes

        private static void CheckRecurringTransAnalysisAttributes(ref GLBatchTDS AInspectDS,
            int ALedgerNumber,
            int ABatchNumber,
            int AJournalNumber,
            ref TSubmitChangesResult ASubmissionResult)
        {
            //check if the necessary rows for the given account are there, automatically add/update account
            GLSetupTDS glSetupCacheDS = LoadAAnalysisAttributes(ALedgerNumber);

            //Account Number for AnalysisTable lookup
            int currentTransactionNumber = 0;
            string currentTransAccountCode = String.Empty;

            if (glSetupCacheDS == null)
            {
                return;
            }

            //Reference all transactions in dataset
            DataView allTransView = AInspectDS.ARecurringTransaction.DefaultView;
            DataView transAnalAttrView = AInspectDS.ARecurringTransAnalAttrib.DefaultView;

            transAnalAttrView.RowFilter = string.Empty;

            allTransView.RowFilter = String.Format("{0}={1} and {2}={3}",
                ARecurringTransactionTable.GetBatchNumberDBName(),
                ABatchNumber,
                ARecurringTransactionTable.GetJournalNumberDBName(),
                AJournalNumber);

            foreach (DataRowView transRowView in allTransView)
            {
                ARecurringTransactionRow currentTransactionRow = (ARecurringTransactionRow)transRowView.Row;

                currentTransactionNumber = currentTransactionRow.TransactionNumber;
                currentTransAccountCode = currentTransactionRow.AccountCode;

                //If this account code is used need to delete it from TransAnal table.
                //Delete any existing rows with old code
                transAnalAttrView.RowFilter = String.Format("{0} = {1} AND {2} = {3} AND {4} = {5} AND {6} <> '{7}'",
                    ARecurringTransAnalAttribTable.GetBatchNumberDBName(),
                    ABatchNumber,
                    ARecurringTransAnalAttribTable.GetJournalNumberDBName(),
                    AJournalNumber,
                    ARecurringTransAnalAttribTable.GetTransactionNumberDBName(),
                    currentTransactionNumber,
                    ARecurringTransAnalAttribTable.GetAccountCodeDBName(),
                    currentTransAccountCode);

                foreach (DataRowView dv in transAnalAttrView)
                {
                    ARecurringTransAnalAttribRow tr = (ARecurringTransAnalAttribRow)dv.Row;

                    tr.Delete();
                }

                transAnalAttrView.RowFilter = String.Format("{0}={1} AND {2}={3} AND {4}={5}",
                    ARecurringTransAnalAttribTable.GetBatchNumberDBName(),
                    ABatchNumber,
                    ARecurringTransAnalAttribTable.GetJournalNumberDBName(),
                    AJournalNumber,
                    ARecurringTransAnalAttribTable.GetTransactionNumberDBName(),
                    currentTransactionNumber);

                //Retrieve the analysis attributes for the supplied account
                DataView analAttrView = glSetupCacheDS.AAnalysisAttribute.DefaultView;
                analAttrView.RowFilter = String.Format("{0} = '{1}'",
                    AAnalysisAttributeTable.GetAccountCodeDBName(),
                    currentTransAccountCode);

                if (analAttrView.Count > 0)
                {
                    for (int i = 0; i < analAttrView.Count; i++)
                    {
                        //Read the Type Code for each attribute row
                        AAnalysisAttributeRow analAttrRow = (AAnalysisAttributeRow)analAttrView[i].Row;
                        string analysisTypeCode = analAttrRow.AnalysisTypeCode;

                        //Check if the attribute type code exists in the Transaction Analysis Attributes table
                        ARecurringTransAnalAttribRow transAnalAttrRow =
                            (ARecurringTransAnalAttribRow)AInspectDS.ARecurringTransAnalAttrib.Rows.Find(new object[] { ALedgerNumber, ABatchNumber,
                                                                                                                        AJournalNumber,
                                                                                                                        currentTransactionNumber,
                                                                                                                        analysisTypeCode });

                        if (transAnalAttrRow == null)
                        {
                            //Create a new TypeCode for this account
                            ARecurringTransAnalAttribRow newRow = AInspectDS.ARecurringTransAnalAttrib.NewRowTyped(true);
                            newRow.LedgerNumber = ALedgerNumber;
                            newRow.BatchNumber = ABatchNumber;
                            newRow.JournalNumber = AJournalNumber;
                            newRow.TransactionNumber = currentTransactionNumber;
                            newRow.AnalysisTypeCode = analysisTypeCode;
                            newRow.AccountCode = currentTransAccountCode;

                            AInspectDS.ARecurringTransAnalAttrib.Rows.Add(newRow);
                        }
                        else if (transAnalAttrRow.AccountCode != currentTransAccountCode)
                        {
//.........这里部分代码省略.........
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:GL.Transactions.cs

示例11: UpdateTotalsOfBatchesAndJournals

        private static void UpdateTotalsOfBatchesAndJournals(ref GLBatchTDS AInspectDS,
            Int32 ALedgerNumber,
            int[] ABatchNumbers,
            bool ABatchTableInDataSet,
            bool AJournalTableInDataSet)
        {
            Int32 currJournalNumber = -1;

            ABatchRow currentBatchRow = null;

            foreach (int currBatchNumber in ABatchNumbers)
            {
                if (!ABatchTableInDataSet && !AJournalTableInDataSet)
                {
                    if (AInspectDS.ATransaction.Count > 0)
                    {
                        AInspectDS.ATransaction.DefaultView.RowFilter = String.Format("{0} = {1}",
                            ATransactionTable.GetBatchNumberDBName(),
                            currBatchNumber);

                        List <int>journalNums = new List <int>();

                        foreach (DataRowView dr in AInspectDS.ATransaction.DefaultView)
                        {
                            ATransactionRow tr = (ATransactionRow)dr.Row;

                            currJournalNumber = tr.JournalNumber;

                            if (!journalNums.Contains(currJournalNumber))
                            {
                                journalNums.Add(currJournalNumber);
                            }
                        }

                        if (journalNums.Count == 1)
                        {
                            AInspectDS.Merge(LoadABatch(ALedgerNumber, currBatchNumber), true);
                            AInspectDS.Merge(LoadAJournalATransaction(ALedgerNumber, currBatchNumber, currJournalNumber), true);
                        }
                        else
                        {
                            //Multiple journals
                            AInspectDS.Merge(LoadABatchAJournalATransaction(ALedgerNumber, currBatchNumber), true);
                        }
                    }
                    else
                    {
                        AInspectDS.Merge(LoadABatchAJournalATransaction(ALedgerNumber, currBatchNumber), true);
                    }
                }
                else if (!ABatchTableInDataSet)
                {
                    AInspectDS.AJournal.DefaultView.RowFilter = String.Format("{0} = {1}",
                        AJournalTable.GetBatchNumberDBName(),
                        currBatchNumber);

                    if (AInspectDS.AJournal.DefaultView.Count == 1)
                    {
                        currJournalNumber = ((AJournalRow)AInspectDS.AJournal.DefaultView[0].Row).JournalNumber;
                        AInspectDS.Merge(LoadABatch(ALedgerNumber, currBatchNumber), true);
                        AInspectDS.Merge(LoadAJournalATransaction(ALedgerNumber, currBatchNumber, currJournalNumber), true);
                    }
                    else
                    {
                        AInspectDS.Merge(LoadABatchAJournalATransaction(ALedgerNumber, currBatchNumber), true);
                    }
                }
                else if (!AJournalTableInDataSet)
                {
                    if (AInspectDS.ATransaction.Count > 0)
                    {
                        AInspectDS.ATransaction.DefaultView.RowFilter = String.Format("{0} = {1}",
                            ATransactionTable.GetBatchNumberDBName(),
                            currBatchNumber);

                        List <int>journalNums = new List <int>();

                        foreach (DataRowView dr in AInspectDS.ATransaction.DefaultView)
                        {
                            ATransactionRow tr = (ATransactionRow)dr.Row;

                            currJournalNumber = tr.JournalNumber;

                            if (!journalNums.Contains(currJournalNumber))
                            {
                                journalNums.Add(currJournalNumber);
                            }
                        }

                        if (journalNums.Count == 1)
                        {
                            AInspectDS.Merge(LoadAJournalATransaction(ALedgerNumber, currBatchNumber, currJournalNumber), true);
                        }
                        else
                        {
                            //Multiple journals
                            AInspectDS.Merge(LoadAJournalATransaction(ALedgerNumber, currBatchNumber), true);
                        }
                    }
                    else
//.........这里部分代码省略.........
开发者ID:js1987,项目名称:openpetragit,代码行数:101,代码来源:GL.Transactions.cs

示例12: LoadABatch

        public static GLBatchTDS LoadABatch(Int32 ALedgerNumber, int AYear, int APeriod)
        {
            GLBatchTDS MainDS = new GLBatchTDS();
            TDBTransaction Transaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.ReadCommitted);

            ALedgerAccess.LoadByPrimaryKey(MainDS, ALedgerNumber, Transaction);

            string FilterByPeriod = string.Empty;

            if (AYear > -1)
            {
                FilterByPeriod = String.Format(" AND PUB_{0}.{1} = {2}",
                    ABatchTable.GetTableDBName(),
                    ABatchTable.GetBatchYearDBName(),
                    AYear);

                if ((APeriod == 0) && (AYear == MainDS.ALedger[0].CurrentFinancialYear))
                {
                    //Return current and forwarding periods
                    FilterByPeriod += String.Format(" AND PUB_{0}.{1} >= {2}",
                        ABatchTable.GetTableDBName(),
                        ABatchTable.GetBatchPeriodDBName(),
                        MainDS.ALedger[0].CurrentPeriod);
                }
                else if (APeriod > 0)
                {
                    //Return only specified period
                    FilterByPeriod += String.Format(" AND PUB_{0}.{1} = {2}",
                        ABatchTable.GetTableDBName(),
                        ABatchTable.GetBatchPeriodDBName(),
                        APeriod);
                }
                else
                {
                    //Nothing to add, returns all periods
                }
            }

            string SelectClause =
                String.Format("SELECT * FROM PUB_{0} WHERE {1} = {2}",
                    ABatchTable.GetTableDBName(),
                    ABatchTable.GetLedgerNumberDBName(),
                    ALedgerNumber);

            DBAccess.GDBAccessObj.Select(MainDS, SelectClause + FilterByPeriod,
                MainDS.ABatch.TableName, Transaction);

            DBAccess.GDBAccessObj.RollbackTransaction();
            return MainDS;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:50,代码来源:GL.Transactions.cs

示例13: TUC_GLBatches_LoadAndFilter

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="APetraUtilsObject">Reference to the PetraUtilsObject for the form</param>
        /// <param name="ALedgerNumber">Ledger number</param>
        /// <param name="AMainDS">The main data set</param>
        /// <param name="AFilterFindPanelObject">The filter panel control object</param>
        public TUC_GLBatches_LoadAndFilter(TFrmPetraEditUtils APetraUtilsObject,
            int ALedgerNumber,
            GLBatchTDS AMainDS,
            TFilterAndFindPanel AFilterFindPanelObject)
        {
            FPetraUtilsObject = APetraUtilsObject;
            FFilterFindPanelObject = AFilterFindPanelObject;
            FMainDS = AMainDS;
            FLedgerNumber = ALedgerNumber;

            FcmbYearEnding = (TCmbAutoComplete)AFilterFindPanelObject.FilterPanelControls.FindControlByName("cmbYearEnding");
            FcmbPeriod = (TCmbAutoComplete)AFilterFindPanelObject.FilterPanelControls.FindControlByName("cmbPeriod");
            FrbtEditing = (RadioButton)AFilterFindPanelObject.FilterPanelControls.FindControlByName("rbtEditing");
            FrbtPosting = (RadioButton)AFilterFindPanelObject.FilterPanelControls.FindControlByName("rbtPosting");
            FrbtAll = (RadioButton)AFilterFindPanelObject.FilterPanelControls.FindControlByName("rbtAll");

            TFinanceControls.InitialiseAvailableFinancialYearsList(ref FcmbYearEnding, FLedgerNumber, false, true);
            //TLogging.Log("GL Financial Years completed");
            FrbtEditing.Checked = true;
            //TLogging.Log("Editing checkbox selected");
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:28,代码来源:UC_GLBatches.LoadAndFilter.ManualCode.cs

示例14: AccountRecurringAnalysisAttributesValuesExist

        /// <summary>
        /// Used for the validation of Analysis Attributes
        /// </summary>
        /// <param name="ATransactionNumber"></param>
        /// <param name="AAccountCode"></param>
        /// <param name="AGLBatchDS"></param>
        /// <param name="AValueRequiredForType"></param>
        /// <returns></returns>
        public bool AccountRecurringAnalysisAttributesValuesExist(int ATransactionNumber,
            string AAccountCode,
            GLBatchTDS AGLBatchDS,
            out String AValueRequiredForType)
        {
            AValueRequiredForType = string.Empty;

            if (string.IsNullOrEmpty(AAccountCode) || (AGLBatchDS.ATransAnalAttrib.DefaultView.Count == 0))
            {
                return true;
            }

            StringCollection RequiredAnalAttrCodes = TRemote.MFinance.Setup.WebConnectors.RequiredAnalysisAttributesForAccount(FLedgerNumber,
                AAccountCode, false);

            string AnalysisCodeFilterValues = TAnalysisAttributes.ConvertStringCollectionToCSV(RequiredAnalAttrCodes, "'");

            DataView analAttrib = new DataView(AGLBatchDS.ARecurringTransAnalAttrib);

            analAttrib.RowFilter = String.Format("{0}={1} AND {2}={3} AND {4}={5} AND {6} IN ({7})",
                ARecurringTransAnalAttribTable.GetBatchNumberDBName(),
                FBatchNumber,
                ARecurringTransAnalAttribTable.GetJournalNumberDBName(),
                FJournalNumber,
                ARecurringTransAnalAttribTable.GetTransactionNumberDBName(),
                ATransactionNumber,
                ARecurringTransAnalAttribTable.GetAnalysisTypeCodeDBName(),
                AnalysisCodeFilterValues);

            foreach (DataRowView drv in analAttrib)
            {
                ARecurringTransAnalAttribRow rw = (ARecurringTransAnalAttribRow)drv.Row;

                string analysisCode = rw.AnalysisTypeCode;

                if (TRemote.MFinance.Setup.WebConnectors.AccountAnalysisAttributeRequiresValues(FLedgerNumber, analysisCode, false))
                {
                    if (rw.IsAnalysisAttributeValueNull() || (rw.AnalysisAttributeValue == string.Empty))
                    {
                        AValueRequiredForType = rw.AnalysisTypeCode;
                        return false;
                    }
                }
            }

            return true;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:55,代码来源:AnalysisAttributes.cs

示例15: LoadATransactionForBatch

        public static GLBatchTDS LoadATransactionForBatch(Int32 ALedgerNumber, Int32 ABatchNumber)
        {
            GLBatchTDS MainDS = new GLBatchTDS();
            TDBTransaction Transaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.ReadCommitted);

            ATransactionAccess.LoadViaABatch(MainDS, ALedgerNumber, ABatchNumber, Transaction);

            DBAccess.GDBAccessObj.RollbackTransaction();
            return MainDS;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:10,代码来源:GL.Transactions.cs


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