Ejemplo n.º 1
0
        /// <summary>
        /// Load all the data of a partner into a TDS
        /// </summary>
        public static PartnerImportExportTDS ExportPartner(Int64 APartnerKey)
        {
            PartnerImportExportTDS MainDS      = new PartnerImportExportTDS();
            TDBTransaction         Transaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.ReadCommitted);

            PPartnerAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
            PChurchAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
            PFamilyAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
            PPersonAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
            POrganisationAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
            PUnitAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
            PVenueAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);

            PLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
            PPartnerLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);

            PPartnerCommentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
            PPartnerTypeAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
            PPartnerInterestAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
            PPartnerGiftDestinationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);

            PInterestAccess.LoadAll(MainDS, Transaction);

            PmPersonalDataAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
            PmPassportDetailsAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmDocumentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
            PmDocumentTypeAccess.LoadAll(MainDS, Transaction);
            PmPersonQualificationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmSpecialNeedAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmPastExperienceAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmPersonLanguageAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmPersonAbilityAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmStaffDataAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmJobAssignmentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
            PmPersonEvaluationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);

            PmGeneralApplicationAccess.LoadViaPPersonPartnerKey(MainDS, APartnerKey, Transaction);
            PtApplicationTypeAccess.LoadAll(MainDS, Transaction);
            PmShortTermApplicationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
            PmYearProgramApplicationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);

            UmUnitStructureAccess.LoadViaPUnitChildUnitKey(MainDS, APartnerKey, Transaction);
            UmUnitAbilityAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
            UmUnitLanguageAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
            UmUnitCostAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
            UmJobAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
            UmJobRequirementAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
            UmJobLanguageAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
            UmJobQualificationAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);

            PcBuildingAccess.LoadViaPVenue(MainDS, APartnerKey, Transaction);
            PcRoomAccess.LoadViaPVenue(MainDS, APartnerKey, Transaction);

            DBAccess.GDBAccessObj.RollbackTransaction();
            return(MainDS);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Load all the data of a partner into a TDS
        /// </summary>
        public static PartnerImportExportTDS ExportPartner(Int64 APartnerKey, TPartnerClass?APartnerClass = null)
        {
            PartnerImportExportTDS MainDS = new PartnerImportExportTDS();

            TDBTransaction Transaction = new TDBTransaction();

            DBAccess.ReadTransaction(
                ref Transaction,
                delegate
            {
                PPartnerAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);

                // APartnerClass is optional but if it was not provided we need to assign to it now
                if (APartnerClass == null)
                {
                    APartnerClass = SharedTypes.PartnerClassStringToEnum(MainDS.PPartner[0].PartnerClass);
                }

                if (APartnerClass == TPartnerClass.CHURCH)
                {
                    PChurchAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
                }
                else if (APartnerClass == TPartnerClass.FAMILY)
                {
                    PFamilyAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);

                    PPartnerGiftDestinationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                }
                else if (APartnerClass == TPartnerClass.PERSON)
                {
                    PPersonAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);

                    PmPersonalDataAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
                    PmPassportDetailsAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmDocumentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                    PmDocumentTypeAccess.LoadAll(MainDS, Transaction);
                    PmPersonQualificationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmSpecialNeedAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmPastExperienceAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmPersonLanguageAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmPersonAbilityAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmStaffDataAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmJobAssignmentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                    PmPersonEvaluationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmPersonSkillAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);

                    PmGeneralApplicationAccess.LoadViaPPersonPartnerKey(MainDS, APartnerKey, Transaction);
                    PtApplicationTypeAccess.LoadAll(MainDS, Transaction);
                    PmShortTermApplicationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                    PmYearProgramApplicationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
                }
                else if (APartnerClass == TPartnerClass.ORGANISATION)
                {
                    POrganisationAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
                }
                else if (APartnerClass == TPartnerClass.UNIT)
                {
                    PUnitAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);

                    UmUnitStructureAccess.LoadViaPUnitChildUnitKey(MainDS, APartnerKey, Transaction);
                    UmUnitAbilityAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
                    UmUnitLanguageAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
                    UmUnitCostAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
                    UmJobAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
                    UmJobRequirementAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
                    UmJobLanguageAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
                    UmJobQualificationAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
                }
                else if (APartnerClass == TPartnerClass.VENUE)
                {
                    PVenueAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);

                    PcBuildingAccess.LoadViaPVenue(MainDS, APartnerKey, Transaction);
                    PcRoomAccess.LoadViaPVenue(MainDS, APartnerKey, Transaction);
                }

                PPartnerAttributeAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);

                PLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                PPartnerLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);

                PPartnerCommentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                PPartnerTypeAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                PPartnerInterestAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                PInterestAccess.LoadAll(MainDS, Transaction);
            });

            return(MainDS);
        }
        public static bool GetData(string ATablename, TSearchCriteria[] ASearchCriteria, out TTypedDataTable AResultTable)
        {
            // TODO: check access permissions for the current user

            TDBTransaction ReadTransaction = null;

            TTypedDataTable tempTable = null;

            DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.RepeatableRead,
                                                                      TEnforceIsolationLevel.eilMinimum,
                                                                      ref ReadTransaction,
                                                                      delegate
            {
                // TODO: auto generate
                if (ATablename == AApSupplierTable.GetTableDBName())
                {
                    tempTable = AApSupplierAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == AApDocumentTable.GetTableDBName())
                {
                    tempTable = AApDocumentAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == ATransactionTypeTable.GetTableDBName())
                {
                    tempTable = ATransactionTypeAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == ACurrencyTable.GetTableDBName())
                {
                    tempTable = ACurrencyAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ADailyExchangeRateTable.GetTableDBName())
                {
                    tempTable = ADailyExchangeRateAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ACorporateExchangeRateTable.GetTableDBName())
                {
                    tempTable = ACorporateExchangeRateAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ACurrencyLanguageTable.GetTableDBName())
                {
                    tempTable = ACurrencyLanguageAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AFeesPayableTable.GetTableDBName())
                {
                    tempTable = AFeesPayableAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AFeesReceivableTable.GetTableDBName())
                {
                    tempTable = AFeesReceivableAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AAnalysisTypeTable.GetTableDBName())
                {
                    tempTable = AAnalysisTypeAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == AGiftBatchTable.GetTableDBName())
                {
                    tempTable = AGiftBatchAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AJournalTable.GetTableDBName())
                {
                    tempTable = AJournalAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ALedgerTable.GetTableDBName())
                {
                    tempTable = ALedgerAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == MExtractMasterTable.GetTableDBName())
                {
                    if (ASearchCriteria == null)
                    {
                        tempTable = MExtractMasterAccess.LoadAll(ReadTransaction);
                    }
                    else
                    {
                        tempTable = MExtractMasterAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                    }
                }
                else if (ATablename == MExtractTable.GetTableDBName())
                {
                    // it does not make sense to load ALL extract rows for all extract masters so search criteria needs to be set
                    if (ASearchCriteria != null)
                    {
                        tempTable = MExtractAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                    }
                }
                else if (ATablename == PcAttendeeTable.GetTableDBName())
                {
                    tempTable = PcAttendeeAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcConferenceCostTable.GetTableDBName())
                {
                    tempTable = PcConferenceCostAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcEarlyLateTable.GetTableDBName())
                {
                    tempTable = PcEarlyLateAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcSupplementTable.GetTableDBName())
                {
                    tempTable = PcSupplementAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcDiscountTable.GetTableDBName())
                {
                    tempTable = PcDiscountAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PFormTable.GetTableDBName())
                {
                    string[] columns           = TTypedDataTable.GetColumnStringList(PFormTable.TableId);
                    StringCollection fieldList = new StringCollection();

                    for (int i = 0; i < columns.Length; i++)
                    {
                        // Do not load the template document - we don't display it and it is big!
                        if (columns[i] != PFormTable.GetTemplateDocumentDBName())
                        {
                            fieldList.Add(columns[i]);
                        }
                    }

                    tempTable = PFormAccess.LoadAll(fieldList, ReadTransaction);
                }
                else if (ATablename == PInternationalPostalTypeTable.GetTableDBName())
                {
                    tempTable = PInternationalPostalTypeAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == PtApplicationTypeTable.GetTableDBName())
                {
                    tempTable = PtApplicationTypeAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == PFormalityTable.GetTableDBName())
                {
                    tempTable = PFormalityAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == PMailingTable.GetTableDBName())
                {
                    tempTable = PMailingAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == PPartnerGiftDestinationTable.GetTableDBName())
                {
                    tempTable = PPartnerGiftDestinationAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PmDocumentTypeTable.GetTableDBName())
                {
                    tempTable = PmDocumentTypeAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == SGroupTable.GetTableDBName())
                {
                    tempTable = SGroupAccess.LoadAll(ReadTransaction);
                }
                else
                {
                    throw new Exception("TCommonDataReader.GetData: unknown table " + ATablename);
                }
            });

            // Accept row changes here so that the Client gets 'unmodified' rows
            tempTable.AcceptChanges();

            // return the table
            AResultTable = tempTable;

            return(true);
        }
        public static void GetData(string ATablename, TSearchCriteria[] ASearchCriteria, out TTypedDataTable AResultTable,
                                   TDBTransaction AReadTransaction)
        {
            AResultTable = null;
            string context = string.Format("GetData {0}", SharedConstants.MODULE_ACCESS_MANAGER);

            // check access permissions for the current user
            TModuleAccessManager.CheckUserPermissionsForTable(ATablename, TTablePermissionEnum.eCanRead);

            // TODO: auto generate
            if (ATablename == AApSupplierTable.GetTableDBName())
            {
                AResultTable = AApSupplierAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == AApDocumentTable.GetTableDBName())
            {
                AResultTable = AApDocumentAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == ATransactionTypeTable.GetTableDBName())
            {
                AResultTable = ATransactionTypeAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == ACurrencyTable.GetTableDBName())
            {
                AResultTable = ACurrencyAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == ADailyExchangeRateTable.GetTableDBName())
            {
                AResultTable = ADailyExchangeRateAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == ACorporateExchangeRateTable.GetTableDBName())
            {
                AResultTable = ACorporateExchangeRateAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == ACurrencyLanguageTable.GetTableDBName())
            {
                AResultTable = ACurrencyLanguageAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == AFeesPayableTable.GetTableDBName())
            {
                AResultTable = AFeesPayableAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == AFeesReceivableTable.GetTableDBName())
            {
                AResultTable = AFeesReceivableAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == AAnalysisTypeTable.GetTableDBName())
            {
                AResultTable = AAnalysisTypeAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == AGiftBatchTable.GetTableDBName())
            {
                AResultTable = AGiftBatchAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == AJournalTable.GetTableDBName())
            {
                AResultTable = AJournalAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == ALedgerTable.GetTableDBName())
            {
                AResultTable = ALedgerAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == MExtractMasterTable.GetTableDBName())
            {
                if (ASearchCriteria == null)
                {
                    AResultTable = MExtractMasterAccess.LoadAll(AReadTransaction);
                }
                else
                {
                    AResultTable = MExtractMasterAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
                }
            }
            else if (ATablename == MExtractTable.GetTableDBName())
            {
                // it does not make sense to load ALL extract rows for all extract masters so search criteria needs to be set
                if (ASearchCriteria != null)
                {
                    AResultTable = MExtractAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
                }
            }
            else if (ATablename == PcAttendeeTable.GetTableDBName())
            {
                AResultTable = PcAttendeeAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == PcConferenceCostTable.GetTableDBName())
            {
                AResultTable = PcConferenceCostAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == PcEarlyLateTable.GetTableDBName())
            {
                AResultTable = PcEarlyLateAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == PcSupplementTable.GetTableDBName())
            {
                AResultTable = PcSupplementAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == PcDiscountTable.GetTableDBName())
            {
                AResultTable = PcDiscountAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == PCountryTable.GetTableDBName())
            {
                AResultTable = PCountryAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == PFormTable.GetTableDBName())
            {
                string[]         columns   = TTypedDataTable.GetColumnStringList(PFormTable.TableId);
                StringCollection fieldList = new StringCollection();

                for (int i = 0; i < columns.Length; i++)
                {
                    // Do not load the template document - we don't display it and it is big!
                    if (columns[i] != PFormTable.GetTemplateDocumentDBName())
                    {
                        fieldList.Add(columns[i]);
                    }
                }

                AResultTable = PFormAccess.LoadAll(fieldList, AReadTransaction);
            }
            else if (ATablename == PInternationalPostalTypeTable.GetTableDBName())
            {
                AResultTable = PInternationalPostalTypeAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == PtApplicationTypeTable.GetTableDBName())
            {
                AResultTable = PtApplicationTypeAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == PFormalityTable.GetTableDBName())
            {
                AResultTable = PFormalityAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == PMailingTable.GetTableDBName())
            {
                AResultTable = PMailingAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == PPartnerGiftDestinationTable.GetTableDBName())
            {
                AResultTable = PPartnerGiftDestinationAccess.LoadUsingTemplate(ASearchCriteria, AReadTransaction);
            }
            else if (ATablename == PmDocumentTypeTable.GetTableDBName())
            {
                AResultTable = PmDocumentTypeAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == SGroupTable.GetTableDBName())
            {
                TSecurityChecks.CheckUserModulePermissions(SharedConstants.PETRAMODULE_SYSADMIN, context);
                AResultTable = SGroupAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == SSystemDefaultsTable.GetTableDBName())
            {
                TSecurityChecks.CheckUserModulePermissions(SharedConstants.PETRAMODULE_SYSADMIN, context);
                AResultTable = SSystemDefaultsAccess.LoadAll(AReadTransaction);
            }
            else if (ATablename == SSystemDefaultsGuiTable.GetTableDBName())
            {
                AResultTable = SSystemDefaultsGuiAccess.LoadAll(AReadTransaction);
            }
            else
            {
                throw new Exception("TCommonDataReader.GetData: unknown table " + ATablename);
            }

            // Accept row changes here so that the Client gets 'unmodified' rows
            AResultTable.AcceptChanges();
        }
        public static bool GetData(string ATablename, TSearchCriteria[] ASearchCriteria, out TTypedDataTable AResultTable)
        {
            // TODO: check access permissions for the current user

            bool           NewTransaction = false;
            TDBTransaction ReadTransaction;

            TTypedDataTable tempTable = null;

            try
            {
                ReadTransaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.RepeatableRead,
                                                                                    TEnforceIsolationLevel.eilMinimum,
                                                                                    out NewTransaction);

                // TODO: auto generate
                if (ATablename == AApSupplierTable.GetTableDBName())
                {
                    tempTable = AApSupplierAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == AApDocumentTable.GetTableDBName())
                {
                    tempTable = AApDocumentAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == ATransactionTypeTable.GetTableDBName())
                {
                    tempTable = ATransactionTypeAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == ACurrencyTable.GetTableDBName())
                {
                    tempTable = ACurrencyAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ADailyExchangeRateTable.GetTableDBName())
                {
                    tempTable = ADailyExchangeRateAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ACorporateExchangeRateTable.GetTableDBName())
                {
                    tempTable = ACorporateExchangeRateAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ACurrencyLanguageTable.GetTableDBName())
                {
                    tempTable = ACurrencyLanguageAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AFeesPayableTable.GetTableDBName())
                {
                    tempTable = AFeesPayableAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AFeesReceivableTable.GetTableDBName())
                {
                    tempTable = AFeesReceivableAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AAnalysisTypeTable.GetTableDBName())
                {
                    tempTable = AAnalysisTypeAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AGiftBatchTable.GetTableDBName())
                {
                    tempTable = AGiftBatchAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == AJournalTable.GetTableDBName())
                {
                    tempTable = AJournalAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == ALedgerTable.GetTableDBName())
                {
                    tempTable = ALedgerAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == MExtractMasterTable.GetTableDBName())
                {
                    if (ASearchCriteria == null)
                    {
                        tempTable = MExtractMasterAccess.LoadAll(ReadTransaction);
                    }
                    else
                    {
                        tempTable = MExtractMasterAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                    }
                }
                else if (ATablename == MExtractTable.GetTableDBName())
                {
                    // it does not make sense to load ALL extract rows for all extract masters so search criteria needs to be set
                    if (ASearchCriteria != null)
                    {
                        tempTable = MExtractAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                    }
                }
                else if (ATablename == PcAttendeeTable.GetTableDBName())
                {
                    tempTable = PcAttendeeAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcConferenceCostTable.GetTableDBName())
                {
                    tempTable = PcConferenceCostAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcEarlyLateTable.GetTableDBName())
                {
                    tempTable = PcEarlyLateAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcSupplementTable.GetTableDBName())
                {
                    tempTable = PcSupplementAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PcDiscountTable.GetTableDBName())
                {
                    tempTable = PcDiscountAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PInternationalPostalTypeTable.GetTableDBName())
                {
                    tempTable = PInternationalPostalTypeAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == PtApplicationTypeTable.GetTableDBName())
                {
                    tempTable = PtApplicationTypeAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == PMailingTable.GetTableDBName())
                {
                    tempTable = PMailingAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == PPartnerGiftDestinationTable.GetTableDBName())
                {
                    tempTable = PPartnerGiftDestinationAccess.LoadUsingTemplate(ASearchCriteria, ReadTransaction);
                }
                else if (ATablename == PmDocumentTypeTable.GetTableDBName())
                {
                    tempTable = PmDocumentTypeAccess.LoadAll(ReadTransaction);
                }
                else if (ATablename == SGroupTable.GetTableDBName())
                {
                    tempTable = SGroupAccess.LoadAll(ReadTransaction);
                }
                else
                {
                    throw new Exception("TCommonDataReader.GetData: unknown table " + ATablename);
                }
            }
            catch (Exception Exp)
            {
                DBAccess.GDBAccessObj.RollbackTransaction();
                TLogging.Log("TCommonDataReader.GetData exception: " + Exp.ToString(), TLoggingType.ToLogfile);
                TLogging.Log(Exp.StackTrace, TLoggingType.ToLogfile);
                throw;
            }
            finally
            {
                if (NewTransaction)
                {
                    DBAccess.GDBAccessObj.CommitTransaction();
                    TLogging.LogAtLevel(7, "TCommonDataReader.GetData: committed own transaction.");
                }
            }

            // Accept row changes here so that the Client gets 'unmodified' rows
            tempTable.AcceptChanges();

            // return the table
            AResultTable = tempTable;

            return(true);
        }