/// <summary>
 /// Handles the ClickAction event of the btnNext control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void btnNext_ClickAction(object sender, EventArgs e)
 {
     if (rdbLinkTo.Checked)
     {
         if (SelectedTargetIndex <= -1)
         {
             throw new ValidationException(GetLocalResourceObject("error_NoAccountSelected").ToString());
         }
         string aId  = grdMatches.DataKeys[SelectedTargetIndex].Values[0].ToString();
         string uuid = grdMatches.DataKeys[SelectedTargetIndex].Values[1].ToString();
         string account;
         if (IntegrationManager.IsTradingAccountLinked(uuid, out account))
         {
             throw new ValidationException(String.Format(GetLocalResourceObject("Error_TradingAccount_Linked").ToString(), account));
         }
         IntegrationManager.TargetId = aId;
         IntegrationManager.SetMergeDataMappings(false);
         if (String.IsNullOrEmpty(IntegrationManager.LinkAccountError))
         {
             string caption = IntegrationManager.DataViewMappings.Count > 0
                                  ? GetLocalResourceObject("MergeRecordsDialog_Differences.Caption").ToString()
                                  : GetLocalResourceObject("MergeRecordsDialog_NoDifferences.Caption").ToString();
             ShowDialog("MergeRecords", caption, 480, 900);
         }
         else
         {
             ShowDialog("LinkResults", GetLocalResourceObject("Dialog.Caption").ToString(), 500, 750);
         }
     }
     else if (rdbCreateNew.Checked)
     {
         IntegrationManager.LinkChildren = false;
         IntegrationManager.LinkTradingAccount(IntegrationManager.SourceAccount.Id.ToString(), true);
         ShowDialog("LinkResults", GetLocalResourceObject("Dialog.Caption").ToString(), 250, 500);
     }
 }