Exemplo n.º 1
0
 public void WriteExtended(string key, Int64[, ,] array3D)
 {
     if (writer == null)
         throw new FileEE("無効なストリームです");
     if (array3D == null)
         throw new FileEE("無効な配列が渡されました");
     int countX = 0;
     int length0 = array3D.GetLength(0);
     int length1 = array3D.GetLength(1);
     int length2 = array3D.GetLength(2);
     int[] countY = new int[length0];
     int[,] countZ = new int[length0, length1];
     for (int x = 0; x < length0; x++)
     {
         for (int y = 0; y < length1; y++)
         {
             for (int z = 0; z < length2; z++)
             {
                 if (array3D[x, y, z] != 0)
                 {
                     countX = x + 1;
                     countY[x] = y + 1;
                     countZ[x, y] = z + 1;
                 }
             }
         }
     }
     if (countX == 0)
         return;
     writer.WriteLine(key);
     for (int x = 0; x < countX; x++)
     {
         writer.WriteLine(x.ToString() + "{");
         if (countY[x] == 0)
         {
             writer.WriteLine("}");
             continue;
         }
         for (int y = 0; y < countY[x]; y++)
         {
             StringBuilder builder = new StringBuilder("");
             if (countZ[x, y] == 0)
             {
                 writer.WriteLine("");
                 continue;
             }
             for (int z = 0; z < countZ[x, y]; z++)
             {
                 builder.Append(array3D[x, y, z].ToString());
                 if (z != countZ[x, y] - 1)
                     builder.Append(",");
             }
             writer.WriteLine(builder.ToString());
         }
         writer.WriteLine("}");
     }
     writer.WriteLine(FINISHER);
 }
Exemplo n.º 2
0
 public Boolean runTest()
   {
   Console.Error.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
   int iCountErrors = 0;
   int iCountTestcases = 0;
   String strLoc = "Loc_000oo";
   String strBaseLoc;
   short[] in2Arr = new Int16[10]; 
   int[] in4Arr = new Int32[5]; 
   long[] in8Arr = new Int64[0]; 
   String[] strArr = new String[6]; 
   Boolean[] boArr = new Boolean[3]; 
   Double[] dblArr = new Double[2]; 
   Single[] snglArr = new Single[32000]; 
   Char[] chArr = new Char[10000]; 
   int rank;
   try {
   LABEL_860_GENERAL:
   do
     {
     strLoc = "Loc_819yt";
     rank = -1;
     in2Arr = new Int16[5];
     iCountTestcases++;
     try {
     in2Arr.GetLength(rank);
     iCountErrors++;
     Console.WriteLine( s_strTFAbbrev+ "Err_499ws! , GetLength=="+in2Arr.Length);
     } catch (IndexOutOfRangeException ioorExc) {}
     catch (Exception exc) {
     iCountErrors++;
     Console.WriteLine( s_strTFAbbrev+ "Err_758! exc=="+exc);
     }
     strLoc = "Loc_819ee";
     rank = 1;
     in2Arr = new Int16[5];
     iCountTestcases++;
     try {
     in2Arr.GetLength(rank);
     iCountErrors++;
     Console.WriteLine( s_strTFAbbrev+ "Err_500ws! , GetLength=="+in2Arr.Length);
     } catch (IndexOutOfRangeException ioorExc) {}
     catch (Exception exc) {
     iCountErrors++;
     Console.WriteLine( s_strTFAbbrev+ "Err_750! exc=="+exc);
     }
     strLoc = "Loc_482wu";
     rank = 0;
     in2Arr = new Int16[10];
     iCountTestcases++;
     if(in2Arr.GetLength(rank) != 10)
       {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_481ua! , GetLength=="+in2Arr.Length);
       }
     strLoc = "Loc_471ay";
     in4Arr = new Int32[5];
     iCountTestcases++;
     if(in4Arr.GetLength(rank) != 5)
       {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_29qaq! , GetLength=="+in4Arr.Length);
       }
     strLoc = "Loc_982uq";
     in8Arr = new Int64[0];
     iCountTestcases++;
     if(in8Arr.GetLength(rank) != 0)
       {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_237sy! , GetLength=="+in8Arr.Length);
       }
     strLoc = "Loc_172ms";
     boArr = new Boolean[3];
     iCountTestcases++;
     if(boArr.GetLength(rank) != 3)
       {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_382! , GetLength=="+boArr.Length);
       }
     strLoc = "Loc_49su";
     dblArr = new Double[2];
     iCountTestcases++;
     if(dblArr.GetLength(rank) != 2)
       {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_200su! , GetLength=="+dblArr.Length);
       }
     strLoc = "Loc_371su";
     snglArr = new Single[32000];
     iCountTestcases++;
     if(snglArr.GetLength(rank) != 32000)
       {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_319aw! , GetLength=="+snglArr.Length);
       }
     strLoc = "Loc_129wi";
     strArr = new String[5];
     strArr[2] = null;
     iCountTestcases++;
     if(strArr.GetLength(rank) != 5)
       {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_71ahw! , GetLength=="+strArr.Length);
       }
     } while (false);
   } catch (Exception exc_general ) {
   ++iCountErrors;
   Console.WriteLine(s_strTFAbbrev +" Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general=="+exc_general);
   }
   if ( iCountErrors == 0 ) {   return true; }
   else {  return false;}
   }
        public static bool IsEqual(this Int16[,] a, Int64[][] b, Int64 atol = 0, Double rtol = 0)
        {
    if (a == null && b == null)
        return true;
    if (a == null ^ b == null)
        return false;
    int[] la = a.GetLength(true);
    int[] lb = b.GetLength(true);
    if (la.Length != lb.Length)
        return false;
    for (int i = 0; i < la.Length; i++)
        if (la[i] != lb[i])
            return false;

            if (rtol > 0)
            {
                for (int i = 0; i < b.Length; i++)
                    for (int j = 0; j < b[i].Length; j++)
{
    var A = a[i, j];
    var B = b[i][j];
    if (A == B)
        continue;
    var C = A;
    var D = B;
    var delta = Math.Abs(C - D);
    if (C == 0)
    {
        if (delta <= rtol)
            continue;
    }
    else if (D == 0)
    {
        if (delta <= rtol)
            continue;
    }

    if (delta <= Math.Abs(C) * rtol)
        continue;
    return false;
}

            }
            else if (atol > 0)
            {
                for (int i = 0; i < b.Length; i++)
                    for (int j = 0; j < b[i].Length; j++)
{
    var A = a[i, j];
    var B = b[i][j];
    if (A == B)
        continue;
    var C = A;
    var D = B;
    if (Math.Abs(C - D) <= atol)
        continue;
    return false;
}

            }
            else
            {
                for (int i = 0; i < b.Length; i++)
                    for (int j = 0; j < b[i].Length; j++)
{
    var A = a[i, j];
    var B = b[i][j];
    if (A != B)
        return false;
}

            }

            return true;
        }
