aktueller Stand
This commit is contained in:
@@ -584,15 +584,14 @@ namespace FasdDesktopUi.Basics.Services
|
||||
if (source == null)
|
||||
return new DemoTicketDetail();
|
||||
|
||||
return new DemoTicketDetail
|
||||
{
|
||||
AffectedUser = source.AffectedUser,
|
||||
Asset = source.Asset,
|
||||
Category = source.Category,
|
||||
Classification = source.Classification,
|
||||
Description = source.Description,
|
||||
DescriptionHtml = source.DescriptionHtml,
|
||||
Priority = source.Priority,
|
||||
return new DemoTicketDetail
|
||||
{
|
||||
AffectedUser = source.AffectedUser,
|
||||
Asset = source.Asset,
|
||||
Category = source.Category,
|
||||
Description = source.Description,
|
||||
DescriptionHtml = source.DescriptionHtml,
|
||||
Priority = source.Priority,
|
||||
Solution = source.Solution,
|
||||
SolutionHtml = source.SolutionHtml,
|
||||
Journal = source.Journal?.Select(entry => new DemoTicketJournalEntry
|
||||
|
||||
@@ -1209,8 +1209,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
if (quickCallsTable == null) return;
|
||||
|
||||
if (!quickCallsTable.Columns.TryGetValue("Name", out var namesColumn) ||
|
||||
!quickCallsTable.Columns.TryGetValue("id", out var idsColumn) ||
|
||||
!quickCallsTable.Columns.TryGetValue("Classification", out var classificationColumn))
|
||||
!quickCallsTable.Columns.TryGetValue("id", out var idsColumn))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1222,17 +1221,10 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
var id = idsColumn.Values[i].ToString();
|
||||
var name = namesColumn.Values[i].ToString();
|
||||
|
||||
Guid? classification = null;
|
||||
var classificationValue = classificationColumn.Values[i]?.ToString();
|
||||
if (Guid.TryParse(classificationValue, out var parsedClassification))
|
||||
classification = parsedClassification;
|
||||
|
||||
|
||||
quickCallListe.Add(new QuickCallEntry
|
||||
{
|
||||
ID = id,
|
||||
DisplayName = name,
|
||||
Classification = classification
|
||||
DisplayName = name
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1252,7 +1244,6 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public Guid? Classification { get; set; }
|
||||
public override string ToString()
|
||||
{
|
||||
return DisplayName.ToString();
|
||||
@@ -1622,17 +1613,11 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
["Priority"] = 2,
|
||||
};
|
||||
Guid quickcallId = Guid.Empty;
|
||||
Guid? quickCallClassificationId = null;
|
||||
if (QuickTicketSelection.SelectedItem is QuickCallEntry selectedQuickTicketItem)
|
||||
{
|
||||
//ticketValues.Add("Category", selectedQuickTicketItem.DisplayName);
|
||||
ticketValues.Add("QuickCallId", selectedQuickTicketItem.ID);
|
||||
Guid.TryParse(selectedQuickTicketItem.ID?.ToString(), out quickcallId);
|
||||
if (selectedQuickTicketItem.Classification.HasValue)
|
||||
{
|
||||
quickCallClassificationId = selectedQuickTicketItem.Classification;
|
||||
ticketValues["Classification"] = quickCallClassificationId.Value;
|
||||
}
|
||||
}
|
||||
var selectedCategoryId = GetSelectedCategoryGuid();
|
||||
if (selectedCategoryId.HasValue)
|
||||
@@ -1901,7 +1886,6 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
Summary = TicketSummaryTextBox.Text,
|
||||
DescriptionHtml = htmlCaseNotes.ToString(),
|
||||
Quickcall = quickcallId,
|
||||
Classification = quickCallClassificationId,
|
||||
CopyTemplates = string.IsNullOrWhiteSpace(copyStringHtml) ? copyString : copyStringHtml,
|
||||
SolutionHtml = solutionHtmlString,
|
||||
ErrorType = errorType,
|
||||
|
||||
@@ -169,8 +169,28 @@
|
||||
<StackPanel x:Name="TicketSelectionContainer" />
|
||||
</Border>
|
||||
</Popup>
|
||||
</StackPanel>
|
||||
<StackPanel x:Name="MainStack">
|
||||
</StackPanel>
|
||||
<StackPanel x:Name="MainStack">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Template}"
|
||||
Style="{StaticResource MandatoryFieldLabelStyle}" />
|
||||
|
||||
<Border x:Name="QuickTicketValidationBorder"
|
||||
Style="{StaticResource MandatoryFieldBorderStyle}">
|
||||
<ComboBox x:Name="QuickTicketSelection"
|
||||
Background="{Binding Background, RelativeSource={RelativeSource AncestorType=Border}}"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="0"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="QuickTicketSelection_SelectionChanged"
|
||||
PreviewKeyDown="Combobox_PreviewKeyDown"
|
||||
DropDownOpened="DropDownOpened"
|
||||
DropDownClosed="DropDownClosed"
|
||||
AutomationProperties.IsRequiredForForm="True"
|
||||
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorQuickCallEmpty}">
|
||||
</ComboBox>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<StackPanel x:Name="CategoryLabelPanel">
|
||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Category}"
|
||||
Style="{StaticResource MandatoryFieldLabelStyle}" />
|
||||
@@ -189,26 +209,6 @@
|
||||
AutomationProperties.IsRequiredForForm="True"
|
||||
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorCategoryEmpty}" />
|
||||
</Border>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.Template}"
|
||||
Style="{StaticResource MandatoryFieldLabelStyle}" />
|
||||
|
||||
<Border x:Name="QuickTicketValidationBorder"
|
||||
Style="{StaticResource MandatoryFieldBorderStyle}">
|
||||
<ComboBox x:Name="QuickTicketSelection"
|
||||
Background="{Binding Background, RelativeSource={RelativeSource AncestorType=Border}}"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="0"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="QuickTicketSelection_SelectionChanged"
|
||||
PreviewKeyDown="Combobox_PreviewKeyDown"
|
||||
DropDownOpened="DropDownOpened"
|
||||
DropDownClosed="DropDownClosed"
|
||||
AutomationProperties.IsRequiredForForm="True"
|
||||
AutomationProperties.HelpText="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.ValidationErrorQuickCallEmpty}">
|
||||
</ComboBox>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock x:Name="SetOrUpdateComputerInTicketLabel"
|
||||
Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=Dialog.CloseCase.SetAffectedAssetLabel}"
|
||||
|
||||
@@ -1282,12 +1282,13 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
if (quickCallsTable == null) return;
|
||||
|
||||
if (!quickCallsTable.Columns.TryGetValue("Name", out var namesColumn) ||
|
||||
!quickCallsTable.Columns.TryGetValue("id", out var idsColumn) ||
|
||||
!quickCallsTable.Columns.TryGetValue("Classification", out var classificationColumn))
|
||||
!quickCallsTable.Columns.TryGetValue("id", out var idsColumn))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
quickCallsTable.Columns.TryGetValue("Category", out var categoryColumn);
|
||||
|
||||
var quickCallListe = new List<QuickCallEntry>();
|
||||
|
||||
for (int i = 0; i < idsColumn.Values.Count; i++)
|
||||
@@ -1295,17 +1296,19 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
var id = idsColumn.Values[i].ToString();
|
||||
var name = namesColumn.Values[i].ToString();
|
||||
|
||||
Guid? classification = null;
|
||||
var classificationValue = classificationColumn.Values[i]?.ToString();
|
||||
if (Guid.TryParse(classificationValue, out var parsedClassification))
|
||||
classification = parsedClassification;
|
||||
|
||||
Guid? categoryId = null;
|
||||
if (categoryColumn?.Values != null && i < categoryColumn.Values.Count)
|
||||
{
|
||||
var categoryValue = categoryColumn.Values[i]?.ToString();
|
||||
if (Guid.TryParse(categoryValue, out var parsedCategory))
|
||||
categoryId = parsedCategory;
|
||||
}
|
||||
|
||||
quickCallListe.Add(new QuickCallEntry
|
||||
{
|
||||
ID = id,
|
||||
DisplayName = name,
|
||||
Classification = classification
|
||||
CategoryId = categoryId
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1314,6 +1317,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
QuickTicketSelection.SelectedItem = quickCallListe
|
||||
.FirstOrDefault(x => x.ID == "7bbe64e2-94d0-ee11-4285-00155d010a04");
|
||||
ValidateProperty(ValidationPropertyNames.QuickTicketSelection);
|
||||
ApplyQuickCallCategorySelection();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1325,13 +1329,47 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public Guid? Classification { get; set; }
|
||||
public Guid? CategoryId { get; set; }
|
||||
public override string ToString()
|
||||
{
|
||||
return DisplayName.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyQuickCallCategorySelection()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!NewTicketPillSelected)
|
||||
return;
|
||||
|
||||
if (!(QuickTicketSelection?.SelectedItem is QuickCallEntry quickCall))
|
||||
return;
|
||||
|
||||
if (!quickCall.CategoryId.HasValue || quickCall.CategoryId.Value == Guid.Empty)
|
||||
return;
|
||||
|
||||
var targetTicket = SelectedTicket ?? _selectTicketRelation;
|
||||
if (targetTicket.Infos == null)
|
||||
targetTicket.Infos = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
targetTicket.Infos[TicketInfoKeys.Category] = quickCall.CategoryId.Value.ToString();
|
||||
|
||||
if (ReferenceEquals(targetTicket, SelectedTicket))
|
||||
{
|
||||
TrySelectTicketCategoryFromTicketInfos();
|
||||
}
|
||||
else if (SelectedTicket == null && ReferenceEquals(targetTicket, _selectTicketRelation))
|
||||
{
|
||||
SelectedTicket = targetTicket;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void UpdateTicketSelection()
|
||||
{
|
||||
@@ -1467,6 +1505,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
if (selectionPill.IsSelected)
|
||||
{
|
||||
SelectedTicket = _selectTicketRelation;
|
||||
ApplyQuickCallCategorySelection();
|
||||
}
|
||||
ValidateProperty(ValidationPropertyNames.SelectedTicket);
|
||||
ValidateProperty(ValidationPropertyNames.TicketSummaryTextBox);
|
||||
@@ -1695,17 +1734,11 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
["Priority"] = 2,
|
||||
};
|
||||
Guid quickcallId = Guid.Empty;
|
||||
Guid? quickCallClassificationId = null;
|
||||
if (QuickTicketSelection.SelectedItem is QuickCallEntry selectedQuickTicketItem)
|
||||
{
|
||||
//ticketValues.Add("Category", selectedQuickTicketItem.DisplayName);
|
||||
ticketValues.Add("QuickCallId", selectedQuickTicketItem.ID);
|
||||
Guid.TryParse(selectedQuickTicketItem.ID?.ToString(), out quickcallId);
|
||||
if (selectedQuickTicketItem.Classification.HasValue)
|
||||
{
|
||||
quickCallClassificationId = selectedQuickTicketItem.Classification;
|
||||
ticketValues["Classification"] = quickCallClassificationId.Value;
|
||||
}
|
||||
}
|
||||
var selectedCategoryId = GetSelectedCategoryGuid();
|
||||
if (selectedCategoryId.HasValue)
|
||||
@@ -1974,7 +2007,6 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
Summary = TicketSummaryTextBox.Text,
|
||||
DescriptionHtml = htmlCaseNotes.ToString(),
|
||||
Quickcall = quickcallId,
|
||||
Classification = quickCallClassificationId,
|
||||
CopyTemplates = string.IsNullOrWhiteSpace(copyStringHtml) ? copyString : copyStringHtml,
|
||||
SolutionHtml = solutionHtmlString,
|
||||
ErrorType = errorType,
|
||||
@@ -2727,6 +2759,7 @@ namespace FasdDesktopUi.Basics.UserControls
|
||||
private void QuickTicketSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
ValidateProperty(ValidationPropertyNames.QuickTicketSelection);
|
||||
ApplyQuickCallCategorySelection();
|
||||
}
|
||||
|
||||
private void TransferCaseNotesCheck_Unchecked(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -13,9 +13,9 @@ using static C4IT.Logging.cLogManager;
|
||||
|
||||
namespace FasdDesktopUi.Pages.TicketCompletion
|
||||
{
|
||||
public partial class TicketCompletion : Window, IBlurInvoker, INotifyPropertyChanged
|
||||
{
|
||||
private bool isCanceled = false;
|
||||
public partial class TicketCompletion : Window, IBlurInvoker, INotifyPropertyChanged
|
||||
{
|
||||
private bool isCanceled = false;
|
||||
|
||||
private bool _WaitForClosing = false;
|
||||
public bool WaitForClosing
|
||||
@@ -101,20 +101,32 @@ namespace FasdDesktopUi.Pages.TicketCompletion
|
||||
return null;
|
||||
}
|
||||
|
||||
#region Close_Click
|
||||
#region Close_Click
|
||||
|
||||
private void Close_Click()
|
||||
{
|
||||
isCanceled = true;
|
||||
TrySetDialogResult(null);
|
||||
Close();
|
||||
}
|
||||
|
||||
private void Close_Click()
|
||||
{
|
||||
DialogResult = null;
|
||||
isCanceled = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, InputEventArgs e) => Close_Click();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Focus Events
|
||||
private void CloseButton_Click(object sender, InputEventArgs e) => Close_Click();
|
||||
|
||||
#endregion
|
||||
|
||||
private void TrySetDialogResult(bool? result)
|
||||
{
|
||||
try
|
||||
{
|
||||
DialogResult = result;
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// Window was not shown as dialog; ignore.
|
||||
}
|
||||
}
|
||||
|
||||
#region Internal Focus Events
|
||||
|
||||
private void ElementGotFocus(object sender, EventArgs e)
|
||||
{
|
||||
@@ -200,15 +212,15 @@ namespace FasdDesktopUi.Pages.TicketCompletion
|
||||
|
||||
bool closedSuccessfull = await CloseCaseDialogUc.CloseCaseAsync(_dataProvider.Identities.FirstOrDefault(identity => identity.Class == enumFasdInformationClass.User).Id);
|
||||
|
||||
if (closedSuccessfull)
|
||||
{
|
||||
SuccessPage.SuccessPage successPage = new SuccessPage.SuccessPage();
|
||||
successPage.Show();
|
||||
await _dataProvider?.CloseCaseAsync();
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
if (closedSuccessfull)
|
||||
{
|
||||
SuccessPage.SuccessPage successPage = new SuccessPage.SuccessPage();
|
||||
successPage.Show();
|
||||
await _dataProvider?.CloseCaseAsync();
|
||||
TrySetDialogResult(true);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
|
||||
Reference in New Issue
Block a user