/// <summary> /// retrieve cacheable Finance table /// </summary> /// <param name="ACacheableTable">enum that defines Finance table to be returned</param> /// <returns></returns> public static DataTable GetCacheableFinanceTable(TCacheableFinanceTablesEnum ACacheableTable) { if (FDelegateGetCacheableFinanceTable != null) { return(FDelegateGetCacheableFinanceTable(ACacheableTable)); } else { throw new InvalidOperationException("Delegate 'TGetCacheableFinanceTable' must be initialised before calling this Method"); } }
/// <summary> /// Helper method that we can call to initialise each of the filter/find comboBoxes /// </summary> private void InitFilterFindComboBox(TCmbAutoComplete AFFInstance, TCacheableFinanceTablesEnum AListTable) { AFFInstance.DataSource = TDataCache.TMFinance.GetCacheableFinanceTable(AListTable, FLedgerNumber).DefaultView; AFFInstance.DrawMode = DrawMode.OwnerDrawFixed; AFFInstance.DrawItem += new DrawItemEventHandler(DrawComboBoxItem); }
/// <summary> /// retrieve cacheable Finance table /// </summary> /// <param name="ACacheableTable">enum that defines Finance table to be returned</param> /// <returns></returns> public static DataTable GetCacheableFinanceTable(TCacheableFinanceTablesEnum ACacheableTable) { if (FDelegateGetCacheableFinanceTable != null) { return FDelegateGetCacheableFinanceTable(ACacheableTable); } else { throw new InvalidOperationException("Delegate 'TGetCacheableFinanceTable' must be initialised before calling this Method"); } }
/// <summary> /// Returns a certain cachable DataTable that contains all columns and all /// rows of a specified table. /// /// @comment Wrapper for other GetCacheableTable method /// </summary> /// /// <param name="ACacheableTable">Tells what cacheable DataTable should be returned.</param> /// <returns>DataTable</returns> public DataTable GetCacheableTable(TCacheableFinanceTablesEnum ACacheableTable) { System.Type TmpType; return(GetCacheableTable(ACacheableTable, "", false, out TmpType)); }
/** * Get rows from a table that are based on a ledger; (e.g. Costcentres, Accounts) * The cache will only retrieve data for the one ledger, and check the next time * if the data is already there for another ledger * * @param ACacheableTable The cached DataTable that should be returned in the * DataSet * @param ALedgerColumnDBName The name of the column in this table that has the * ledger number * @param ALedgerNumber The number of the current ledger that the data should be * from * @return The table in the cache with data from all ledgers requested till now * */ public static DataTable GetBasedOnLedger2(TCacheableFinanceTablesEnum ACacheableTable, String ALedgerColumnDBName, System.Int32 ALedgerNumber, out Type ADataTableType, string ACustomTableName) { try { String CacheableTableName = Enum.GetName(typeof(TCacheableFinanceTablesEnum), ACacheableTable); String FilterCriteria = ALedgerColumnDBName + " = " + ALedgerNumber.ToString(); return TDataCache.GetCacheableDataTableFromCache2(CacheableTableName, FilterCriteria, (object)ALedgerNumber, out ADataTableType, ACustomTableName); } catch (System.Runtime.Remoting.RemotingException Exc) { // most probably a permission problem: System.Runtime.Remoting.RemotingException: Requested Service not found throw new Exception(Catalog.GetString("You do not have enough permissions to access the Finance module:") + "\n" + Exc.ToString()); } catch (Exception) { throw; } }
/// <summary> /// Returns a certain cachable DataTable that contains all columns and all /// rows of a specified table. /// /// @comment Wrapper for other GetCacheableTable method /// </summary> /// /// <param name="ACacheableTable">Tells what cacheable DataTable should be returned.</param> /// <returns>DataTable</returns> public DataTable GetCacheableTable(TCacheableFinanceTablesEnum ACacheableTable) { System.Type TmpType; return GetCacheableTable(ACacheableTable, "", false, out TmpType); }
/** * Tells the PetraServer to reload the cacheable DataTable from the DB, * refreshes the DataTable in the client-side Cache and persists it to a file. * * @param ACacheableTable The cached DataTable that should be reloaded from DB. * @param ALedgerNumber The number of the current ledger that the data should be * from * */ public static void RefreshCacheableFinanceTable(TCacheableFinanceTablesEnum ACacheableTable, System.Int32 ALedgerNumber) { DataTable TmpDT; // Refresh the Cacheble DataTable on the Serverside and return it TRemote.MFinance.Cacheable.WebConnectors.RefreshCacheableTable(ACacheableTable, ALedgerNumber, out TmpDT); UCacheableTablesManager.AddOrRefreshCachedTable(TmpDT, -1); // Update the cached DataTable file TDataCache.SaveCacheableDataTableToFile(TmpDT); }
/** * Get rows from a table that are based on a ledger; (e.g. Costcentres, Accounts) * The cache will only retrieve data for the one ledger, and check the next time * if the data is already there for another ledger * * @param ACacheableTable The cached DataTable that should be returned in the * DataSet * @param ALedgerColumnDBName The name of the column in this table that has the * ledger number * @param ALedgerNumber The number of the current ledger that the data should be * from * @return The table in the cache with data from all ledgers requested till now * */ public static DataTable GetBasedOnLedger(TCacheableFinanceTablesEnum ACacheableTable, String ALedgerColumnDBName, System.Int32 ALedgerNumber, out Type ADataTableType) { return GetBasedOnLedger2(ACacheableTable, ALedgerColumnDBName, ALedgerNumber, out ADataTableType, String.Empty); }
/** * Tells the PetraServer to reload the cacheable DataTable from the DB, * refreshes the DataTable in the client-side Cache and persists it to a file. * * @param ACacheableTable The cached DataTable that should be reloaded from DB. * */ public static void RefreshCacheableFinanceTable(TCacheableFinanceTablesEnum ACacheableTable) { DataTable TmpDT; // Refresh the Cacheble DataTable on the Serverside and return it TmpDT = TRemote.MFinance.Cacheable.WebConnectors.RefreshCacheableTableAndGet(ACacheableTable); UCacheableTablesManager.AddOrRefreshCachedTable(TmpDT, -1); // Update the cached DataTable file TDataCache.SaveCacheableDataTableToFile(TmpDT); }
/** * Returns the chosen DataTable for the Petra Finance Module from the * * If the DataTable is not available on the Client side, it is automatically * retrieved from the Petra Server. * * This overload of GetCacheableFinanceTable also considers the Ledger Number, * and only retrieves the rows based on the given Ledger Number. * * @param ACacheableTable The cached DataTable that should be returned in the * DataSet * @param ALedgerNumber The number of the current ledger that the data should be * from * @return Chosen DataTable * */ public static DataTable GetCacheableFinanceTable2(TCacheableFinanceTablesEnum ACacheableTable, System.Int32 ALedgerNumber, string ACustomTableName) { DataTable ReturnValue; Type DataTableType; ReturnValue = null; switch (ACacheableTable) { case TCacheableFinanceTablesEnum.AccountHierarchyList: ReturnValue = GetBasedOnLedger2(TCacheableFinanceTablesEnum.AccountHierarchyList, AAccountHierarchyTable.GetLedgerNumberDBName( ), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.CostCentreList: ReturnValue = GetBasedOnLedger2(TCacheableFinanceTablesEnum.CostCentreList, ACostCentreTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.AccountList: ReturnValue = GetBasedOnLedger2(TCacheableFinanceTablesEnum.AccountList, AAccountTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.AccountingPeriodList: ReturnValue = GetBasedOnLedger2(TCacheableFinanceTablesEnum.AccountingPeriodList, AAccountingPeriodTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.LedgerDetails: ReturnValue = GetBasedOnLedger2(TCacheableFinanceTablesEnum.LedgerDetails, ALedgerTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.MotivationGroupList: ReturnValue = GetBasedOnLedger2(ACacheableTable, AMotivationGroupTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.MotivationList: ReturnValue = GetBasedOnLedger2(ACacheableTable, AMotivationDetailTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.FeesPayableList: ReturnValue = GetBasedOnLedger2(ACacheableTable, AFeesPayableTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.FeesReceivableList: ReturnValue = GetBasedOnLedger2(ACacheableTable, AFeesReceivableTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.SuspenseAccountList: ReturnValue = GetBasedOnLedger2(ACacheableTable, ASuspenseAccountTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; case TCacheableFinanceTablesEnum.ICHStewardshipList: ReturnValue = GetBasedOnLedger2(TCacheableFinanceTablesEnum.ICHStewardshipList, AIchStewardshipTable.GetLedgerNumberDBName(), ALedgerNumber, out DataTableType, ACustomTableName); break; default: break; } return ReturnValue; }
/** * Returns the chosen DataTable for the Petra Finance Module from the * * If the DataTable is not available on the Client side, it is automatically * retrieved from the Petra Server. * * This overload of GetCacheableFinanceTable also considers the Ledger Number, * and only retrieves the rows based on the given Ledger Number. * * @param ACacheableTable The cached DataTable that should be returned in the * DataSet * @param ALedgerNumber The number of the current ledger that the data should be * from * @return Chosen DataTable * */ public static DataTable GetCacheableFinanceTable(TCacheableFinanceTablesEnum ACacheableTable, System.Int32 ALedgerNumber) { return GetCacheableFinanceTable2(ACacheableTable, ALedgerNumber, String.Empty); }
/** * Returns the chosen DataTable for the Petra Finance Module from the * * If the DataTable is not available on the Client side, it is automatically * retrieved from the Petra Server. * * @param ACacheableTable The cached DataTable that should be returned in the * DataSet * @return Chosen DataTable * */ public static DataTable GetCacheableFinanceTable2(TCacheableFinanceTablesEnum ACacheableTable, string ACustomTableName) { try { string CacheableTableName = Enum.GetName(typeof(TCacheableFinanceTablesEnum), ACacheableTable); return TDataCache.GetCacheableDataTableFromCache2(CacheableTableName, ACustomTableName); } catch (System.Runtime.Remoting.RemotingException Exc) { // most probably a permission problem: System.Runtime.Remoting.RemotingException: Requested Service not found throw new Exception(Catalog.GetString("You do not have enough permissions to access the Finance module:") + "\n" + Exc.ToString()); } }
/** * Returns the chosen DataTable for the Petra Finance Module from the * * If the DataTable is not available on the Client side, it is automatically * retrieved from the Petra Server. * * @param ACacheableTable The cached DataTable that should be returned in the * DataSet * @return Chosen DataTable * */ public static DataTable GetCacheableFinanceTable(TCacheableFinanceTablesEnum ACacheableTable) { return GetCacheableFinanceTable2(ACacheableTable, String.Empty); }