Exemplo n.º 4
0
 public void WriteExtended(string key, Int64[,] array2D)
 {
     if (writer == null)
         throw new FileEE("無効なストリームです");
     if (array2D == null)
         throw new FileEE("無効な配列が渡されました");
     int countX = 0;
     int length0 = array2D.GetLength(0);
     int length1 = array2D.GetLength(1);
     int[] countY = new int[length0];
     for (int x = 0; x < length0; x++)
     {
         for (int y = 0; y < length1; y++)
         {
             if (array2D[x, y] != 0)
             {
                 countX = x + 1;
                 countY[x] = y + 1;
             }
         }
     }
     if (countX == 0)
         return;
     writer.WriteLine(key);
     for (int x = 0; x < countX; x++)
     {
         if (countY[x] == 0)
         {
             writer.WriteLine("");
             continue;
         }
         StringBuilder builder = new StringBuilder("");
         for (int y = 0; y < countY[x]; y++)
         {
             builder.Append(array2D[x, y].ToString());
             if (y != countY[x] - 1)
                 builder.Append(",");
         }
         writer.WriteLine(builder.ToString());
     }
     writer.WriteLine(FINISHER);
 }
        public static bool IsEqual(this Decimal[][] a, Int64[][] b, Decimal atol = 0, Decimal rtol = 0)
        {
    if (a == null && b == null)
        return true;
    if (a == null ^ b == null)
        return false;
    int[] la = a.GetLength(true);
    int[] lb = b.GetLength(true);
    if (la.Length != lb.Length)
        return false;
    for (int i = 0; i < la.Length; i++)
        if (la[i] != lb[i])
            return false;

            if (rtol > 0)
            {
                for (int i = 0; i < a.Length; i++)
                    for (int j = 0; j < a[i].Length; j++)
{
    var A = a[i][j];
    var B = b[i][j];
    decimal C = (decimal)A;
    decimal D = (decimal)B;
    if (C == D)
        continue;
    var delta = Math.Abs(C - D);
    if (C == 0)
    {
        if (delta <= rtol)
            continue;
    }
    else if (D == 0)
    {
        if (delta <= rtol)
            continue;
    }

    if (delta <= Math.Abs(C) * rtol)
        continue;
    return false;
}

            }
            else if (atol > 0)
            {
                for (int i = 0; i < a.Length; i++)
                    for (int j = 0; j < a[i].Length; j++)
{
    var A = a[i][j];
    var B = b[i][j];
    decimal C = (decimal)A;
    decimal D = (decimal)B;
    if (C == D)
        continue;
    if (Math.Abs(C - D) <= atol)
        continue;
    return false;
}

            }
            else
            {
                for (int i = 0; i < a.Length; i++)
                    for (int j = 0; j < a[i].Length; j++)
{
    var A = (decimal)a[i][j];
    var B = (decimal)b[i][j];
    if (A != B)
        return false;
}

            }

            return true;
        }
        public static bool IsEqual(this sbyte[,] a, Int64[,] b, Int64 atol = 0, Double rtol = 0)
        {
    if (a == null && b == null)
        return true;
    if (a == null ^ b == null)
        return false;
    int[] la = a.GetLength(true);
    int[] lb = b.GetLength(true);
    if (la.Length != lb.Length)
        return false;
    for (int i = 0; i < la.Length; i++)
        if (la[i] != lb[i])
            return false;

            unsafe
            {
                fixed (sbyte* ptrA = a)
                fixed (Int64* ptrB = b)
                {
                    if (rtol > 0)
                    {
                        for (int i = 0; i < a.Length; i++)
{
    var A = ptrA[i];
    var B = ptrB[i];
    if (A == B)
        continue;
    var C = A;
    var D = B;
    var delta = Math.Abs(C - D);
    if (C == 0)
    {
        if (delta <= rtol)
            continue;
    }
    else if (D == 0)
    {
        if (delta <= rtol)
            continue;
    }

    if (delta <= Math.Abs(C) * rtol)
        continue;
    return false;
}

                    }
                    else if (atol > 0)
                    {
                        for (int i = 0; i < a.Length; i++)
{
    var A = ptrA[i];
    var B = ptrB[i];
    if (A == B)
        continue;
    var C = A;
    var D = B;
    if (Math.Abs(C - D) <= atol)
        continue;
    return false;
}

                    }
                    else
                    {
                        for (int i = 0; i < a.Length; i++)
{
    var A = ptrA[i];
    var B = ptrB[i];
    if (A != B)
        return false;
}

                    }
                }
            }

            return true;
        }
        public static bool IsEqual(this Decimal[,] a, Int64[,] b, Decimal atol = 0, Decimal rtol = 0)
        {
    if (a == null && b == null)
        return true;
    if (a == null ^ b == null)
        return false;
    int[] la = a.GetLength(true);
    int[] lb = b.GetLength(true);
    if (la.Length != lb.Length)
        return false;
    for (int i = 0; i < la.Length; i++)
        if (la[i] != lb[i])
            return false;

            unsafe
            {
                fixed (Decimal* ptrA = a)
                fixed (Int64* ptrB = b)
                {
                    if (rtol > 0)
                    {
                        for (int i = 0; i < a.Length; i++)
{
    var A = ptrA[i];
    var B = ptrB[i];
    decimal C = (decimal)A;
    decimal D = (decimal)B;
    if (C == D)
        continue;
    var delta = Math.Abs(C - D);
    if (C == 0)
    {
        if (delta <= rtol)
            continue;
    }
    else if (D == 0)
    {
        if (delta <= rtol)
            continue;
    }

    if (delta <= Math.Abs(C) * rtol)
        continue;
    return false;
}

                    }
                    else if (atol > 0)
                    {
                        for (int i = 0; i < a.Length; i++)
{
    var A = ptrA[i];
    var B = ptrB[i];
    decimal C = (decimal)A;
    decimal D = (decimal)B;
    if (C == D)
        continue;
    if (Math.Abs(C - D) <= atol)
        continue;
    return false;
}

                    }
                    else
                    {
                        for (int i = 0; i < a.Length; i++)
{
    var A = (decimal)ptrA[i];
    var B = (decimal)ptrB[i];
    if (A != B)
        return false;
}

                    }
                }
            }

            return true;
        }
        public static bool IsEqual(this Single[] a, Int64[] b, Single atol = 0, Double rtol = 0)
        {
    if (a == null && b == null)
        return true;
    if (a == null ^ b == null)
        return false;
    int[] la = a.GetLength(true);
    int[] lb = b.GetLength(true);
    if (la.Length != lb.Length)
        return false;
    for (int i = 0; i < la.Length; i++)
        if (la[i] != lb[i])
            return false;

            if (rtol > 0)
            {
                for (int i = 0; i < a.Length; i++)
{
    var A = a[i];
    var B = b[i];
    if (A == B)
        continue;
    if (Single.IsNaN(A))
        return false;
    if (Single.IsInfinity(A))
        return false;
    var C = A;
    var D = B;
    var delta = Math.Abs(C - D);
    if (C == 0)
    {
        if (delta <= rtol)
            continue;
    }
    else if (D == 0)
    {
        if (delta <= rtol)
            continue;
    }

    if (delta <= Math.Abs(C) * rtol)
        continue;
    return false;
}

            }
            else if (atol > 0)
            {
                for (int i = 0; i < a.Length; i++)
{
    var A = a[i];
    var B = b[i];
    if (A == B)
        continue;
    if (Single.IsNaN(A))
        return false;
    if (Single.IsInfinity(A))
        return false;
    var C = A;
    var D = B;
    if (Math.Abs(C - D) <= atol)
        continue;
    return false;
}

            }
            else
            {
                for (int i = 0; i < a.Length; i++)
{
    var A = a[i];
    var B = b[i];
    if (Single.IsNaN(A))
        return false;
    if (Single.IsInfinity(A))
        return false;
    if (A != B)
        return false;
}

            }

            return true;
        }
