aktueller Stand
This commit is contained in:
@@ -506,7 +506,7 @@ namespace FasdDesktopUi
|
|||||||
closeUserSessionTask = cFasdCockpitCommunicationBase.Instance?.CloseUserSession(cFasdCockpitConfig.SessionId).ConfigureAwait(false);
|
closeUserSessionTask = cFasdCockpitCommunicationBase.Instance?.CloseUserSession(cFasdCockpitConfig.SessionId).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
await cFasdCockpitCommunicationBase.Instance.TerminateAsync();
|
await cFasdCockpitCommunicationBase.Instance?.TerminateAsync();
|
||||||
|
|
||||||
if (notifyIcon != null)
|
if (notifyIcon != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
|
|
||||||
private const string CategoryTableNamePrimary = "M42Wpm-Ticket-Categories";
|
private const string CategoryTableNamePrimary = "M42Wpm-Ticket-Categories";
|
||||||
private const string CategoryTableNameLegacy = "M42Wpm-Ticket-CloseCase-Categories";
|
private const string CategoryTableNameLegacy = "M42Wpm-Ticket-CloseCase-Categories";
|
||||||
|
private const string TicketDetailsTableName = "M42Wpm-Tickets";
|
||||||
|
private const string TicketDetailsCategoryIdColumnName = "CategoryId";
|
||||||
private string activeCategoryTableName = CategoryTableNamePrimary;
|
private string activeCategoryTableName = CategoryTableNamePrimary;
|
||||||
|
|
||||||
private static readonly Brush SharedValidationBorderBrush = CreateValidationBrush();
|
private static readonly Brush SharedValidationBorderBrush = CreateValidationBrush();
|
||||||
@@ -240,6 +242,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
EnableHoldTicketAction = statusId != enumTicketStatus.OnHold;
|
EnableHoldTicketAction = statusId != enumTicketStatus.OnHold;
|
||||||
}
|
}
|
||||||
TrySelectTicketCategoryFromTicketInfos();
|
TrySelectTicketCategoryFromTicketInfos();
|
||||||
|
_ = EnsureSelectedTicketCategoryFromDetailsAsync(_selectedTicket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1182,6 +1185,76 @@ namespace FasdDesktopUi.Basics.UserControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ShouldLoadCategoryFromDetails(cF4sdApiSearchResultRelation ticket)
|
||||||
|
{
|
||||||
|
if (ticket == null || ticket == _newTicketRelation || ticket == _selectTicketRelation || ticket == _noTicketRelation)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (ticket.Infos == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!ticket.Infos.TryGetValue(TicketInfoKeys.Category, out var categoryValue) || string.IsNullOrWhiteSpace(categoryValue))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return !Guid.TryParse(categoryValue, out _);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureSelectedTicketCategoryFromDetailsAsync(cF4sdApiSearchResultRelation ticket)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!ShouldLoadCategoryFromDetails(ticket))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var communication = cFasdCockpitCommunicationBase.Instance;
|
||||||
|
if (communication == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var request = new cF4sdHealthCardRawDataRequest
|
||||||
|
{
|
||||||
|
Tables = new List<string> { TicketDetailsTableName },
|
||||||
|
Identities = new cF4sdIdentityList
|
||||||
|
{
|
||||||
|
new cF4sdIdentityEntry { Class = enumFasdInformationClass.Ticket, Id = ticket.id }
|
||||||
|
},
|
||||||
|
MaxAge = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
var rawData = await communication.GetHealthCardData(request).ConfigureAwait(false);
|
||||||
|
if (rawData?.Tables == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!rawData.Tables.TryGetValue(TicketDetailsTableName, out var ticketTable))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!ticketTable.Columns.TryGetValue(TicketDetailsCategoryIdColumnName, out var categoryColumn))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var categoryId = categoryColumn.Values?.FirstOrDefault()?.ToString();
|
||||||
|
if (string.IsNullOrWhiteSpace(categoryId))
|
||||||
|
return;
|
||||||
|
|
||||||
|
await Dispatcher.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
if (SelectedTicket == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!ReferenceEquals(SelectedTicket, ticket) && SelectedTicket.id != ticket.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (SelectedTicket.Infos == null)
|
||||||
|
SelectedTicket.Infos = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
SelectedTicket.Infos[TicketInfoKeys.Category] = categoryId;
|
||||||
|
TrySelectTicketCategoryFromTicketInfos();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Guid? GetSelectedCategoryGuid()
|
private Guid? GetSelectedCategoryGuid()
|
||||||
{
|
{
|
||||||
if (SelectedCategory == null || string.IsNullOrWhiteSpace(SelectedCategory.Id))
|
if (SelectedCategory == null || string.IsNullOrWhiteSpace(SelectedCategory.Id))
|
||||||
|
|||||||
Reference in New Issue
Block a user