Exemple #1
0
 /// <summary>
 /// Handles the Click event of the Link button.
 /// </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 btnLink_Click(object sender, EventArgs e)
 {
     if (_mergeContactsStateInfo.SelectedRowTargetIndex != null &&
         _mergeContactsStateInfo.SelectedRowSourceIndex != null)
     {
         IntegrationManager.MatchingInfoAddMatchedChildPair(_mergeContactsStateInfo.SelectedSourceId,
                                                            _mergeContactsStateInfo.SelectedTargetId);
         IList <ComponentView> matchedContacts = IntegrationManager.MatchedContacts;
         string[] propertyNames = new[]
         {
             "sourceId", "targetId", "firstName", "lastName"
         };
         object[] propertyValues = new[]
         {
             _mergeContactsStateInfo.SelectedSourceId,
             _mergeContactsStateInfo.SelectedTargetId,
             _mergeContactsStateInfo.FirstName,
             _mergeContactsStateInfo.LastName
         };
         ComponentView view = new ComponentView(propertyNames, propertyValues);
         matchedContacts.Add(view);
         IntegrationManager.SourceContacts.RemoveAt((int)_mergeContactsStateInfo.SelectedRowSourceIndex);
         IntegrationManager.TargetContacts.RemoveAt((int)_mergeContactsStateInfo.SelectedRowTargetIndex);
     }
     else
     {
         throw new ApplicationException(GetLocalResourceObject("Error_SourceTargetNotSelected").ToString());
     }
 }
 /// <summary>
 /// Handles the Click event of the Link button.
 /// </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 btnLink_Click(object sender, EventArgs e)
 {
     if (_mergeContactsStateInfo.SelectedRowTargetIndex == null || _mergeContactsStateInfo.SelectedRowSourceIndex == null)
     {
         throw new ValidationException(GetLocalResourceObject("Error_SourceTargetNotSelected").ToString());
     }
     if (_loadResults && DialogService.DialogParameters.ContainsKey("mergeArguments"))
     {
         SessionMergeArguments.MatchingRecordView.MatchedContacts.Add(GetMatchedContact());
         SessionMergeArguments.MatchingRecordView.SourceContacts.RemoveAt((int)_mergeContactsStateInfo.SelectedRowSourceIndex);
         SessionMergeArguments.MatchingRecordView.TargetContacts.RemoveAt((int)_mergeContactsStateInfo.SelectedRowTargetIndex);
     }
     else
     {
         IntegrationManager.MatchingInfoAddMatchedChildPair(_mergeContactsStateInfo.SelectedSourceId, _mergeContactsStateInfo.SelectedTargetId);
         IList <ComponentView> matchedContacts = IntegrationManager.MatchedContacts;
         matchedContacts.Add(GetMatchedContact());
         IntegrationManager.SourceContacts.RemoveAt((int)_mergeContactsStateInfo.SelectedRowSourceIndex);
         IntegrationManager.TargetContacts.RemoveAt((int)_mergeContactsStateInfo.SelectedRowTargetIndex);
     }
 }