Exemplo n.º 9
0
 private void writeData(Int64[, ,] array)
 {
     int countZero = 0;//0については0が連続する数を記憶する。その他はそのまま記憶する。
     int countAllZero = 0;//列の要素が全て0である列の連続する数を記憶する。列の要素に一つでも非0があるなら通常の記憶方式。
     int countAllZero2D = 0;//行列の要素が全て0である行列の・・・
     int length0 = array.GetLength(0);
     int length1 = array.GetLength(1);
     int length2 = array.GetLength(2);
     writer.Write(length0);
     writer.Write(length1);
     writer.Write(length2);
     for(int x = 0; x < length0; x++)
     {
         for(int y = 0; y < length1; y++)
         {
             for(int z = 0; z < length2; z++)
             {
                 if (array[x,y,z] == 0)
                     countZero++;
                 else
                 {
                     if (countAllZero2D > 0)
                     {
                         writer.Write(Ebdb.ZeroA2);
                         this.m_WriteInt(countAllZero2D);
                         countAllZero2D = 0;
                     }
                     if (countAllZero > 0)
                     {
                         writer.Write(Ebdb.ZeroA1);
                         this.m_WriteInt(countAllZero);
                         countAllZero = 0;
                     }
                     if (countZero > 0)
                     {
                         writer.Write(Ebdb.Zero);
                         this.m_WriteInt(countZero);
                         countZero = 0;
                     }
                     this.m_WriteInt(array[x,y,z]);
                 }
             }
             if (countZero == length2)
                 countAllZero++;
             else
                 writer.Write(Ebdb.EoA1);
             countZero = 0;
         }
         if (countAllZero == length1)
             countAllZero2D++;
         else
             writer.Write(Ebdb.EoA2);
         countAllZero = 0;
     }
     writer.Write(Ebdb.EoD);
 }
Exemplo n.º 10
0
        private void writeData(Int64[,] array)
        {
            int countZero = 0;//0については0が連続する数を記憶する。その他はそのまま記憶する。
            int countAllZero = 0;//列の要素が全て0である列の連続する数を記憶する。列の要素に一つでも非0があるなら通常の記憶方式。
            int length0 = array.GetLength(0);
            int length1 = array.GetLength(1);
            writer.Write(length0);
            writer.Write(length1);

            for(int x = 0; x < length0; x++)
            {
                for(int y = 0; y < length1; y++)
                {
                    if (array[x,y] == 0)
                        countZero++;
                    else
                    {
                        if (countAllZero > 0)
                        {
                            writer.Write(Ebdb.ZeroA1);
                            this.m_WriteInt(countAllZero);
                            countAllZero = 0;
                        }
                        if (countZero > 0)
                        {
                            writer.Write(Ebdb.Zero);
                            this.m_WriteInt(countZero);
                            countZero = 0;
                        }
                        this.m_WriteInt(array[x,y]);
                    }
                }
                if (countZero == length1)//列の要素が全部0
                    countAllZero++;
                else
                    writer.Write(Ebdb.EoA1);//非0があるなら列終端記号を記憶
                countZero = 0;
            }
            writer.Write(Ebdb.EoD);
        }
        /// <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;
        }