コード例 #1
0
    public void MergeRecords(String selectionContextKey)
    {
        Dialog.SetSpecs(-1, -1, 750, 650, "MergeRecords");
        IGroupContextService srv = ApplicationContext.Current.Services.Get <IGroupContextService>() as GroupContextService;
        EntityGroupInfo      currentEntityGroupInfo = srv.GetGroupContext().CurrentGroupInfo;
        ISelectionService    selectionService       = (ISelectionService)SelectionServiceRequest.GetSelectionService();
        ISelectionContext    selectionContext       = selectionService.GetSelectionContext(selectionContextKey);
        IList <string>       list = selectionContext.GetSelectedIds();

        if (list != null)
        {
            MergeArguments mergeArguments = new MergeArguments(list[0], list[1], currentEntityGroupInfo.EntityType, currentEntityGroupInfo.EntityType);
            Dialog.DialogParameters.Add("mergeArguments", mergeArguments);
            Dialog.ShowDialog();
        }
        else
        {
            throw new ValidationException("The selection service does not contain any selected records.");
        }
    }
コード例 #2
0
ファイル: LinkHandler.cs プロジェクト: ssommerfeldt/TAC_EAB
 public void MergeRecords(String selectionContextKey)
 {
     Dialog.SetSpecs(-1, -1, 750, 650, "MergeRecords");
     var srv = ApplicationContext.Current.Services.Get<IGroupContextService>();
     EntityGroupInfo currentEntityGroupInfo = srv.GetGroupContext().CurrentGroupInfo;
     var selectionService = SelectionServiceRequest.GetSelectionService();
     ISelectionContext selectionContext = selectionService.GetSelectionContext(selectionContextKey);
     IList<string> list = selectionContext.GetSelectedIds();
     if (list != null && list.Count == 2)
     {
         MergeArguments mergeArguments = new MergeArguments(list[0], list[1], currentEntityGroupInfo.EntityType, currentEntityGroupInfo.EntityType);
         Dialog.DialogParameters.Remove("mergeArguments");
         Dialog.DialogParameters.Add("mergeArguments", mergeArguments);
         Dialog.ShowDialog();
     }
     else
     {
         throw new ValidationException("The selection service does not contain any selected records.");
     }
 }