aktueller Stand
This commit is contained in:
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using static C4IT.Logging.cLogManager;
|
||||
@@ -23,7 +24,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
||||
|
||||
public cUiProcessSearchRelationAction(cSearchHistorySearchResultEntry searchHistoryEntry, cF4sdApiSearchResultRelation selectedRelation, IRelationService relationService, ISearchUiProvider searchUiProvider)
|
||||
{
|
||||
Name = $"{searchHistoryEntry.HeaderText} → {selectedRelation.DisplayName}";
|
||||
Name = !string.IsNullOrWhiteSpace(selectedRelation.DisplayName) ? $"{searchHistoryEntry.HeaderText} → {selectedRelation.DisplayName}" : searchHistoryEntry.HeaderText;
|
||||
_selectedSearchResult = searchHistoryEntry.SelectedSearchResult;
|
||||
_relations = searchHistoryEntry.Relations;
|
||||
_selectedRelation = selectedRelation;
|
||||
@@ -32,7 +33,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
||||
_searchHistoryEntry = searchHistoryEntry;
|
||||
}
|
||||
|
||||
public cUiProcessSearchRelationAction(string name, List<cFasdApiSearchResultEntry> selectedSearchResult, List<cF4sdApiSearchResultRelation> relations, cF4sdApiSearchResultRelation selectedRelation, ISearchUiProvider searchUiProvider, cSearchHistoryEntryBase searchHistoryEntry)
|
||||
public cUiProcessSearchRelationAction(string name, List<cFasdApiSearchResultEntry> selectedSearchResult, List<cF4sdApiSearchResultRelation> relations, cF4sdApiSearchResultRelation selectedRelation, ISearchUiProvider searchUiProvider, cSearchHistoryEntryBase searchHistoryEntry, IRelationService relationService)
|
||||
{
|
||||
Name = name;
|
||||
_selectedSearchResult = selectedSearchResult;
|
||||
@@ -40,6 +41,7 @@ namespace FasdDesktopUi.Basics.UiActions
|
||||
_selectedRelation = selectedRelation;
|
||||
_searchUiProvider = searchUiProvider;
|
||||
_searchHistoryEntry = searchHistoryEntry;
|
||||
_relationService = relationService;
|
||||
}
|
||||
|
||||
public override async Task<bool> RunUiActionAsync(object sender, UIElement UiLocation, bool isDetailedLayout, cSupportCaseDataProvider dataProvider)
|
||||
@@ -84,10 +86,15 @@ namespace FasdDesktopUi.Basics.UiActions
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// set the new result menu properies for loading ....
|
||||
_seachHistoryEntry.isSeen = true;
|
||||
// get the new data provider for the support call informations (get it from the cache or create a new one)
|
||||
dataProvider = await cSupportCaseDataProvider.GetDataProviderForAsync(_relations, _selectedRelation, _relationService);
|
||||
dataProvider = await cSupportCaseDataProvider.GetDataProviderForAsync(_selectedRelation, _relationService);
|
||||
|
||||
bool shouldLoadRelationsForSelectedRelation = _selectedRelation.Type == enumF4sdSearchResultClass.User;
|
||||
if (shouldLoadRelationsForSelectedRelation)
|
||||
StartLoadingRelationsFor(_selectedRelation);
|
||||
|
||||
if (dataProvider is null)
|
||||
{
|
||||
@@ -106,5 +113,26 @@ namespace FasdDesktopUi.Basics.UiActions
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void StartLoadingRelationsFor(cF4sdApiSearchResultRelation selectedRelation)
|
||||
{
|
||||
try
|
||||
{
|
||||
var relationsToReload = new List<cFasdApiSearchResultEntry>() { new cFasdApiSearchResultEntry()
|
||||
{
|
||||
DisplayName = selectedRelation.DisplayName,
|
||||
id = selectedRelation.id,
|
||||
Infos = selectedRelation.Infos,
|
||||
Name = selectedRelation.Name,
|
||||
Status = selectedRelation.Status,
|
||||
Type = selectedRelation.Type
|
||||
} };
|
||||
_ = Task.Run(async () => _relationService.LoadRelationsAsync(relationsToReload), CancellationToken.None);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user