/// <summary> /// Stores the manual code. /// </summary> /// <param name="ASubmitDS">a submit ds.</param> /// <param name="AVerificationResult">a verification result.</param> /// <returns></returns> private TSubmitChangesResult StoreManualCode(ref GLSetupTDS ASubmitDS, out TVerificationResultCollection AVerificationResult) { // // I need to remove any AnalysisAttribute records that are still set to "Unassigned" // if ((ASubmitDS.AAnalysisAttribute != null) && (ASubmitDS.AAnalysisAttribute.Rows.Count > 0)) { for (int Idx = ASubmitDS.AAnalysisAttribute.Rows.Count - 1; Idx >= 0; Idx--) { AAnalysisAttributeRow Row = ASubmitDS.AAnalysisAttribute[Idx]; if ((Row.RowState != DataRowState.Deleted) && (Row.AnalysisTypeCode.IndexOf("Unassigned") == 0)) { Row.Delete(); } } } // // I'll take this opportunity to remove any similar records in my own TDS // for (int Idx = FMainDS.AAnalysisAttribute.Rows.Count - 1; Idx >= 0; Idx--) { AAnalysisAttributeRow Row = FMainDS.AAnalysisAttribute[Idx]; if ((Row.RowState != DataRowState.Deleted) && (Row.AnalysisTypeCode.IndexOf("Unassigned") == 0)) { Row.Delete(); } } ucoAccountsTree.MarkAllNodesCommitted(); TSubmitChangesResult ServerResult = TRemote.MFinance.Setup.WebConnectors.SaveGLSetupTDS(FLedgerNumber, ref ASubmitDS, out AVerificationResult); TDataCache.TMFinance.RefreshCacheableFinanceTable(Shared.TCacheableFinanceTablesEnum.AccountList, FLedgerNumber); if (ServerResult == TSubmitChangesResult.scrOK) { if ((FZeroForeignCurrencyBalances != null) && (FZeroForeignCurrencyBalances.Count > 0)) { Int32 Year = (Int32)TDataCache.TMFinance.GetCacheableFinanceTable( TCacheableFinanceTablesEnum.LedgerDetails, FLedgerNumber).Rows[0][ALedgerTable.GetCurrentFinancialYearDBName()]; // Makes all foreign currency balances zero for the given accounts in the current ledger year for all posting cost centres TRemote.MFinance.Setup.WebConnectors.ZeroForeignCurrencyBalances(FLedgerNumber, Year, FZeroForeignCurrencyBalances.ToArray()); FZeroForeignCurrencyBalances.Clear(); } // Broadcast message to update partner's Partner Edit screen if open TFormsMessage BroadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcAccountsChanged); BroadcastMessage.SetMessageDataAccounts(); TFormsList.GFormsList.BroadcastFormMessage(BroadcastMessage); } return ServerResult; }