private DataTable GetCostCentresLinkedToPartnerListTable(TDBTransaction AReadTransaction, System.Int32 ALedgerNumber, string ATableName)
        {
            DataTable CostCentreTable;

            CostCentreTable            = TCostCentresLinkedToPartner.GetData(ATableName, ALedgerNumber, AReadTransaction);
            CostCentreTable.PrimaryKey = new DataColumn[] {
                CostCentreTable.Columns[AValidLedgerNumberTable.GetLedgerNumberDBName()],
                CostCentreTable.Columns[AValidLedgerNumberTable.GetCostCentreCodeDBName()],
                CostCentreTable.Columns[AValidLedgerNumberTable.GetPartnerKeyDBName()]
            };
            return(CostCentreTable);
        }
 /// <summary>
 /// Loads all costcentres that are linked to a partner, with the partner key and partner class
 /// </summary>
 public static DataTable GetData(String ATableName, Int32 ALedgerNumber, TDBTransaction AReadTransaction)
 {
     return(DBAccess.GDBAccessObj.SelectDT(
                String.Format(
                    "SELECT {0}, {3}.{1}, {3}.{5}, {2}, {8} FROM pub_{3} " +
                    "LEFT OUTER JOIN PUB_{7} ON PUB_{7}.{1} = PUB_{3}.{1}, pub_{4} " +
                    "WHERE pub_{3}.{1} = pub_{4}.{1} AND pub_{3}.{5} = {6}",
                    AValidLedgerNumberTable.GetCostCentreCodeDBName(),
                    AValidLedgerNumberTable.GetPartnerKeyDBName(),
                    PPartnerTable.GetPartnerClassDBName(),
                    AValidLedgerNumberTable.GetTableDBName(),
                    PPartnerTable.GetTableDBName(),
                    AValidLedgerNumberTable.GetLedgerNumberDBName(),
                    ALedgerNumber.ToString(),
                    PUnitTable.GetTableDBName(),
                    PUnitTable.GetUnitTypeCodeDBName()),
                ATableName,
                AReadTransaction));
 }