/// <summary>
        /// todoComment
        /// </summary>
        /// <param name="ALocationRow"></param>
        /// <param name="APartnerKey"></param>
        /// <param name="AAddressAddedOrChangedPromotionDT"></param>
        /// <param name="AReadTransaction"></param>
        /// <param name="AUpdateLocation"></param>
        /// <param name="ACreateLocation"></param>
        /// <param name="ACreateLocationOtherPartnerKeys"></param>
        /// <param name="AChangePromotionParametersDT"></param>
        /// <returns></returns>
        private static Boolean CheckLocationChange(PLocationRow ALocationRow,
            Int64 APartnerKey,
            ref PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable AAddressAddedOrChangedPromotionDT,
            TDBTransaction AReadTransaction,
            out Boolean AUpdateLocation,
            out Boolean ACreateLocation,
            out Int64[] ACreateLocationOtherPartnerKeys,
            out PartnerAddressAggregateTDSChangePromotionParametersTable AChangePromotionParametersDT)
        {
            Boolean ReturnValue;

            PartnerAddressAggregateTDSChangePromotionParametersRow AddressAddedPromotionRow;

            ACreateLocation = false;
            AUpdateLocation = false;

            ACreateLocationOtherPartnerKeys = null;
            AChangePromotionParametersDT = null;

//          TLogging.LogAtLevel(9, "CheckLocationChange for Location " + ALocationRow.LocationKey.ToString() + ": AAddressAddedOrChangedPromotionDT.Rows.Count: " +
//              AAddressAddedOrChangedPromotionDT.Rows.Count.ToString());

            // Check if there is a Parameter Row for the LocationKey we are looking at
            DataView AddressAddedOrChangedPromotionDV = new DataView(AAddressAddedOrChangedPromotionDT,
                PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetSiteKeyDBName() + " = " + ALocationRow.SiteKey.ToString() +
                " AND " +
                PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetLocationKeyDBName() + " = " + ALocationRow.LocationKey.ToString() +
                " AND " + PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetLocationChangeDBName() + " = true",
                "",
                DataViewRowState.CurrentRows);

            // No, there isn't one  therefore create one
            if (AddressAddedOrChangedPromotionDV.Count == 0)
            {
//              TLogging.LogAtLevel(9, "CheckLocationChange: Location " + ALocationRow.LocationKey.ToString() +
//                  ": Location has been changed and is referenced by other Partners!");
                AAddressAddedOrChangedPromotionDT = new PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable(
                    MPartnerConstants.ADDRESSADDEDORCHANGEDPROMOTION_TABLENAME);
                PartnerAddressAggregateTDSAddressAddedOrChangedPromotionRow AddressAddedOrChangedRow =
                    AAddressAddedOrChangedPromotionDT.NewRowTyped(false);
                AddressAddedOrChangedRow.SiteKey = ALocationRow.SiteKey;
                AddressAddedOrChangedRow.LocationKey = ALocationRow.LocationKey;
                AddressAddedOrChangedRow.PartnerKey = APartnerKey;
                AddressAddedOrChangedRow.LocationChange = true;
                AddressAddedOrChangedRow.LocationAdded = false;
                AddressAddedOrChangedRow.AnswerProcessedClientSide = false;
                AddressAddedOrChangedRow.AnswerProcessedServerSide = false;
                AAddressAddedOrChangedPromotionDT.Rows.Add(AddressAddedOrChangedRow);
                #region Build ChangePromotionParameters DataTable
                AChangePromotionParametersDT = new PartnerAddressAggregateTDSChangePromotionParametersTable(
                    MPartnerConstants.ADDRESSCHANGEPROMOTIONPARAMETERS_TABLENAME);

                // Load data for all other Partners that reference the PartnerLocation
                OdbcParameter[] ParametersArray = new OdbcParameter[3];
                ParametersArray[0] = new OdbcParameter("", OdbcType.Decimal, 10);
                ParametersArray[0].Value = (System.Object)(APartnerKey);
                ParametersArray[1] = new OdbcParameter("", OdbcType.Decimal, 10);
                ParametersArray[1].Value = (System.Object)(ALocationRow.SiteKey);
                ParametersArray[2] = new OdbcParameter("", OdbcType.Int);
                ParametersArray[2].Value = (System.Object)(ALocationRow.LocationKey);
                DataTable OtherPartnerLocationReferencesDT = DBAccess.GDBAccessObj.SelectDT(
                    "SELECT PUB_" + PPartnerLocationTable.GetTableDBName() + '.' + PPartnerLocationTable.GetPartnerKeyDBName() + ", " +
                    PPartnerTable.GetPartnerShortNameDBName() + ", " +
                    PPartnerTable.GetPartnerClassDBName() + ", " + PPartnerLocationTable.GetTelephoneNumberDBName() + ", " +
                    PPartnerLocationTable.GetLocationTypeDBName() + ' ' + "FROM PUB_" + PPartnerTable.GetTableDBName() + " INNER JOIN PUB_" +
                    PPartnerLocationTable.GetTableDBName() + " ON PUB_" + PPartnerTable.GetTableDBName() + '.' +
                    PPartnerTable.GetPartnerKeyDBName() +
                    " = PUB_" + PPartnerLocationTable.GetTableDBName() + '.' + PPartnerLocationTable.GetPartnerKeyDBName() + ' ' + "WHERE    PUB_" +
                    PPartnerLocationTable.GetTableDBName() + '.' + PPartnerLocationTable.GetPartnerKeyDBName() + " <> ? " + "AND    " +
                    PPartnerLocationTable.GetSiteKeyDBName() + " = ? " + "AND    " + PPartnerLocationTable.GetLocationKeyDBName() + " = ?",
                    "OtherPartnerLocationReferencesDT", AReadTransaction, ParametersArray);

                // Don't need these columns for the moment, but it would be nice to have them later on
                // PPartnerLocationTable.GetSendMailDBName + ', ' +
                // PPartnerLocationTable.GetDateEffectiveDBName + ', ' +
                // PPartnerLocationTable.GetDateGoodUntilDBName + ', ' +
                // Insert data into the ChangePromotionParameters DataTable
                for (int Counter = 0; Counter <= OtherPartnerLocationReferencesDT.Rows.Count - 1; Counter += 1)
                {
                    DataRow OtherPartnerLocationReferenceRow = OtherPartnerLocationReferencesDT.Rows[Counter];
                    AddressAddedPromotionRow = AChangePromotionParametersDT.NewRowTyped(false);
                    AddressAddedPromotionRow.SiteKey = ALocationRow.SiteKey;
                    AddressAddedPromotionRow.LocationKey = (Int32)ALocationRow.LocationKey;
                    AddressAddedPromotionRow.PartnerKey = Convert.ToInt64(
                        OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetPartnerKeyDBName()]);
                    AddressAddedPromotionRow.PartnerShortName = OtherPartnerLocationReferenceRow[PPartnerTable.GetPartnerShortNameDBName()].ToString();
                    AddressAddedPromotionRow.PartnerClass = OtherPartnerLocationReferenceRow[PPartnerTable.GetPartnerClassDBName()].ToString();
                    // AddressAddedPromotionRow.SendMail :=
                    // Convert.ToBoolean(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetSendMailDBName]);
                    // if not OtherPartnerLocationReferenceRow.IsNull(
                    // PPartnerLocationTable.GetDateEffectiveDBName) then
                    // begin
                    // AddressAddedPromotionRow.DateEffective :=
                    // Convert.ToDateTime(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetDateEffectiveDBName]);
                    // end;
                    // if not OtherPartnerLocationReferenceRow.IsNull(
                    // PPartnerLocationTable.GetDateGoodUntilDBName) then
                    // begin
                    // AddressAddedPromotionRow.DateGoodUntil :=
                    // Convert.ToDateTime(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetDateGoodUntilDBName]);
                    // end;
                    AddressAddedPromotionRow.LocationType = OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetLocationTypeDBName()].ToString();
                    AChangePromotionParametersDT.Rows.Add(AddressAddedPromotionRow);
                }

