diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index b297b3565..0312d6f50 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -275,6 +275,14 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -287,6 +295,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -834,12 +846,21 @@ + + ListboxSelectControl.xaml + + + ValueListEntryEditControl.xaml + NotizenKategorieView.xaml BudgetView.xaml + + IcfImportControl.xaml + FlexibleReportEntryDetail.xaml diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs index 73b949058..4c7ec2377 100644 --- a/BeWo/Core/BeWoUtils.cs +++ b/BeWo/Core/BeWoUtils.cs @@ -52,6 +52,7 @@ using DevExpress.Xpf.Bars; using DevExpress.Xpf.DocumentViewer; using DevExpress.Xpf.Printing.PreviewControl.Bars; using DevExpress.XtraScheduler; +using Control = System.Windows.Controls.Control; using Utils = BS.Shared.Core.Utils; namespace BeWo.Core @@ -104,14 +105,64 @@ namespace BeWo.Core } public static void NavigateToReportUriWithDocumentPreviewControl(string navigateUriString, string title, DocumentPreviewControl dp) - { - BeWoApp.MainControl.StartWaiting(); + { + var reportTemplates = ServiceFacade.DoOperationsServiceSync(x => x.GetReportTemplates(navigateUriString)); - StartGetReportStreamAsync(GetReportStreamForWPFControl, navigateUriString, ms => BeWoApp.MainControl.Dispatch(delegate - { - ShowReportWindow(ms, title, dp); - })); - } + if (reportTemplates?.Count > 1) + { + var control = new ListboxSelectControl(reportTemplates.Cast().ToList()); + + var beWoWindow = new BeWoWindow + { + Height = 200, + Width = 500, + WindowStartupLocation = WindowStartupLocation.CenterOwner, + GroupBoxContent = control, + Owner = BeWoApp.CurrentBeWo.MainWindow, + rootGroupBox = { Header = "Layout speichern" } + }; + + control.CancelButtonClicked += () => beWoWindow.Close(); + control.SelectButtonClicked += () => + { + if (control.SelectedItem == null) return; + + beWoWindow.Close(); + + var selectedTemplate = (ReportTemplateDC)control.SelectedItem; + + var newUri = navigateUriString + "&template=" + (selectedTemplate.Oid.HasValue ? selectedTemplate.Oid.Value.ToString() : "-1"); + + //var start = navigateUriString.IndexOf("type="); + //var end = navigateUriString.IndexOf('&', start); + + //if (end == -1) end = navigateUriString.Length - 1; + + //var typeString = navigateUriString.Substring(start, end - start + 1); + + + //var newUri = navigateUriString.Replace(typeString, "template=" + (selectedTemplate.Oid.HasValue ? selectedTemplate.Oid.Value.ToString() : "-1")); + + BeWoApp.MainControl.StartWaiting(); + + StartGetReportStreamAsync(GetReportStreamForWPFControl, newUri, ms => BeWoApp.MainControl.Dispatch(delegate + { + ShowReportWindow(ms, title, dp); + })); + }; + + beWoWindow.ShowDialog(); + } + else + { + BeWoApp.MainControl.StartWaiting(); + + StartGetReportStreamAsync(GetReportStreamForWPFControl, navigateUriString, ms => BeWoApp.MainControl.Dispatch(delegate + { + ShowReportWindow(ms, title, dp); + })); + } + } public static void CustomizeReportPreviewToolBar(object s, RoutedEventArgs e) { diff --git a/BeWo/Core/SupportConceptGoalTreeItem.cs b/BeWo/Core/SupportConceptGoalTreeItem.cs index d1554c2ec..9bd2ddb80 100644 --- a/BeWo/Core/SupportConceptGoalTreeItem.cs +++ b/BeWo/Core/SupportConceptGoalTreeItem.cs @@ -4,89 +4,44 @@ using BS.Shared; using BeWo.ViewModel; using BS.Shared.DataContracts.ClientPartials; +using BS.Shared.Extensions; namespace BeWo.Core { public class SupportConceptGoalTreeItem : SupportConceptGoalDC { private ValueListEntryVM _GoalEntryVM; - private BindingList _Children; + private bool _ShowNotice; public ValueListEntryVM GoalEntryVM { - get - { - return _GoalEntryVM; - } + get => _GoalEntryVM; + set => _GoalEntryVM = value; + } + public bool IsGoal => GoalEntryVM != null ? + GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType) : + GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType); + + + + public bool ShowNotice + { + get => _ShowNotice; set { - _GoalEntryVM = value; + _ShowNotice = value; + RaisePropertyChanged(nameof(ShowNotice)); } } - public string ItemName + public BindingList Items { - get => _GoalEntryVM != null ? _GoalEntryVM.Description : GoalEntryDC?.TypeDescription; - set - { - if (_GoalEntryVM != null) - { - _GoalEntryVM.Description = value; - } - - if (GoalEntryDC != null) - { - GoalEntryDC.TypeDescription = value; - } - } + get => _Children ?? (_Children = new BindingList()); + set => _Children = value; } - public string Notice - { - get => _GoalEntryVM != null ? _GoalEntryVM.Notice : GoalEntryDC?.Notice; - - set - { - if(_GoalEntryVM != null) - { - _GoalEntryVM.Notice = value; - } - - if(GoalEntryDC != null) - { - GoalEntryDC.Notice = value; - } - } - } - - public bool IsGoal - { - get - { - return GoalEntryVM != null ? - GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType) : - GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType); - } - } - - public BindingList Items - { - get - { - return _Children ?? (_Children = new BindingList()); - } - - set - { - _Children = value; - } - } - - public ValueListEntryType GoalType - { - get { return GoalEntryDC == null ? GoalEntryVM.Type : GoalEntryDC.Type; } - } + public ValueListEntryType GoalType => GoalEntryDC?.Type ?? GoalEntryVM.Type; } } \ No newline at end of file diff --git a/BeWo/MainControl.xaml b/BeWo/MainControl.xaml index 6f343c337..384a0998d 100644 --- a/BeWo/MainControl.xaml +++ b/BeWo/MainControl.xaml @@ -231,7 +231,7 @@ LoadCompactSupportConceptsById(System.Collections.Generic.List pOids); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/LoadContactInformationForCustomer", ReplyAction="http://tempuri.org/ICustomerService/LoadContactInformationForCustomerResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/LoadContactInformationForCustomerBeWoFaultFau" + + "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List LoadContactInformationForCustomer(long customerOid); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetAllActiveCustomers", ReplyAction="http://tempuri.org/ICustomerService/GetAllActiveCustomersResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetAllActiveCustomersBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] System.Collections.Generic.List GetAllActiveCustomers(); @@ -1853,6 +1858,11 @@ namespace BeWo.ServiceProxy return base.Channel.LoadCompactSupportConceptsById(pOids); } + public System.Collections.Generic.List LoadContactInformationForCustomer(long customerOid) + { + return base.Channel.LoadContactInformationForCustomer(customerOid); + } + public System.Collections.Generic.List GetAllActiveCustomers() { return base.Channel.GetAllActiveCustomers(); @@ -4341,6 +4351,14 @@ namespace BeWo.ServiceProxy "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] bool CheckForOverlappingAbsenceTimes(System.DateTime startDate, System.DateTime endDate, System.Nullable employeeOid, System.Nullable customerOid); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetIcf", ReplyAction="http://tempuri.org/IOperationsService/GetIcfResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetIcfBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetIcf(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetReportTemplates", ReplyAction="http://tempuri.org/IOperationsService/GetReportTemplatesResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetReportTemplatesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetReportTemplates(string url); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/InsertNewAdditionalServiceBookings", ReplyAction="http://tempuri.org/IOperationsService/InsertNewAdditionalServiceBookingsResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertNewAdditionalServiceBookingsBeWoFault" + "Fault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] @@ -5295,6 +5313,16 @@ namespace BeWo.ServiceProxy return base.Channel.CheckForOverlappingAbsenceTimes(startDate, endDate, employeeOid, customerOid); } + public System.Collections.Generic.List GetIcf() + { + return base.Channel.GetIcf(); + } + + public System.Collections.Generic.List GetReportTemplates(string url) + { + return base.Channel.GetReportTemplates(url); + } + public System.Collections.Generic.List InsertNewAdditionalServiceBookings(System.Collections.Generic.List pAdditionalServiceBookings) { return base.Channel.InsertNewAdditionalServiceBookings(pAdditionalServiceBookings); diff --git a/BeWo/ServiceProxy/ServiceFacade.cs b/BeWo/ServiceProxy/ServiceFacade.cs index 34e19ed52..1364abe31 100644 --- a/BeWo/ServiceProxy/ServiceFacade.cs +++ b/BeWo/ServiceProxy/ServiceFacade.cs @@ -91,8 +91,14 @@ namespace BeWo.ServiceProxy DoAsync(pFunc, pCallBack, true); } - - public static void DoAccountingServiceSync(Action pAction) + + public static void DoAnalysisServiceAsync(Func pFunc, Action pCallBack, bool showWaitDialog) + { + DoAsync(pFunc, pCallBack, showWaitDialog); + + } + + public static void DoAccountingServiceSync(Action pAction) { pAction.Invoke(GetInstance()); } @@ -483,7 +489,12 @@ namespace BeWo.ServiceProxy DoAsync(pFunc, pCallBack, true); } - public static void DoReportServiceSync(Action pAction) + public static void DoReportServiceAsync(Func pFunc, Action pCallBack, bool showWaitDialog) + { + DoAsync(pFunc, pCallBack, showWaitDialog); + } + + public static void DoReportServiceSync(Action pAction) { try { diff --git a/BeWo/View/Controls/ComboBoxTreeViewControl.xaml b/BeWo/View/Controls/ComboBoxTreeViewControl.xaml index 7cfe9d7ff..fa8e0f430 100644 --- a/BeWo/View/Controls/ComboBoxTreeViewControl.xaml +++ b/BeWo/View/Controls/ComboBoxTreeViewControl.xaml @@ -67,9 +67,9 @@ Click="Bd_OnClick" /> + MouseDown="BdText_OnMouseDown" TextAlignment="Left" ToolTip="{Binding Path=GoalEntryDC.Notice}" /> diff --git a/BeWo/View/Controls/ComboBoxTreeViewControl.xaml.cs b/BeWo/View/Controls/ComboBoxTreeViewControl.xaml.cs index cc0b65c3c..0d40e81a1 100644 --- a/BeWo/View/Controls/ComboBoxTreeViewControl.xaml.cs +++ b/BeWo/View/Controls/ComboBoxTreeViewControl.xaml.cs @@ -47,7 +47,7 @@ namespace BeWo.View.Controls var allSelected = selectedGoals.Count == GoalCount && GoalCount > 0; - var ToolTipString = selectedGoals.Aggregate(string.Empty, (s, dc) => s + (dc.TypeDescription + "; ")); + var ToolTipString = selectedGoals.Aggregate(string.Empty, (s, dc) => s + (dc.DisplayName + "; ")); DeSelectAllCheckBox.IsChecked = allSelected; diff --git a/BeWo/View/Controls/ListboxSelectControl.xaml b/BeWo/View/Controls/ListboxSelectControl.xaml new file mode 100644 index 000000000..2290b72c1 --- /dev/null +++ b/BeWo/View/Controls/ListboxSelectControl.xaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + +