private DataTable GetAccountListTable(TDBTransaction AReadTransaction, System.Int32 ALedgerNumber, string ATableName) { StringCollection FieldList = new StringCollection(); FieldList.Add(AAccountTable.GetLedgerNumberDBName()); FieldList.Add(AAccountTable.GetAccountCodeDBName()); FieldList.Add(AAccountTable.GetAccountTypeDBName()); FieldList.Add(AAccountTable.GetAccountCodeShortDescDBName()); FieldList.Add(AAccountTable.GetAccountActiveFlagDBName()); FieldList.Add(AAccountTable.GetPostingStatusDBName()); FieldList.Add(AAccountTable.GetForeignCurrencyFlagDBName()); FieldList.Add(AAccountTable.GetForeignCurrencyCodeDBName()); GLSetupTDS TempDS = new GLSetupTDS(); AAccountAccess.LoadViaALedger(TempDS, ALedgerNumber, FieldList, AReadTransaction); // load AAccountProperty and set the BankAccountFlag AAccountPropertyAccess.LoadViaALedger(TempDS, ALedgerNumber, AReadTransaction); foreach (AAccountPropertyRow accProp in TempDS.AAccountProperty.Rows) { if ((accProp.PropertyCode == MFinanceConstants.ACCOUNT_PROPERTY_BANK_ACCOUNT) && (accProp.PropertyValue == "true")) { TempDS.AAccount.DefaultView.RowFilter = String.Format("{0}='{1}'", AAccountTable.GetAccountCodeDBName(), accProp.AccountCode); GLSetupTDSAAccountRow acc = (GLSetupTDSAAccountRow)TempDS.AAccount.DefaultView[0].Row; acc.BankAccountFlag = true; TempDS.AAccount.DefaultView.RowFilter = ""; } } // not currently needed as an Account is only a Bank Account if it has a 'Bank Account' Account Property // load AAccountHierarchyDetails and check if this account reports to the CASH account /*AAccountHierarchyDetailAccess.LoadViaAAccountHierarchy(TempDS, * ALedgerNumber, * MFinanceConstants.ACCOUNT_HIERARCHY_STANDARD, * AReadTransaction); * * TLedgerInfo ledgerInfo = new TLedgerInfo(ALedgerNumber); * TGetAccountHierarchyDetailInfo accountHierarchyTools = new TGetAccountHierarchyDetailInfo(ledgerInfo); * List <string>children = accountHierarchyTools.GetChildren(MFinanceConstants.CASH_ACCT); * * foreach (GLSetupTDSAAccountRow account in TempDS.AAccount.Rows) * { * if (children.Contains(account.AccountCode)) * { * account.CashAccountFlag = true; * } * }*/ return(TempDS.AAccount); }
private void GetData() { FMainDS.AAccount.DefaultView.RowFilter = "a_foreign_currency_flag_l = 'true'"; FForeignCurrencyAccountsDT.Clear(); FForeignCurrencyAccountsDT = FMainDS.AAccount.Clone(); FForeignCurrencyAccountsDT.Merge(FMainDS.AAccount.DefaultView.ToTable()); Int32 Year = (Int32)TDataCache.TMFinance.GetCacheableFinanceTable( TCacheableFinanceTablesEnum.LedgerDetails, FLedgerNumber).Rows[0][ALedgerTable.GetCurrentFinancialYearDBName()]; // get additional columns from database TRemote.MFinance.Common.ServerLookups.WebConnectors.GetForeignCurrencyAccountActuals(ref FForeignCurrencyAccountsDT, FLedgerNumber, Year); DataView myDataView = FForeignCurrencyAccountsDT.DefaultView; myDataView.AllowNew = false; myDataView.RowFilter = "a_foreign_currency_flag_l = 'true'"; myDataView.Sort = AAccountTable.GetForeignCurrencyCodeDBName() + " ASC, " + AAccountTable.GetAccountCodeDBName() + " ASC"; grdDetails.DataSource = new DevAge.ComponentModel.BoundDataView(myDataView); }