From 98363ea8906e4d723792b22f459a45116d4e0d9b Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 30 Sep 2020 10:00:31 +0200 Subject: [PATCH] Dienstplaner, Abwesenheiten, Drucken --- BeWo/BeWo.csproj | 54 +- BeWo/BeWoApp.xaml.cs | 5 +- BeWo/Core/BeWoUtils.cs | 3 +- BeWo/ServiceProxy/Generated.cs | 126 ++- BeWo/ServiceProxy/ServiceFacade.cs | 16 +- BeWo/View/Controls/DPCtrlDay.cs | 127 +++ BeWo/View/Controls/DPCtrlDienstTooltip.xaml | 27 + .../View/Controls/DPCtrlDienstTooltip.xaml.cs | 29 + BeWo/View/Controls/DPCtrlEmployee.cs | 127 +++ .../DPCtrlEmployeeContractTooltip.xaml | 21 + .../DPCtrlEmployeeContractTooltip.xaml.cs | 39 + BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml | 14 + .../Controls/DPCtrlEmployeeTooltip.xaml.cs | 77 ++ BeWo/View/Controls/DPCtrlIcon.cs | 68 ++ BeWo/View/Controls/DPCtrlWeek.cs | 66 ++ BeWo/View/Controls/DienstplanerControl.xaml | 7 + .../View/Controls/DienstplanerControl.xaml.cs | 50 + BeWo/View/Controls/MonthPicker.xaml | 8 + BeWo/View/Controls/MonthPicker.xaml.cs | 39 + BeWo/View/Detail/DienstView.xaml.cs | 12 +- .../Report/AbwesenheitsPrintControl.xaml | 29 + .../Report/AbwesenheitsPrintControl.xaml.cs | 57 + .../Report/AbwesenheitstabelleView.xaml | 321 +++--- .../Report/AbwesenheitstabelleView.xaml.cs | 176 ++-- BeWo/View/Detail/Report/Dienstplaner.xaml | 43 - BeWo/View/Detail/Report/Dienstplaner.xaml.cs | 49 - BeWo/View/Detail/Report/DienstplanerView.xaml | 128 +++ .../Detail/Report/DienstplanerView.xaml.cs | 513 +++++++++ BeWo/View/Master/ReportView.xaml.cs | 2 +- .../Employee/EmployeeHourReportView.xaml | 48 +- .../{DienstVM.cs => DienstInfoVM.cs} | 29 +- BeWo/ViewModel/ListViewModel/DienstListVM.cs | 4 +- BeWo/ViewModel/VMFactory.cs | 4 +- Data/Data.csproj | 8 +- Data/Entities/DienstEintrag.cs | 99 ++ Data/Entities/{Dienst.cs => DienstInfo.cs} | 6 +- Data/Entities/Employee.cs | 8 +- Data/Mappings/DienstEintrag.hbm.xml | 24 + .../{Dienst.hbm.xml => DienstInfo.hbm.xml} | 2 +- Host/ReportView.aspx.cs | 34 +- ...20_02_26 Dienst zu DienstInfo geändert.txt | 2 + ..._2020_02_26 Diensteinträge hinzugefügt.txt | 18 + Report/AbstractReportCreator.cs | 2 + Report/DefaultReportCreator.cs | 929 +++++++++-------- .../DefaultReports/AbsenceReport.Designer.cs | 974 ++++++++++++++++++ Report/DefaultReports/AbsenceReport.cs | 45 + Report/DefaultReports/AbsenceReport.resx | 123 +++ .../DefaultReports/RosterReport.Designer.cs | 207 ++++ Report/DefaultReports/RosterReport.cs | 193 ++++ Report/DefaultReports/RosterReport.resx | 123 +++ Report/Report.csproj | 22 + Report/ReportObjects/AbsenceRO.cs | 162 +++ Report/ReportObjects/RosterRO.cs | 173 ++++ .../DienstEintragDC_DienstEintrag.cs | 50 + ...C_Dienst.cs => DienstInfoDC_DienstInfo.cs} | 22 +- Service/DCEntityMapper/MapperFactory.cs | 11 +- .../Plugins/SchulbegleitenderDienstService.cs | 2 +- Service/Plugins/VacationService.cs | 7 + Service/Service.csproj | 3 +- .../ServiceContracts/IOperationsService.cs | 44 +- .../OperationsServiceImp.cs | 289 +++++- Shared/BeWoEntityEnums.cs | 3 +- Shared/DataContracts/AbsenceTimeDC.cs | 4 +- Shared/DataContracts/DienstBlockDC.cs | 25 + .../{DienstDC.cs => DienstEintragDC.cs} | 32 +- Shared/DataContracts/DienstInfoDC.cs | 66 ++ Shared/DataContracts/EmployeeDC.cs | 9 +- Shared/DataContracts/ReportTypes.cs | 4 +- Shared/Extensions/ColorExtensions.cs | 84 +- Shared/Shared.csproj | 4 +- 70 files changed, 5184 insertions(+), 947 deletions(-) create mode 100644 BeWo/View/Controls/DPCtrlDay.cs create mode 100644 BeWo/View/Controls/DPCtrlDienstTooltip.xaml create mode 100644 BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs create mode 100644 BeWo/View/Controls/DPCtrlEmployee.cs create mode 100644 BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml create mode 100644 BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml.cs create mode 100644 BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml create mode 100644 BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml.cs create mode 100644 BeWo/View/Controls/DPCtrlIcon.cs create mode 100644 BeWo/View/Controls/DPCtrlWeek.cs create mode 100644 BeWo/View/Controls/DienstplanerControl.xaml create mode 100644 BeWo/View/Controls/DienstplanerControl.xaml.cs create mode 100644 BeWo/View/Controls/MonthPicker.xaml create mode 100644 BeWo/View/Controls/MonthPicker.xaml.cs create mode 100644 BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml create mode 100644 BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs delete mode 100644 BeWo/View/Detail/Report/Dienstplaner.xaml delete mode 100644 BeWo/View/Detail/Report/Dienstplaner.xaml.cs create mode 100644 BeWo/View/Detail/Report/DienstplanerView.xaml create mode 100644 BeWo/View/Detail/Report/DienstplanerView.xaml.cs rename BeWo/ViewModel/{DienstVM.cs => DienstInfoVM.cs} (87%) create mode 100644 Data/Entities/DienstEintrag.cs rename Data/Entities/{Dienst.cs => DienstInfo.cs} (95%) create mode 100644 Data/Mappings/DienstEintrag.hbm.xml rename Data/Mappings/{Dienst.hbm.xml => DienstInfo.hbm.xml} (96%) create mode 100644 Model/Changes_2020_02_26 Dienst zu DienstInfo geändert.txt create mode 100644 Model/Changes_2020_02_26 Diensteinträge hinzugefügt.txt create mode 100644 Report/DefaultReports/AbsenceReport.Designer.cs create mode 100644 Report/DefaultReports/AbsenceReport.cs create mode 100644 Report/DefaultReports/AbsenceReport.resx create mode 100644 Report/DefaultReports/RosterReport.Designer.cs create mode 100644 Report/DefaultReports/RosterReport.cs create mode 100644 Report/DefaultReports/RosterReport.resx create mode 100644 Report/ReportObjects/AbsenceRO.cs create mode 100644 Report/ReportObjects/RosterRO.cs create mode 100644 Service/DCEntityMapper/DienstEintragDC_DienstEintrag.cs rename Service/DCEntityMapper/{DienstDC_Dienst.cs => DienstInfoDC_DienstInfo.cs} (56%) create mode 100644 Shared/DataContracts/DienstBlockDC.cs rename Shared/DataContracts/{DienstDC.cs => DienstEintragDC.cs} (50%) create mode 100644 Shared/DataContracts/DienstInfoDC.cs diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 6e73c6a16..c7846157b 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -276,6 +276,26 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -308,7 +328,7 @@ MSBuild:Compile Designer - + MSBuild:Compile Designer @@ -324,6 +344,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -800,7 +824,7 @@ - + @@ -884,6 +908,25 @@ + + DPCtrlEmployeeContractTooltip.xaml + + + DPCtrlEmployeeTooltip.xaml + + + DPCtrlDienstTooltip.xaml + + + MonthPicker.xaml + + + DienstplanerControl.xaml + + + + + GoalRatingControl.xaml @@ -905,8 +948,8 @@ AbsenceTimesView.xaml - - Dienstplaner.xaml + + DienstplanerView.xaml AbwesenheitstabelleView.xaml @@ -914,6 +957,9 @@ AbwesenheitsEditView.xaml + + AbwesenheitsPrintControl.xaml + IcfImportControl.xaml diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 15e0ede6a..06bf49365 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -709,8 +709,9 @@ namespace BeWo Dispatcher.UnhandledException += (s, ex) => { - if (ex.Exception == null || String.IsNullOrEmpty(ex.Exception.Message) || !ex.Exception.ToString().Contains("DevExpress.Xpf.Bars.Customization.CustomizationControl.OnLoaded")) - { + if (ex.Exception == null || String.IsNullOrEmpty(ex.Exception.Message) || !ex.Exception.ToString().Contains("DevExpress.Xpf.Bars.Customization.CustomizationControl.OnLoaded") || !ex.Exception.ToString().Contains("DevExpress.Xpf.Grid.Native.SelectionStrategyCellBase.IsCellSelected")) + + { ShowError(null, ex.Exception, true); } ex.Handled = true; diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs index 9388ca180..08f01ac0d 100644 --- a/BeWo/Core/BeWoUtils.cs +++ b/BeWo/Core/BeWoUtils.cs @@ -54,6 +54,7 @@ using DevExpress.Xpf.Printing.PreviewControl.Bars; using DevExpress.XtraScheduler; using Control = System.Windows.Controls.Control; using Utils = BS.Shared.Core.Utils; +using Brush = System.Windows.Media.Brush; namespace BeWo.Core { @@ -2151,6 +2152,6 @@ namespace BeWo.Core var storage = pAppointment.GetCustomFieldStorage(); return Utils.CheckSchedulerRights(storage.CustomerList, storage.ResourceList, storage.EmployeeList.ToList(), storage.Originator, pIsNew, pCheckType, BeWoApp.LoggedOnUser); - } + } } } diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index 30e5787ab..8fb67e6a9 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -1492,7 +1492,12 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Employee2SchedulerAppointmentDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisRootDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisEmployeeDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisSupportConceptDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Tuple, System.Collections.Generic.List>))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.FlexibleReportFilterDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.FlexibleReportResultDC))] @@ -1507,8 +1512,11 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ReportTemplateDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ReportTypes))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.DienstDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.DienstInfoDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.DienstBlockDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.DienstEintragDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BargeldkassenDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -1594,6 +1602,8 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.ServiceRecordValidationResult))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.UiElementType))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List>))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] @@ -1602,11 +1612,7 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary>))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisRootDC))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisEmployeeDC))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] - [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisSupportConceptDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AccountingReportDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -4677,9 +4683,25 @@ namespace BeWo.ServiceProxy [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/GetAbsenceTimeDCsFilter", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeDCsFilterResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCsFilterBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - System.Collections.Generic.List GetAbsenceTimeDCsFilter(System.DateTime start, System.DateTime end); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee11", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee11Response")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee11BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee11(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee21", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee21Response")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee21BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee21(System.Collections.Generic.List absenceReasons, System.Collections.Generic.List employmentTypes); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee31", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee31Response")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee31BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee31(System.DateTime start, System.DateTime end); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee41", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee41Response")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee41BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee41(System.DateTime start, System.DateTime end, System.Collections.Generic.List absenceReasons, System.Collections.Generic.List employmentTypes); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee51", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee51Response")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee51BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee51(System.DateTime start, System.DateTime end, System.Collections.Generic.List absenceReasonIDs, System.Collections.Generic.List employmentTypeIDs); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAllAbsenceReason", ReplyAction="http://tempuri.org/IOperationsService/GetAllAbsenceReasonResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAllAbsenceReasonBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] @@ -4699,11 +4721,11 @@ namespace BeWo.ServiceProxy [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAllDienste", ReplyAction="http://tempuri.org/IOperationsService/GetAllDiensteResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAllDiensteBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - System.Collections.Generic.List GetAllDienste(); + System.Collections.Generic.List GetAllDienste(); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/InsertNewDienst", ReplyAction="http://tempuri.org/IOperationsService/InsertNewDienstResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertNewDienstBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - void InsertNewDienst(System.Collections.Generic.List dienst); + void InsertNewDienst(System.Collections.Generic.List dienst); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeactivateDienst", ReplyAction="http://tempuri.org/IOperationsService/DeactivateDienstResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeactivateDienstBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] @@ -4711,7 +4733,28 @@ namespace BeWo.ServiceProxy [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateDienst", ReplyAction="http://tempuri.org/IOperationsService/UpdateDienstResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateDienstBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - void UpdateDienst(System.Collections.Generic.List dienste); + void UpdateDienst(System.Collections.Generic.List dienste); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetDienstEintraege", ReplyAction="http://tempuri.org/IOperationsService/GetDienstEintraegeResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetDienstEintraegeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetDienstEintraege(long wOid, int year, int month); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/InsertNewDienstEintrag", ReplyAction="http://tempuri.org/IOperationsService/InsertNewDienstEintragResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertNewDienstEintragBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + void InsertNewDienstEintrag(BS.Shared.DataContracts.DienstEintragDC dienstEintrag); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateDienstEintrag", ReplyAction="http://tempuri.org/IOperationsService/UpdateDienstEintragResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateDienstEintragBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + void UpdateDienstEintrag(BS.Shared.DataContracts.DienstEintragDC dienstEintrag); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeleteDienstEintrag", ReplyAction="http://tempuri.org/IOperationsService/DeleteDienstEintragResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteDienstEintragBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + void DeleteDienstEintrag(long empId, long wohnId, int Zeile, System.DateTime date); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeVacationByWohnheim", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeVacationByWohnheimResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeVacationByWohnheimBeWoFaultFa" + + "ult", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetAbsenceTimeVacationByWohnheim(long wohnId, int year, int month); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCResponse" + "")] @@ -5658,9 +5701,29 @@ namespace BeWo.ServiceProxy return base.Channel.GetReportTemplates(url); } - public System.Collections.Generic.List GetAbsenceTimeDCsFilter(System.DateTime start, System.DateTime end) + public System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee11() { - return base.Channel.GetAbsenceTimeDCsFilter(start, end); + return base.Channel.GetAbsenceTimeDCEmployee11(); + } + + public System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee21(System.Collections.Generic.List absenceReasons, System.Collections.Generic.List employmentTypes) + { + return base.Channel.GetAbsenceTimeDCEmployee21(absenceReasons, employmentTypes); + } + + public System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee31(System.DateTime start, System.DateTime end) + { + return base.Channel.GetAbsenceTimeDCEmployee31(start, end); + } + + public System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee41(System.DateTime start, System.DateTime end, System.Collections.Generic.List absenceReasons, System.Collections.Generic.List employmentTypes) + { + return base.Channel.GetAbsenceTimeDCEmployee41(start, end, absenceReasons, employmentTypes); + } + + public System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee51(System.DateTime start, System.DateTime end, System.Collections.Generic.List absenceReasonIDs, System.Collections.Generic.List employmentTypeIDs) + { + return base.Channel.GetAbsenceTimeDCEmployee51(start, end, absenceReasonIDs, employmentTypeIDs); } public System.Collections.Generic.List GetAllAbsenceReason() @@ -5683,12 +5746,12 @@ namespace BeWo.ServiceProxy base.Channel.DeleteAbsenceTime(absenceTimeDC); } - public System.Collections.Generic.List GetAllDienste() + public System.Collections.Generic.List GetAllDienste() { return base.Channel.GetAllDienste(); } - public void InsertNewDienst(System.Collections.Generic.List dienst) + public void InsertNewDienst(System.Collections.Generic.List dienst) { base.Channel.InsertNewDienst(dienst); } @@ -5698,11 +5761,36 @@ namespace BeWo.ServiceProxy base.Channel.DeactivateDienst(pOid2Version); } - public void UpdateDienst(System.Collections.Generic.List dienste) + public void UpdateDienst(System.Collections.Generic.List dienste) { base.Channel.UpdateDienst(dienste); } + public System.Collections.Generic.List GetDienstEintraege(long wOid, int year, int month) + { + return base.Channel.GetDienstEintraege(wOid, year, month); + } + + public void InsertNewDienstEintrag(BS.Shared.DataContracts.DienstEintragDC dienstEintrag) + { + base.Channel.InsertNewDienstEintrag(dienstEintrag); + } + + public void UpdateDienstEintrag(BS.Shared.DataContracts.DienstEintragDC dienstEintrag) + { + base.Channel.UpdateDienstEintrag(dienstEintrag); + } + + public void DeleteDienstEintrag(long empId, long wohnId, int Zeile, System.DateTime date) + { + base.Channel.DeleteDienstEintrag(empId, wohnId, Zeile, date); + } + + public System.Collections.Generic.List GetAbsenceTimeVacationByWohnheim(long wohnId, int year, int month) + { + return base.Channel.GetAbsenceTimeVacationByWohnheim(wohnId, year, month); + } + public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType) { base.Channel.UpdateIsChatActiveCustomerAPPCodeDC(customerOid, activeType); diff --git a/BeWo/ServiceProxy/ServiceFacade.cs b/BeWo/ServiceProxy/ServiceFacade.cs index 1364abe31..b3a5ef9f2 100644 --- a/BeWo/ServiceProxy/ServiceFacade.cs +++ b/BeWo/ServiceProxy/ServiceFacade.cs @@ -248,7 +248,21 @@ namespace BeWo.ServiceProxy ShowErrorMessage(e); } } - + + public static T DoWohnheimServiceSync(Func pFunc) + { + try + { + return pFunc.Invoke(GetInstance()); + } + catch (Exception e) + { + ShowErrorMessage(e); + } + + return default(T); + } + public static void DoMailServiceAsync(Func pFunc, Action pCallBack) { DoAsync(pFunc, pCallBack, true); diff --git a/BeWo/View/Controls/DPCtrlDay.cs b/BeWo/View/Controls/DPCtrlDay.cs new file mode 100644 index 000000000..5d0f556cd --- /dev/null +++ b/BeWo/View/Controls/DPCtrlDay.cs @@ -0,0 +1,127 @@ +using BeWo.View.Detail.Report; +using BS.Shared.DataContracts; +using BS.Shared.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Input; +using System.Windows.Media; + +namespace BeWo.View.Controls +{ + public class DPCtrlDay : DienstplanerControl + { + public static readonly DependencyProperty DPCtrlDayInformationProperty = DependencyProperty.Register( + "DPCtrlDayInformation", + typeof(DPCtrlDayInformation), + typeof(DPCtrlDay), + new UIPropertyMetadata( + (s, e) => + { + var info = (DPCtrlDayInformation)e.NewValue; + var c = (DPCtrlDay)s; + + if (c != null && info != null) + { + var dc = info.DienstInfoDC; + + var right = info.DayOfWeek == DayOfWeek.Sunday || info.IsLastColumn; + var bottom = info.IsLastRow; + + c.Border = new Thickness(0, 0, Convert.ToDouble(right), Convert.ToDouble(bottom)); + + if (!info.IsInContractRange) + { + c.Background = Brushes.Gray; + c.Foreground = Brushes.Red; + c.Text = string.Empty; + c.ToolTip = "Kein gültiger Arbeitsvertrag"; + } + else if (info.Reason != null) + { + c.Background = Brushes.White; + c.Foreground = Brushes.Red; + c.Text = $"{info.Reason.Description[0]}"; + c.ToolTip = $"{info.Reason.Description}"; + } + else if (dc != null) + { + var bg = string.IsNullOrEmpty(dc.Farbe) ? Brushes.White : (SolidColorBrush)new BrushConverter().ConvertFrom(dc.Farbe); + var grey = 0.2989 * bg.Color.R + 0.5870 * bg.Color.G + 0.1140 * bg.Color.B; + + c.Background = bg; + c.Foreground = grey < 70 ? Brushes.White : Brushes.Black; + c.ToolTip = new DPCtrlDienstTooltip(dc); + } + else + { + c.Background = ((int)info.DayOfWeek % 6 == 0) ? new SolidColorBrush(ColorExtensions.FromHexString("EFEFEF")) : Brushes.White; + c.Text = string.Empty; + c.ToolTip = null; + } + + if (dc != null) + { + c.Text = $"{dc.Kurz}"; + } + } + })); + + public DPCtrlDay() + { + InitializeComponent(); + MouseDown += DienstplanerControl_MouseDown; + } + + public new Brush Background + { + get => BorderLight.Background; + set => BorderLight.Background = value; + } + + public Thickness Border + { + get => BorderBlack.BorderThickness; + set => BorderBlack.BorderThickness = value; + } + + public DPCtrlDayInformation DPCtrlDayInformation + { + get { return (DPCtrlDayInformation)GetValue(DPCtrlDayInformationProperty); } + + set { SetValue(DPCtrlDayInformationProperty, value); } + } + + private void DienstplanerControl_MouseDown(object sender, MouseButtonEventArgs e) + { + DienstplanerView entryView = null; + + DependencyObject parent = VisualTreeHelper.GetParent(this); + + while (parent != null && entryView == null) + { + entryView = parent as DienstplanerView; + var fe = parent as FrameworkElement; + parent = fe != null ? VisualTreeHelper.GetParent(fe) : null; + } + + if (entryView != null) + { + entryView.DienstplanerControl_MouseDown(sender, e); + } + } + } + + public class DPCtrlDayInformation + { + public DienstInfoDC DienstInfoDC { get; set; } + public AbsenceReasonDC Reason { get; set; } + public bool IsInContractRange { get; set; } + public bool IsLastRow { get; set; } + public bool IsLastColumn { get; set; } + public DayOfWeek DayOfWeek { get; set; } + } +} diff --git a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml new file mode 100644 index 000000000..3a698ce85 --- /dev/null +++ b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs new file mode 100644 index 000000000..e36eb5df5 --- /dev/null +++ b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using BeWo.View.Detail; +using BeWo.View.Detail.Report; +using BeWo.ViewModel; +using BS.Shared.DataContracts; + +namespace BeWo.View.Controls +{ + /// + /// Interaction logic for DienstplanerControl.xaml + /// + public partial class DPCtrlDienstTooltip : UserControl + { + public DPCtrlDienstTooltip(DienstInfoDC dienst) + { + InitializeComponent(); + + TxtDienst.Text = $"{dienst.DienstName} ({dienst.Kurz})"; + TxtEnde.Text = dienst.Ende.ToString("HH:mm"); + TxtPausendauer.Text = dienst.Pause.ToString(); + TxtStart.Text = dienst.Start.ToString("HH:mm"); + } + } +} \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlEmployee.cs b/BeWo/View/Controls/DPCtrlEmployee.cs new file mode 100644 index 000000000..4b7fa10e1 --- /dev/null +++ b/BeWo/View/Controls/DPCtrlEmployee.cs @@ -0,0 +1,127 @@ +using BS.Shared.DataContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace BeWo.View.Controls +{ + public class DPCtrlEmployee : DienstplanerControl + { + public static readonly DependencyProperty EmployeeInformationProperty = DependencyProperty.Register( + "EmployeeInformation", + typeof(DPCtrlEmployeeInformation), + typeof(DPCtrlEmployee), + new UIPropertyMetadata( + (s, e) => + { + var information = (DPCtrlEmployeeInformation)e.NewValue; + var ctrl = (DPCtrlEmployee)s; + + if (ctrl != null) + { + if (information != null) + { + switch (information.Row) + { + case 0: + case 1: + ctrl.BorderBlack.BorderThickness = new Thickness(0, 0, 1, 0); + ctrl.BorderLight.BorderThickness = new Thickness(0, 0, 0, 1); + break; + case 2: + ctrl.BorderBlack.BorderThickness = new Thickness(0, 0, 1, 1); + ctrl.BorderLight.BorderThickness = new Thickness(0, 0, 0, 1); + break; + } + + ctrl.Text = ctrl.DisplayMember; + + ctrl.ToolTip = new DPCtrlEmployeeTooltip(information.Employee, information.Contracts); + } + else + { + ctrl.ToolTip = null; + } + } + })); + + + + public DPCtrlEmployee() + { + InitializeComponent(); + FontSize = 12; + txt.HorizontalAlignment = HorizontalAlignment.Left; + } + + public DPCtrlEmployeeInformation EmployeeInformation + { + get { return (DPCtrlEmployeeInformation)GetValue(EmployeeInformationProperty); } + + set { SetValue(EmployeeInformationProperty, value); } + } + + public string DisplayMember + { + get + { + var sb = new StringBuilder(); + switch (EmployeeInformation.Row) + { + case 0: return EmployeeInformation.Employee.LastNameFirstName; + + case 1: + + foreach (var contract in EmployeeInformation.Contracts) + { + sb.Append(contract.EmploymentType?.Name); + sb.Append('/'); + } + + sb.Remove(sb.Length - 1, 1); + + return sb.ToString(); + + case 2: + + foreach (var contract in EmployeeInformation.Contracts) + { + sb.Append('('); + + if (contract.EntryDate.HasValue) + sb.Append(contract.EntryDate.Value.ToString("dd.MM")); + else + sb.Append("k.A."); + + sb.Append('-'); + + if (contract.ContractEndDate.HasValue) + sb.Append(contract.ContractEndDate.Value.ToString("dd.MM")); + else + sb.Append("unbefr."); + + sb.Append(')'); + + sb.Append('/'); + } + + sb.Remove(sb.Length - 1, 1); + + return sb.ToString(); + } + + return null; + } + } + } + + public class DPCtrlEmployeeInformation + { + public EmployeeDC Employee { get; set; } + public List Contracts { get; set; } + public int Row { get; set; } + } +} diff --git a/BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml b/BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml new file mode 100644 index 000000000..8a650a43d --- /dev/null +++ b/BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml.cs b/BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml.cs new file mode 100644 index 000000000..f59e122cd --- /dev/null +++ b/BeWo/View/Controls/DPCtrlEmployeeContractTooltip.xaml.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using BeWo.View.Detail; +using BeWo.View.Detail.Report; +using BeWo.ViewModel; +using BS.Shared.DataContracts; + +namespace BeWo.View.Controls +{ + /// + /// Interaction logic for DienstplanerControl.xaml + /// + public partial class DPCtrlEmployeeContractTooltip : UserControl + { + public DPCtrlEmployeeContractTooltip(ContractDC contract) + { + InitializeComponent(); + + TxtEmploymentType.Text = contract.EmploymentType.Name; + + if(contract.MonthlyTotalHours != null) + { + TxtArbeitszeit.Text = $"{contract.MonthlyTotalHours.Value} Std/Monat"; + } + else if(contract.WeeklyTotalHours != null) + { + TxtArbeitszeit.Text = $"{contract.WeeklyTotalHours.Value} Std/Woche"; + } + else + { + TxtArbeitszeit.Text = $"k.A."; + } + } + } +} \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml b/BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml new file mode 100644 index 000000000..e427c29a7 --- /dev/null +++ b/BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml.cs b/BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml.cs new file mode 100644 index 000000000..e4867f7fe --- /dev/null +++ b/BeWo/View/Controls/DPCtrlEmployeeTooltip.xaml.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using BeWo.View.Detail; +using BeWo.View.Detail.Report; +using BeWo.ViewModel; +using BS.Shared.DataContracts; + +namespace BeWo.View.Controls +{ + /// + /// Interaction logic for DienstplanerControl.xaml + /// + public partial class DPCtrlEmployeeTooltip : UserControl + { + public DPCtrlEmployeeTooltip(EmployeeDC employeeDC, List contractDCs) + { + InitializeComponent(); + + TxtMitarbeiter.Text = employeeDC.LastNameFirstName; + + var separator = new Separator(); + + foreach (var contract in contractDCs) + { + var sep = new Separator(); + var txtType1 = new TextBlock(); + var txtType2 = new TextBlock(); + var txtArbeit1 = new TextBlock(); + var txtArbeit2 = new TextBlock(); + + txtType1.Text = "Beschäftigungsart:"; + txtType2.Text = $"{contract.EmploymentType?.Name}"; + + txtArbeit1.Text = "Vereinbarte Regelarbeitszeit:"; + + if (contract.MonthlyTotalHours != null) + { + txtArbeit2.Text = $"{contract.MonthlyTotalHours.Value} Std/Monat"; + } + else if (contract.WeeklyTotalHours != null) + { + txtArbeit2.Text = $"{contract.WeeklyTotalHours.Value} Std/Woche"; + } + else + { + txtArbeit2.Text = $"k.A."; + } + + RootGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); + RootGrid.Children.Add(sep); + + Grid.SetRow(sep, RootGrid.RowDefinitions.Count - 1); + Grid.SetColumnSpan(sep, 3); + + RootGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); + RootGrid.Children.Add(txtType1); + RootGrid.Children.Add(txtType2); + + Grid.SetRow(txtType1, RootGrid.RowDefinitions.Count - 1); + Grid.SetRow(txtType2, RootGrid.RowDefinitions.Count - 1); + Grid.SetColumn(txtType2, 2); + + RootGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); + RootGrid.Children.Add(txtArbeit1); + RootGrid.Children.Add(txtArbeit2); + + Grid.SetRow(txtArbeit1, RootGrid.RowDefinitions.Count - 1); + Grid.SetRow(txtArbeit2, RootGrid.RowDefinitions.Count - 1); + Grid.SetColumn(txtArbeit2, 2); + } + } + } +} \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlIcon.cs b/BeWo/View/Controls/DPCtrlIcon.cs new file mode 100644 index 000000000..f34852b96 --- /dev/null +++ b/BeWo/View/Controls/DPCtrlIcon.cs @@ -0,0 +1,68 @@ +using BS.Shared.DataContracts; +using BS.Shared.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media; + +namespace BeWo.View.Controls +{ + public class DPCtrlIcon : DienstplanerControl + { + public static readonly DependencyProperty DienstValueProperty = DependencyProperty.Register( + "DienstValue", + typeof(DienstInfoDC), + typeof(DienstplanerControl), + new UIPropertyMetadata( + (s, e) => + { + var dc = (DienstInfoDC)e.NewValue; + var c = (DPCtrlIcon)s; + + if (c != null) + { + if (dc != null) + { + // rgb2gray converts RGB values to grayscale values by forming a weighted sum of the R, G, and B components: + // 0.2989 * R + 0.5870 * G + 0.1140 * B + + var color = ColorExtensions.FromHexStringDefault(dc.Farbe, Colors.Transparent); + var brush = new SolidColorBrush(color); + + c.BorderBlack.Background = brush; + c.BorderBlack.ToolTip = dc.DienstName; + c.Foreground = color.IsBrighter(70) ? Brushes.Black : Brushes.White; + c.Text = dc.Kurz; + } + else + { + c.BorderBlack.ToolTip = string.Empty; + c.BorderBlack.Background = Brushes.White; + c.Foreground = Brushes.Black; + c.Text = string.Empty; + } + } + })); + + public DPCtrlIcon() + { + InitializeComponent(); + + BorderBlack.BorderThickness = new Thickness(1); + BorderBlack.CornerRadius = new CornerRadius(4); + BorderBlack.Visibility = Visibility.Visible; + BorderLight.Visibility = Visibility.Hidden; + FontSize = 12; + } + + public DienstInfoDC DienstValue + { + get { return (DienstInfoDC)GetValue(DienstValueProperty); } + + set { SetValue(DienstValueProperty, value); } + } + } +} diff --git a/BeWo/View/Controls/DPCtrlWeek.cs b/BeWo/View/Controls/DPCtrlWeek.cs new file mode 100644 index 000000000..ae13e7d54 --- /dev/null +++ b/BeWo/View/Controls/DPCtrlWeek.cs @@ -0,0 +1,66 @@ +using BS.Shared.DataContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace BeWo.View.Controls +{ + public class DPCtrlWeek : DienstplanerControl + { + public static readonly DependencyProperty DienstInfoDCListProperty = DependencyProperty.Register( + "DienstInfoDCList", + typeof(List), + typeof(DPCtrlWeek), + new UIPropertyMetadata( + (s, e) => + { + var dc = (List)e.NewValue; + var c = (DPCtrlWeek)s; + + if (c != null) + { + if (dc != null) + { + dc.RemoveAll(x => x == null); + + c.BorderBlack.BorderThickness = new Thickness(0, 0, 1, 1); + + double res = 0.0; + + if (dc.Count != 0) + foreach (var x in dc) + { + res += x.DurationHours; + } + + c.Text = res.ToString("0.##"); + } + else + { + c.BorderBlack.BorderThickness = new Thickness(0, 0, 1, 0); + + c.Text = ""; + } + } + })); + + public DPCtrlWeek() + { + InitializeComponent(); + + BorderBlack.BorderThickness = new Thickness(0, 0, 1, 0); + txt.TextAlignment = TextAlignment.Left; + txt.HorizontalAlignment = HorizontalAlignment.Left; + } + + public List DienstInfoDCList + { + get { return (List)GetValue(DienstInfoDCListProperty); } + + set { SetValue(DienstInfoDCListProperty, value); } + } + } +} diff --git a/BeWo/View/Controls/DienstplanerControl.xaml b/BeWo/View/Controls/DienstplanerControl.xaml new file mode 100644 index 000000000..1f5eb4614 --- /dev/null +++ b/BeWo/View/Controls/DienstplanerControl.xaml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/BeWo/View/Controls/DienstplanerControl.xaml.cs b/BeWo/View/Controls/DienstplanerControl.xaml.cs new file mode 100644 index 000000000..157f4b6a8 --- /dev/null +++ b/BeWo/View/Controls/DienstplanerControl.xaml.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using BeWo.View.Detail; +using BeWo.View.Detail.Report; +using BeWo.ViewModel; +using BS.Shared.DataContracts; + +namespace BeWo.View.Controls +{ + /// + /// Interaction logic for DienstplanerControl.xaml + /// + public partial class DienstplanerControl : UserControl + { + public DienstplanerControl() + { + InitializeComponent(); + + ToolTipService.SetShowDuration(this, 60000); + } + + public string Text + { + get => txt.Text; + set => txt.Text = value; + } + + public new double FontSize + { + get => txt.FontSize; + set => txt.FontSize = value; + } + + public Border BorderLight + { + get => boLight; + set => boLight = value; + } + + public Border BorderBlack + { + get => bo; + set => bo = value; + } + } +} \ No newline at end of file diff --git a/BeWo/View/Controls/MonthPicker.xaml b/BeWo/View/Controls/MonthPicker.xaml new file mode 100644 index 000000000..90c956d05 --- /dev/null +++ b/BeWo/View/Controls/MonthPicker.xaml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/BeWo/View/Controls/MonthPicker.xaml.cs b/BeWo/View/Controls/MonthPicker.xaml.cs new file mode 100644 index 000000000..831edea2a --- /dev/null +++ b/BeWo/View/Controls/MonthPicker.xaml.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using BeWo.View.Detail; +using BeWo.View.Detail.Report; +using BeWo.ViewModel; +using BS.Shared.DataContracts; + +namespace BeWo.View.Controls +{ + /// + /// Interaction logic for MonthPicker.xaml + /// + public partial class MonthPicker : UserControl + { + public MonthPicker() + { + InitializeComponent(); + _MonthPicker.ItemsSource = DateTimeFormatInfo.CurrentInfo.MonthNames.Where(s => !string.IsNullOrEmpty(s)); + _MonthPicker.SelectedIndex = 0; + } + + public int SelectedMonth + { + get => _MonthPicker.SelectedIndex + 1; + set => _MonthPicker.SelectedIndex = value - 1; + } + + public string SelectedMonthName + { + get => (string)_MonthPicker.SelectedItem; + } + } +} \ No newline at end of file diff --git a/BeWo/View/Detail/DienstView.xaml.cs b/BeWo/View/Detail/DienstView.xaml.cs index 083fa3ff1..afdcd2c3c 100644 --- a/BeWo/View/Detail/DienstView.xaml.cs +++ b/BeWo/View/Detail/DienstView.xaml.cs @@ -21,9 +21,9 @@ namespace BeWo.View.Detail { public partial class DienstView : BeWoView { - private DienstListVM _ViewModel; + private DienstInfoListVM _ViewModel; - public DienstView(DienstListVM listVM) + public DienstView(DienstInfoListVM listVM) { InitializeComponent(); _FarbeComboBox.ItemTemplateSelector = new ComboBoxTemplateSelector(_FarbeComboBox); @@ -40,7 +40,7 @@ namespace BeWo.View.Detail get { return "Dienste"; } } - private DienstListVM ViewModel + private DienstInfoListVM ViewModel { get { return _ViewModel; } @@ -62,7 +62,7 @@ namespace BeWo.View.Detail if (ViewModel.RemovedCount > 0) { - lToDos.Add(s => s.DeactivateDienst(ViewModel.GetRemoved().ToDictionary(dc => dc.DienstOid.Value, dc => dc.DienstVersion.Value))); + lToDos.Add(s => s.DeactivateDienst(ViewModel.GetRemoved().ToDictionary(dc => dc.Oid.Value, dc => dc.Version.Value))); } if (ViewModel.ChangedCount > 0) @@ -88,7 +88,7 @@ namespace BeWo.View.Detail private void DeleteButton_Click(object sender, RoutedEventArgs e) { - ViewModel.VMList.Remove(_GridControl.GetCurrentValue()); + ViewModel.VMList.Remove(_GridControl.GetCurrentValue()); BeWoWpfUtils.RefreshDXGrid(_GridControl); } @@ -117,7 +117,7 @@ namespace BeWo.View.Detail { int rowHandle = data.RowHandle.Value; - var vm = _GridControl.GetRow(rowHandle) as DienstVM; + var vm = _GridControl.GetRow(rowHandle) as DienstInfoVM; if (vm != null) { diff --git a/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml b/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml new file mode 100644 index 000000000..7de2ce625 --- /dev/null +++ b/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + +