/// <summary>
        /// todoComment
        /// </summary>
        /// <param name="Row"></param>
        /// <param name="AVerificationResultCollection"></param>
        /// <param name="VerificationResult"></param>
        /// <param name="AErroneousDC"></param>
        /// <param name="FtmpPartnerKeyValid"></param>
        /// <returns></returns>
        public static Boolean VerifySubscriptionDataFinal(PSubscriptionRow Row,
                                                          out TVerificationResultCollection AVerificationResultCollection,
                                                          out TVerificationResult VerificationResult,
                                                          out DataColumn AErroneousDC,
                                                          Boolean FtmpPartnerKeyValid)
        {
            Boolean ReturnValue;
            Boolean Completed;

            //Boolean NoErrors;
            TVerificationResultCollection TmpCollection = null;

            //TVerificationResult TmpError;
            DataColumn            TmpDC;
            DataColumn            NilDataColumn;
            String                mVerifiedString;
            bool                  mPartnerExists;
            TPartnerClass         mPartnerClass;
            TStdPartnerStatusCode partnerStatus;

            TPartnerClass[] mPartnerClassSet;
            Completed                     = false;
            ReturnValue                   = false;
            VerificationResult            = null;
            AVerificationResultCollection = null;
            AErroneousDC                  = null;

            while (!Completed)
            {
                TmpDC = Row.Table.Columns[PSubscriptionTable.GetStartDateDBName()];
                VerifySubscriptionDates(new DataColumnChangeEventArgs(Row, TmpDC,
                                                                      Row[PSubscriptionTable.GetStartDateDBName()]), TmpCollection, out VerificationResult, out NilDataColumn);

                if (VerificationResult != null)
                {
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetExpiryDateDBName()];
                VerifySubscriptionDates(new DataColumnChangeEventArgs(Row, TmpDC,
                                                                      Row[PSubscriptionTable.GetExpiryDateDBName()]), TmpCollection, out VerificationResult, out NilDataColumn);

                if (VerificationResult != null)
                {
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetSubscriptionRenewalDateDBName()];
                VerifySubscriptionDates(new DataColumnChangeEventArgs(Row, TmpDC,
                                                                      Row[PSubscriptionTable.GetSubscriptionRenewalDateDBName()]), TmpCollection, out VerificationResult, out NilDataColumn);

                if (VerificationResult != null)
                {
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetDateNoticeSentDBName()];
                VerifySubscriptionDates(new DataColumnChangeEventArgs(Row, TmpDC,
                                                                      Row[PSubscriptionTable.GetDateNoticeSentDBName()]), TmpCollection, out VerificationResult, out NilDataColumn);

                if (VerificationResult != null)
                {
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetDateCancelledDBName()];
                VerifySubscriptionDates(new DataColumnChangeEventArgs(Row, TmpDC,
                                                                      Row[PSubscriptionTable.GetDateCancelledDBName()]), TmpCollection, out VerificationResult, out NilDataColumn);

                if (VerificationResult != null)
                {
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetFirstIssueDBName()];
                VerifySubscriptionDates(new DataColumnChangeEventArgs(Row, TmpDC,
                                                                      Row[PSubscriptionTable.GetFirstIssueDBName()]), TmpCollection, out VerificationResult, out NilDataColumn);

                if (VerificationResult != null)
                {
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetLastIssueDBName()];
                VerifySubscriptionDates(new DataColumnChangeEventArgs(Row, TmpDC,
                                                                      Row[PSubscriptionTable.GetLastIssueDBName()]), TmpCollection, out VerificationResult, out NilDataColumn);

                if (VerificationResult != null)
                {
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                // if subscription status is cancelled, is there a partner that gives the gift.
                TmpDC = Row.Table.Columns[PSubscriptionTable.GetGiftFromKeyDBName()];

                if (Row.IsSubscriptionStatusNull())
                {
                    // we go no further:
                    VerificationResult = new TVerificationResult("",
                                                                 "Please select a valid subscription status",
                                                                 "Subscription Status Mandatory",
                                                                 "X_0041",
                                                                 TResultSeverity.Resv_Critical);
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;

                    // escape before we crash
                    return(false);
                }

                if (Row.SubscriptionStatus == "GIFT")
                {
                    // validate partner key again, to be sure!
                    mPartnerClassSet    = new TPartnerClass[0];
                    FtmpPartnerKeyValid = TServerLookup.TMPartner.VerifyPartner(Row.GiftFromKey,
                                                                                mPartnerClassSet,
                                                                                out mPartnerExists,
                                                                                out mVerifiedString,
                                                                                out mPartnerClass,
                                                                                out partnerStatus);
                }

                if ((Row.SubscriptionStatus == "GIFT") && ((!FtmpPartnerKeyValid) || (Row.GiftFromKey == 00000000)))
                {
                    // MessageBox.Show('FtmpPartnerKeyValid: ' + FtmpPartnerKeyValid.toString);
                    VerificationResult = new TVerificationResult("",
                                                                 StrGiftGivenByMandatory,
                                                                 StrGiftGivenByMandatoryTitle,
                                                                 "",
                                                                 TResultSeverity.Resv_Critical);
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetReasonSubsCancelledCodeDBName()];

                if ((Row.SubscriptionStatus == "CANCELLED") && (Row.IsReasonSubsCancelledCodeNull()))
                {
                    VerificationResult = new TVerificationResult("",
                                                                 "Please select reason for the cancellation",
                                                                 "Reason for Cancellation Mandatory",
                                                                 "X_0041",
                                                                 TResultSeverity.Resv_Critical);
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }
                else
                {
                    if ((Row.SubscriptionStatus == "CANCELLED") && (Row.ReasonSubsCancelledCode.Length < 2))
                    {
                        VerificationResult = new TVerificationResult("",
                                                                     "Please select reason for the cancellation",
                                                                     "Reason for Cancellation Mandatory",
                                                                     "X_0041",
                                                                     TResultSeverity.Resv_Critical);
                        Completed    = true;
                        ReturnValue  = false;
                        AErroneousDC = TmpDC;
                        break;
                    }
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetReasonSubsCancelledCodeDBName()];

                if ((Row.SubscriptionStatus == "EXPIRED") && (Row.IsReasonSubsCancelledCodeNull()))
                {
                    VerificationResult = new TVerificationResult("",
                                                                 "Please select reason for the cancellation",
                                                                 "Reason for Cancellation Mandatory",
                                                                 "X_0041",
                                                                 TResultSeverity.Resv_Critical);
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }
                else
                {
                    if ((Row.SubscriptionStatus == "EXPIRED") && (Row.ReasonSubsCancelledCode.Length < 2))
                    {
                        VerificationResult = new TVerificationResult("",
                                                                     "Please select reason for the cancellation",
                                                                     "Reason for Cancellation Mandatory",
                                                                     "X_0041",
                                                                     TResultSeverity.Resv_Critical);
                        Completed    = true;
                        ReturnValue  = false;
                        AErroneousDC = TmpDC;
                        break;
                    }
                }

                TmpDC = Row.Table.Columns[PSubscriptionTable.GetReasonSubsGivenCodeDBName()];
                try
                {
                    if (Row.ReasonSubsGivenCode.Length < 2)
                    {
                        VerificationResult = new TVerificationResult("",
                                                                     "Please select reason for the Gift",
                                                                     "Reason for Gift Mandatory",
                                                                     "X_0041",
                                                                     TResultSeverity.Resv_Critical);
                        Completed    = true;
                        ReturnValue  = false;
                        AErroneousDC = TmpDC;
                        break;
                    }
                }
                catch (Exception)
                {
                    VerificationResult = new TVerificationResult("",
                                                                 "Please select reason why the publication is given",
                                                                 "Reason for Gift Mandatory",
                                                                 "X_0041",
                                                                 TResultSeverity.Resv_Critical);
                    Completed    = true;
                    ReturnValue  = false;
                    AErroneousDC = TmpDC;
                    break;
                }
                Completed   = true;
                ReturnValue = true;
            }

            return(ReturnValue);
        }
        /// <summary>
        /// Called by the instantiator of this Dialog to retrieve the values of Fields
        /// on the screen.
        /// </summary>
        /// <param name="ARow"></param>
        /// <param name="AFieldsToChange"></param>
        /// <returns>Boolean</returns>
        public Boolean GetReturnedParameters(ref PSubscriptionRow ARow, ref List <String> AFieldsToChange)
        {
            Boolean ReturnValue = true;

            ARow.InitValues();
            AFieldsToChange.Clear();

            // publication code needs to be set, otherwise change can not be performed
            if (cmbPSubscriptionPublicationCode.GetSelectedString() == "")
            {
                return(false);
            }

            ARow.PublicationCode = cmbPSubscriptionPublicationCode.GetSelectedString();

            if (chkChangeSubscriptionStatus.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetSubscriptionStatusDBName());
                ARow.SubscriptionStatus = cmbPSubscriptionSubscriptionStatus.Text;
            }

            if (chkChangeGratisSubscription.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetGratisSubscriptionDBName());
                ARow.GratisSubscription = chkPSubscriptionGratisSubscription.Checked;
            }

            if (chkChangeNumberComplimentary.Checked &&
                txtPSubscriptionNumberComplimentary.NumberValueInt.HasValue)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetNumberComplimentaryDBName());
                ARow.NumberComplimentary = txtPSubscriptionNumberComplimentary.NumberValueInt.Value;
            }

            if (chkChangePublicationCopies.Checked &&
                txtPSubscriptionPublicationCopies.NumberValueInt.HasValue)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetPublicationCopiesDBName());
                ARow.PublicationCopies = txtPSubscriptionPublicationCopies.NumberValueInt.Value;
            }

            if (chkChangeReasonSubsGivenCode.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetReasonSubsGivenCodeDBName());
                ARow.ReasonSubsGivenCode = cmbPSubscriptionReasonSubsGivenCode.GetSelectedString();
            }

            if (chkChangeReasonSubsCancelledCode.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetReasonSubsCancelledCodeDBName());
                ARow.ReasonSubsCancelledCode = cmbPSubscriptionReasonSubsCancelledCode.GetSelectedString();
            }

            if (chkChangeGiftFromKey.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetGiftFromKeyDBName());
                ARow.GiftFromKey = Convert.ToInt64(txtPSubscriptionGiftFromKey.Text);
            }

            if (chkChangeStartDate.Checked &&
                dtpPSubscriptionStartDate.Date.HasValue)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetStartDateDBName());
                ARow.StartDate = dtpPSubscriptionStartDate.Date.Value;
            }

            if (chkChangeExpiryDate.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetExpiryDateDBName());
                ARow.ExpiryDate = dtpPSubscriptionExpiryDate.Date;
            }

            if (chkChangeRenewalDate.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetSubscriptionRenewalDateDBName());
                ARow.SubscriptionRenewalDate = dtpPSubscriptionSubscriptionRenewalDate.Date;
            }

            if (chkChangeDateNoticeSent.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetDateNoticeSentDBName());
                ARow.DateNoticeSent = dtpPSubscriptionDateNoticeSent.Date;
            }

            if (chkChangeDateCancelled.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetDateCancelledDBName());
                ARow.DateCancelled = dtpPSubscriptionDateCancelled.Date;
            }

            if (chkChangeNumberIssuesReceived.Checked &&
                txtPSubscriptionNumberIssuesReceived.NumberValueInt.HasValue)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetNumberIssuesReceivedDBName());
                ARow.NumberIssuesReceived = txtPSubscriptionNumberIssuesReceived.NumberValueInt.Value;
            }

            if (chkChangeFirstIssue.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetFirstIssueDBName());
                ARow.FirstIssue = dtpPSubscriptionFirstIssue.Date;
            }

            if (chkChangeLastIssue.Checked)
            {
                AFieldsToChange.Add(PSubscriptionTable.GetLastIssueDBName());
                ARow.LastIssue = dtpPSubscriptionLastIssue.Date;
            }

            return(ReturnValue);
        }