//             TLogging.LogAtLevel(9, "CheckLocationChange: Location " + ALocationRow.LocationKey.ToString() + ": inserted PartnerLocation data of " +
//                  AChangePromotionParametersDT.Rows.Count.ToString() + " other Partners that reference this Location into AChangePromotionParametersDT!");
                #endregion
                ReturnValue = true;
            }
            else
            {
                // AAddressAddedOrChangedPromotionDT was passed in, holding parameters for the LocationKey we are looking at
                PartnerAddressAggregateTDSAddressAddedOrChangedPromotionRow AddressAddedOrChangedRow =
                    (PartnerAddressAggregateTDSAddressAddedOrChangedPromotionRow)AddressAddedOrChangedPromotionDV[0].Row;

                if (AddressAddedOrChangedRow.UserAnswer == "CHANGE-NONE")
                {
//                  TLogging.LogAtLevel(9, "CheckLocationChange: AAddressAddedOrChangedPromotionDT tells me to CREATE the Location.");
                    ACreateLocation = true;

                    // Signal to calling procedure that the created location should not be
                    // assigned to any Partner other than the one we are currently processing.
                    ACreateLocationOtherPartnerKeys = new Int64[0];
                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = true;
                }
                else if (AddressAddedOrChangedRow.UserAnswer.StartsWith("CHANGE-SOME"))
                {
//                  TLogging.LogAtLevel(9, "CheckLocationChange: AAddressAddedOrChangedPromotionDT tells me to CREATE the Location and assign it to selected partners.");
                    ACreateLocation = true;

                    // Parse the UserAnswer. It's format is 'CHANGESOME:PartnerKey1;PartnerKey2;PartnerKeyN'
                    string[] ChangeSomeArray = AddressAddedOrChangedRow.UserAnswer.Split(":,".ToCharArray());

                    // Build the ACreateLocationOtherPartnerKeys array from it to
                    // signal to calling procedure that the created location should be
                    // assigned to all the Partners contained in the Array.
                    ACreateLocationOtherPartnerKeys = new Int64[ChangeSomeArray.Length - 1];

                    for (int Counter = 1; Counter <= ChangeSomeArray.Length - 1; Counter += 1)
                    {
                        ACreateLocationOtherPartnerKeys[Counter - 1] = Convert.ToInt64(ChangeSomeArray[Counter]);
                    }

                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = true;
                }
                else if (AddressAddedOrChangedRow.UserAnswer == "CHANGE-ALL")
                {
//                  TLogging.LogAtLevel(9, "CheckLocationChange: AAddressAddedOrChangedPromotionDT tells me to UPDATE the Location.");
                    AUpdateLocation = true;
                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = true;
                }
                else
                {
//                  TLogging.LogAtLevel(9, "CheckLocationChange: AAddressAddedOrChangedPromotionDT tells me to CANCEL the changing of the Location.");
                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = false;
                }
            }

            return ReturnValue;
        }
        /// <summary>
        /// </summary>
        /// <param name="APartnerLocationRow"></param>
        /// <param name="APartnerKey"></param>
        /// <param name="AAddressAddedOrChangedPromotionDT"></param>
        /// <param name="AReadTransaction"></param>
        /// <param name="AUpdatePartnerLocations"></param>
        /// <param name="AUpdatePartnerLocationOtherPersons"></param>
        /// <param name="AChangePromotionParametersDT"></param>
        /// <returns></returns>
        private static Boolean CheckPartnerLocationChange(PPartnerLocationRow APartnerLocationRow,
            Int64 APartnerKey,
            ref PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable AAddressAddedOrChangedPromotionDT,
            TDBTransaction AReadTransaction,
            out Boolean AUpdatePartnerLocations,
            out Int64[, ] AUpdatePartnerLocationOtherPersons,
            ref PartnerAddressAggregateTDSChangePromotionParametersTable AChangePromotionParametersDT)
        {
            Boolean ReturnValue;
            DataView AddressAddedOrChangedPromotionDV;
            StringCollection ChangedDetails;

            string[] ChangeSomeArray;
            PartnerAddressAggregateTDSAddressAddedOrChangedPromotionRow AddressAddedOrChangedRow;
            OdbcParameter[] ParametersArray;
            DataSet PersonsLocationReferencesDS;
            DataRow OtherPartnerLocationReferenceRow;
            Int32 Counter;
            Int32 Counter2;
            Int32 Counter3;
            PartnerAddressAggregateTDSChangePromotionParametersRow PartnerLocationChangePromotionRow;
            DataView AChangePromotionParametersDV;

            AUpdatePartnerLocations = false;
            AUpdatePartnerLocationOtherPersons = new Int64[0, 0];

//          TLogging.LogAtLevel(9, "CheckPartnerLocationChange for Location " + APartnerLocationRow.LocationKey.ToString() +
//                  ": AAddressAddedOrChangedPromotionDT.Rows.Count: " + AAddressAddedOrChangedPromotionDT.Rows.Count.ToString());

            // Check if there is a Parameter Row for the LocationKey we are looking at
            AddressAddedOrChangedPromotionDV = new DataView(AAddressAddedOrChangedPromotionDT,
                PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetSiteKeyDBName() + " = " +
                APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetSiteKeyDBName(),
                                    DataRowVersion.Original].ToString() + " AND " +
                PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetLocationKeyDBName() +
                " = " +
                APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetLocationKeyDBName(),
                                    DataRowVersion.Original].ToString() + " AND " +
                PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetPartnerLocationChangeDBName() + " = true",
                "",
                DataViewRowState.CurrentRows);

            // APartnerLocationRow.SiteKey.ToString
            // APartnerLocationRow.LocationKey.ToString
            // No, there isn't one  therefore create one (if necessary)
            if (AddressAddedOrChangedPromotionDV.Count == 0)
            {
                /*
                 * Check if one ore more of specific PartnerLocation Data-holding fields
                 * were changed
                 */
                if (CheckHasPartnerLocationPromotionDetailChanged(APartnerLocationRow, out ChangedDetails))
                {
                    if (PPersonAccess.CountViaPFamily(APartnerKey, AReadTransaction) > 0)
                    {
//                      TLogging.LogAtLevel(9, "CheckPartnerLocationChange: PartnerLocation with LocationKey " + APartnerLocationRow.LocationKey.ToString() +
//                          ": certain fields have been changed and there are Family Members to which they can be promoted!");
                        #region Build AddressAddedOrChangedPromotion DataTable
                        AAddressAddedOrChangedPromotionDT = new PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable(
                            MPartnerConstants.ADDRESSADDEDORCHANGEDPROMOTION_TABLENAME);
                        AddressAddedOrChangedRow = AAddressAddedOrChangedPromotionDT.NewRowTyped(false);
                        AddressAddedOrChangedRow.SiteKey =
                            Convert.ToInt64(APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetSiteKeyDBName(),
                                                                DataRowVersion.Original]);

                        // APartnerLocationRow.SiteKey;
                        AddressAddedOrChangedRow.LocationKey =
                            Convert.ToInt32(APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetLocationKeyDBName(),
                                                                DataRowVersion.Original]);

                        // APartnerLocationRow.LocationKey;
                        AddressAddedOrChangedRow.PartnerKey = APartnerKey;
                        AddressAddedOrChangedRow.LocationChange = false;
                        AddressAddedOrChangedRow.PartnerLocationChange = true;
                        AddressAddedOrChangedRow.LocationAdded = false;
                        AddressAddedOrChangedRow.ChangedFields = StringHelper.StrMerge(ChangedDetails, '|');
//                      TLogging.LogAtLevel(9, "CheckPartnerLocationChange: ChangedFields String: " + AddressAddedOrChangedRow.ChangedFields.ToString() +
//                                " (ChangedDetails.Count /4: " + Convert.ToInt16(ChangedDetails.Count / 4.0).ToString() + ')');
                        AddressAddedOrChangedRow.AnswerProcessedClientSide = false;
                        AddressAddedOrChangedRow.AnswerProcessedServerSide = false;
                        AAddressAddedOrChangedPromotionDT.Rows.Add(AddressAddedOrChangedRow);
                        #endregion
                        #region Build ChangePromotionParameters DataTable
                        AChangePromotionParametersDT = new PartnerAddressAggregateTDSChangePromotionParametersTable(
                            MPartnerConstants.ADDRESSCHANGEPROMOTIONPARAMETERS_TABLENAME);

                        // Load data for all PERSONs of the FAMILY
                        ParametersArray = new OdbcParameter[1];
                        ParametersArray[0] = new OdbcParameter("", OdbcType.Decimal, 10);
                        ParametersArray[0].Value = (System.Object)(APartnerKey);
                        PersonsLocationReferencesDS = DBAccess.GDBAccessObj.Select(
                            "SELECT PUB_" + PPartnerLocationTable.GetTableDBName() + '.' + PPartnerLocationTable.GetPartnerKeyDBName() + ", " +
                            PPartnerLocationTable.GetSiteKeyDBName() + ", " + PPartnerLocationTable.GetLocationKeyDBName() + ", " +
                            PPartnerTable.GetPartnerShortNameDBName() + ", " +
                            PPartnerTable.GetPartnerClassDBName() + ", " + PPartnerLocationTable.GetTelephoneNumberDBName() + ", " +
                            PPartnerLocationTable.GetExtensionDBName() + ", " + PPartnerLocationTable.GetFaxNumberDBName() + ", " +
                            PPartnerLocationTable.GetFaxExtensionDBName() + ", " + PPartnerLocationTable.GetAlternateTelephoneDBName() + ", " +
                            PPartnerLocationTable.GetMobileNumberDBName() + ", " + PPartnerLocationTable.GetEmailAddressDBName() + ", " +
                            PPartnerLocationTable.GetUrlDBName() + ", " + PPartnerLocationTable.GetSendMailDBName() + ", " +
                            PPartnerLocationTable.GetDateEffectiveDBName() + ", " + PPartnerLocationTable.GetDateGoodUntilDBName() + ", " +
                            PPartnerLocationTable.GetLocationTypeDBName() + ' ' + "FROM PUB_" + PPersonTable.GetTableDBName() + ", PUB_" +
                            PPartnerLocationTable.GetTableDBName() + ", PUB_" + PPartnerTable.GetTableDBName() + ' ' + "WHERE PUB_" +
                            PPersonTable.GetTableDBName() + '.' + PPersonTable.GetFamilyKeyDBName() + " = ? " + "AND PUB_" +
                            PPartnerLocationTable.GetTableDBName() + '.' + PPartnerLocationTable.GetPartnerKeyDBName() + " = PUB_" +
                            PPersonTable.GetTableDBName() + '.' + PPersonTable.GetPartnerKeyDBName() + ' ' + "AND PUB_" +
                            PPartnerTable.GetTableDBName() +
                            '.' + PPartnerTable.GetPartnerKeyDBName() + " = PUB_" + PPersonTable.GetTableDBName() + '.' +
                            PPersonTable.GetPartnerKeyDBName(
                                ) + ' ' + "ORDER BY PUB_" + PPersonTable.GetTableDBName() + '.' + PPersonTable.GetFamilyIdDBName() +
                            " ASC, PUB_" +
                            PPartnerLocationTable.GetTableDBName() + '.' + PPartnerLocationTable.GetSendMailDBName() + " DESC",
                            "PersonsLocationReferences", AReadTransaction, ParametersArray);

                        // Insert data into the ChangePromotionParameters DataTable
                        for (Counter = 0; Counter <= PersonsLocationReferencesDS.Tables[0].Rows.Count - 1; Counter += 1)
                        {
                            OtherPartnerLocationReferenceRow = PersonsLocationReferencesDS.Tables[0].Rows[Counter];
                            PartnerLocationChangePromotionRow = AChangePromotionParametersDT.NewRowTyped(false);
                            PartnerLocationChangePromotionRow.PartnerKey =
                                Convert.ToInt64(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetPartnerKeyDBName()]);
                            PartnerLocationChangePromotionRow.SiteKey =
                                Convert.ToInt64(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetSiteKeyDBName()]);
                            PartnerLocationChangePromotionRow.LocationKey =
                                Convert.ToInt32(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetLocationKeyDBName()]);
                            PartnerLocationChangePromotionRow.PartnerShortName =
                                OtherPartnerLocationReferenceRow[PPartnerTable.GetPartnerShortNameDBName()].ToString();
                            PartnerLocationChangePromotionRow.PartnerClass =
                                OtherPartnerLocationReferenceRow[PPartnerTable.GetPartnerClassDBName()].ToString();
                            PartnerLocationChangePromotionRow.TelephoneNumber =
                                OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetTelephoneNumberDBName()].ToString();
                            PartnerLocationChangePromotionRow.Extension =
                                Convert.ToInt32(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetExtensionDBName()]);
                            PartnerLocationChangePromotionRow.FaxNumber =
                                OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetFaxNumberDBName()].ToString();
                            PartnerLocationChangePromotionRow.FaxExtension =
                                Convert.ToInt32(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetFaxExtensionDBName()]);
                            PartnerLocationChangePromotionRow.AlternateTelephone =
                                OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetAlternateTelephoneDBName()].ToString();
                            PartnerLocationChangePromotionRow.MobileNumber =
                                OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetMobileNumberDBName()].ToString();
                            PartnerLocationChangePromotionRow.EmailAddress =
                                OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetEmailAddressDBName()].ToString();
                            PartnerLocationChangePromotionRow.Url = OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetUrlDBName()].ToString();
                            PartnerLocationChangePromotionRow.SendMail =
                                Convert.ToBoolean(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetSendMailDBName()]);

                            if (!OtherPartnerLocationReferenceRow.IsNull(PPartnerLocationTable.GetDateEffectiveDBName()))
                            {
                                PartnerLocationChangePromotionRow.DateEffective =
                                    Convert.ToDateTime(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetDateEffectiveDBName()]);
                            }

                            if (!OtherPartnerLocationReferenceRow.IsNull(PPartnerLocationTable.GetDateGoodUntilDBName()))
                            {
                                PartnerLocationChangePromotionRow.DateGoodUntil =
                                    Convert.ToDateTime(OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetDateGoodUntilDBName()]);
                            }

                            PartnerLocationChangePromotionRow.LocationType =
                                OtherPartnerLocationReferenceRow[PPartnerLocationTable.GetLocationTypeDBName()].ToString();

                            // Add the SiteKey and LocationKey of the currently processed
                            // PartnerLocation record. This is necessary to be able to filter on the
                            // rows at a later stage on Client side and Server side!
                            PartnerLocationChangePromotionRow.SiteKeyOfEditedRecord =
                                Convert.ToInt64(APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetSiteKeyDBName(),
                                                                    DataRowVersion.Original]);

                            // APartnerLocationRow.SiteKey;
                            PartnerLocationChangePromotionRow.LocationKeyOfEditedRecord =
                                Convert.ToInt32(APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.
                                                                    GetLocationKeyDBName(),
                                                                    DataRowVersion.Original]);

                            // APartnerLocationRow.LocationKey;
                            AChangePromotionParametersDT.Rows.Add(PartnerLocationChangePromotionRow);
                        }

//                      TLogging.LogAtLevel(9, "CheckPartnerLocationChange: Location " + APartnerLocationRow.LocationKey.ToString() +
//                              ": inserted PartnerLocation data of " + AChangePromotionParametersDT.Rows.Count.ToString() +
//                              " PERSON''s of that FAMILY into AChangePromotionParametersDT!");
                        #endregion
                    }
                }

                ReturnValue = true;
            }
            else
            {
                // AAddressAddedOrChangedPromotionDT was passed in, holding parameters for the LocationKey we are looking at
                AddressAddedOrChangedRow = (PartnerAddressAggregateTDSAddressAddedOrChangedPromotionRow)AddressAddedOrChangedPromotionDV[0].Row;

                if (AddressAddedOrChangedRow.UserAnswer == "CHANGE-NONE")
                {
//                  TLogging.LogAtLevel(9, "CheckPartnerLocationChange: AAddressAddedOrChangedPromotionDT tells me to UPDATE NONE of the Persons with the changes that were made to the PartnerLocation.");

                    // No processing necessary!
                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = true;
                }
                else if (AddressAddedOrChangedRow.UserAnswer.StartsWith("CHANGE-SOME"))
                {
//                  TLogging.LogAtLevel(9, "CheckPartnerLocationChange: AAddressAddedOrChangedPromotionDT tells me to UPDATE SOME Persons with the changes that were made to the PartnerLocation.");
                    AUpdatePartnerLocations = true;

                    // Parse the UserAnswer. It's format is 'CHANGESOME:PartnerKey1,SiteKey1,LocationKey1;PartnerKey2,SiteKey2,LocationKey2;PartnerKeyN,SiteKeyN,LocationKeyN'
                    ChangeSomeArray = AddressAddedOrChangedRow.UserAnswer.Split(":,;".ToCharArray());

                    /*
                     * Build the AUpdatePartnerLocationOtherPersons array from the UserAnswer
                     * to signal to calling procedure that the changes that were made to the
                     * PartnerLocation that we are processing should be
                     * taken over to all the Person's PartnerLocations contained in the Array.
                     */
                    AUpdatePartnerLocationOtherPersons = new Int64[Convert.ToInt32((ChangeSomeArray.Length - 1) / 3.0), 3];

                    // Counter: ' 1': don't include 'CHANGESOME' array entry, '/ 3' each entry consists of three strings:
                    Counter = 1;
                    Counter2 = 0;

                    while (Counter < AUpdatePartnerLocationOtherPersons.GetLength(0) * 3)
                    {
                        // store PartnerKey
                        AUpdatePartnerLocationOtherPersons[Counter2, 0] = Convert.ToInt64(ChangeSomeArray[Counter]);
//                      TLogging.LogAtLevel(9, "CheckPartnerLocationChange: PartnerKey[" + Counter2.ToString() + "]: " +
//                              AUpdatePartnerLocationOtherPersons[Counter2, 0].ToString());

                        // store SiteKey
                        AUpdatePartnerLocationOtherPersons[Counter2, 1] = Convert.ToInt32(ChangeSomeArray[Counter + 1]);
//                      TLogging.LogAtLevel(9, "CheckPartnerLocationChange: SiteKey[" + Counter2.ToString() + "]: " +
//                            AUpdatePartnerLocationOtherPersons[Counter2, 1].ToString());

                        // store LocationKey
                        AUpdatePartnerLocationOtherPersons[Counter2, 2] = Convert.ToInt32(ChangeSomeArray[Counter + 2]);
//                      TLogging.LogAtLevel(9, "CheckPartnerLocationChange: LocationKey[" + Counter2.ToString() + "]: " +
//                            AUpdatePartnerLocationOtherPersons[Counter2, 2].ToString());
                        // position Counter to next 'record' of PartnerKey, SiteKey and LocationKey
                        Counter = Counter + 3;
                        Counter2 = Counter2 + 1;
                    }

                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = true;
                }
                else if (AddressAddedOrChangedRow.UserAnswer == "CHANGE-ALL")
                {
//                  TLogging.LogAtLevel(9,  "CheckPartnerLocationChange: AAddressAddedOrChangedPromotionDT tells me to UPDATE ALL Persons with the changes that were made to the PartnerLocation.");
                    AUpdatePartnerLocations = true;

                    /*
                     * Build the AUpdatePartnerLocationOtherPersons array from
                     * AChangePromotionParametersDT to signal to calling procedure that the
                     * changes that were made to the PartnerLocation that we are processing
                     * should be taken over to all the Person's PartnerLocations contained in
                     * the Array.
                     */

                    // Process only AChangePromotionParametersDT rows that are for the current
                    // SiteKey and LocationKey!
//                  TLogging.LogAtLevel(9, "CheckPartnerLocationChange: AChangePromotionParametersDT.Rows.Count: " +
//                        AChangePromotionParametersDT.Rows.Count.ToString());
                    AChangePromotionParametersDV = new DataView(AChangePromotionParametersDT,
                        PartnerAddressAggregateTDSChangePromotionParametersTable.GetSiteKeyOfEditedRecordDBName() + " = " +
                        Convert.ToInt64(APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetSiteKeyDBName(),
                                                            DataRowVersion.Original]).ToString() + " AND " +
                        PartnerAddressAggregateTDSChangePromotionParametersTable.GetLocationKeyOfEditedRecordDBName() + " = " +
                        Convert.ToInt32(APartnerLocationRow[PartnerAddressAggregateTDSAddressAddedOrChangedPromotionTable.GetLocationKeyDBName(),
                                                            DataRowVersion.Original]).ToString(),
                        "",
                        DataViewRowState.CurrentRows);

                    // APartnerLocationRow.SiteKey.ToString
                    // APartnerLocationRow.LocationKey.ToString
//                  TLogging.LogAtLevel(9, "CheckPartnerLocationChange: AChangePromotionParametersDV.Count: " + AChangePromotionParametersDV.Count.ToString());
                    AUpdatePartnerLocationOtherPersons = new Int64[AChangePromotionParametersDV.Count, 3];

                    for (Counter3 = 0; Counter3 <= AChangePromotionParametersDV.Count - 1; Counter3 += 1)
                    {
                        // store PartnerKey
                        AUpdatePartnerLocationOtherPersons[Counter3,
                                                           0] =
                            ((PartnerAddressAggregateTDSChangePromotionParametersRow)(AChangePromotionParametersDV[Counter3].Row)).PartnerKey;

                        // store SiteKey
                        AUpdatePartnerLocationOtherPersons[Counter3,
                                                           1] =
                            ((PartnerAddressAggregateTDSChangePromotionParametersRow)(AChangePromotionParametersDV[Counter3].Row)).SiteKey;

                        // store LocationKey
                        AUpdatePartnerLocationOtherPersons[Counter3,
                                                           2] =
                            ((PartnerAddressAggregateTDSChangePromotionParametersRow)(AChangePromotionParametersDV[Counter3].Row)).LocationKey;
                    }

                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = true;
                }
                else if (AddressAddedOrChangedRow.UserAnswer == "CANCEL")
                {
//                  TLogging.LogAtLevel(9, "CheckPartnerLocationChange: AAddressAddedOrChangedPromotionDT tells me to CANCEL the changing of the PartnerLocation.");
                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = false;
                }
                else
                {
//                  TLogging.LogAtLevel(9, "CheckPartnerLocationChange: AAddressAddedOrChangedPromotionDT holds unexpected UserAnswer: " +
//                        AddressAddedOrChangedRow.UserAnswer + "! Aborting operation!!!");
                    AddressAddedOrChangedRow.AnswerProcessedClientSide = true;
                    AddressAddedOrChangedRow.AcceptChanges();
                    ReturnValue = false;
                }
            }

            return ReturnValue;
        }