From 28d271f86f746bebee1f6e4862eb70c3983d2121 Mon Sep 17 00:00:00 2001 From: rene Date: Tue, 13 Oct 2020 14:35:06 +0200 Subject: [PATCH] Urlaubskonto Berechnung Urlaubskonto Anzeige AbwesenheitsView --- BeWo/BeWo.csproj | 20 +- BeWo/ServiceProxy/Generated.cs | 79 ++--- .../Report/AbwesenheitsEditView.xaml.cs | 43 +-- .../Report/AbwesenheitsEmployeeHeader.xaml | 15 + .../Report/AbwesenheitsEmployeeHeader.xaml.cs | 56 +++ .../AbwesenheitsEmployeeHeaderTooltip.xaml | 30 ++ .../AbwesenheitsEmployeeHeaderTooltip.xaml.cs | 37 ++ ...tabelleView.xaml => AbwesenheitsView.xaml} | 105 +++--- ...eView.xaml.cs => AbwesenheitsView.xaml.cs} | 186 ++++++---- .../Detail/Report/DienstplanerView.xaml.cs | 2 +- BeWo/View/Master/ReportView.xaml.cs | 1 + Host/ReportView.aspx.cs | 2 +- Report/AbstractReportCreator.cs | 2 + Report/DefaultReportCreator.cs | 320 +++++++++--------- Report/DefaultReports/AbsenceReport.cs | 2 +- Report/ReportObjects/AbsenceRO.cs | 13 +- Service/Plugins/VacationService.cs | 149 +++++++- .../ServiceContracts/IOperationsService.cs | 48 +-- .../OperationsServiceImp.cs | 304 ++++++++++------- .../DataContracts/AbsenceOverviewFilterDC.cs | 21 ++ Shared/DataContracts/EmployeeDC.cs | 5 +- Shared/DataContracts/UrlaubskontoDC.cs | 28 ++ Shared/Extensions/DateTimeExtensions.cs | 248 ++++++++------ Shared/Shared.csproj | 2 + 24 files changed, 1060 insertions(+), 658 deletions(-) create mode 100644 BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml create mode 100644 BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml.cs create mode 100644 BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml create mode 100644 BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml.cs rename BeWo/View/Detail/Report/{AbwesenheitstabelleView.xaml => AbwesenheitsView.xaml} (57%) rename BeWo/View/Detail/Report/{AbwesenheitstabelleView.xaml.cs => AbwesenheitsView.xaml.cs} (57%) create mode 100644 Shared/DataContracts/AbsenceOverviewFilterDC.cs create mode 100644 Shared/DataContracts/UrlaubskontoDC.cs diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index d630e4b5c..06203b650 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -329,6 +329,14 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -337,7 +345,7 @@ MSBuild:Compile Designer - + MSBuild:Compile Designer @@ -977,11 +985,17 @@ AbsenceTimesView.xaml + + AbwesenheitsEmployeeHeaderTooltip.xaml + + + AbwesenheitsEmployeeHeader.xaml + DienstplanerView.xaml - - AbwesenheitstabelleView.xaml + + AbwesenheitsView.xaml AbwesenheitsEditView.xaml diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index d23e51250..9f351951b 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -1321,6 +1321,7 @@ namespace BeWo.ServiceProxy [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(BeWo.ServiceProxy.BeWoFault))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFaultType))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -1351,6 +1352,7 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.CustomerEmployeeRelationDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.UrlaubskontoDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.EmployeeAPPCodeDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -1517,12 +1519,7 @@ 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(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(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))] @@ -1545,6 +1542,7 @@ namespace BeWo.ServiceProxy [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(BS.Shared.DataContracts.AbsenceOverviewFilterDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BargeldkassenDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -1640,7 +1638,11 @@ 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(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.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AccountingReportDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -4742,26 +4744,6 @@ 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/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")] System.Collections.Generic.List GetAllAbsenceReason(); @@ -4875,6 +4857,14 @@ namespace BeWo.ServiceProxy "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/GetAbsenceOverview", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceOverviewResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceOverviewBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetAbsenceOverview(BS.Shared.DataContracts.AbsenceOverviewFilterDC filter); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetUrlaubskontoByEmployee", ReplyAction="http://tempuri.org/IOperationsService/GetUrlaubskontoByEmployeeResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetUrlaubskontoByEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + BS.Shared.DataContracts.UrlaubskontoDC GetUrlaubskontoByEmployee(long empOid, int year); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCResponse" + "")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCBeWoFaul" + @@ -5820,31 +5810,6 @@ namespace BeWo.ServiceProxy return base.Channel.GetReportTemplates(url); } - public System.Tuple, System.Collections.Generic.List> GetAbsenceTimeDCEmployee11() - { - 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() { return base.Channel.GetAllAbsenceReason(); @@ -5970,6 +5935,16 @@ namespace BeWo.ServiceProxy return base.Channel.GetAbsenceTimeVacationByWohnheim(wohnId, year, month); } + public System.Collections.Generic.List GetAbsenceOverview(BS.Shared.DataContracts.AbsenceOverviewFilterDC filter) + { + return base.Channel.GetAbsenceOverview(filter); + } + + public BS.Shared.DataContracts.UrlaubskontoDC GetUrlaubskontoByEmployee(long empOid, int year) + { + return base.Channel.GetUrlaubskontoByEmployee(empOid, year); + } + public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType) { base.Channel.UpdateIsChatActiveCustomerAPPCodeDC(customerOid, activeType); diff --git a/BeWo/View/Detail/Report/AbwesenheitsEditView.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsEditView.xaml.cs index 035d6ad48..53770460a 100644 --- a/BeWo/View/Detail/Report/AbwesenheitsEditView.xaml.cs +++ b/BeWo/View/Detail/Report/AbwesenheitsEditView.xaml.cs @@ -20,42 +20,33 @@ using SchedulerControl = DevExpress.Xpf.Scheduler.SchedulerControl; namespace BeWo.View.Detail.Report { - /// - /// Interaktionslogik für TestEMailControl.xaml - /// public partial class AbwesenheitsEditView : UserControl { - private SchedulerControl _SchedulerControl; + private AbwesenheitstabelleView Parent; public bool IsEditMode { get; set; } public AbsenceTimeDC AbsenceTime { get; set; } public Appointment Appointment { get; } - - /// - /// Für Appointment-Bearbeitung - /// - /// - /// - /// - public AbwesenheitsEditView(SchedulerControl schedulerControl, Appointment appointment, AbsenceTimeDC absenceTimeDC, List reasons) + + public AbwesenheitsEditView(AbwesenheitstabelleView abwesenheitstabelleView, Appointment appointment, List reasons) { InitializeComponent(); - _SchedulerControl = schedulerControl; + Parent = abwesenheitstabelleView; _ReasonPicker.Items.AddRange(reasons.ToArray()); Appointment = appointment; - IsEditMode = appointment.CustomFields["AbsenceTime"] != null; + IsEditMode = (AbsenceTimeDC)appointment.CustomFields[nameof(AbsenceTimeDC)] != null; if (IsEditMode) { _DeleteBtn.Visibility = Visibility.Visible; - AbsenceTime = absenceTimeDC; + AbsenceTime = (AbsenceTimeDC)appointment.CustomFields[nameof(AbsenceTimeDC)]; - _ReasonPicker.SelectedItem = absenceTimeDC.Reason; - _NoticeTxt.Text = absenceTimeDC.Notice; + _ReasonPicker.SelectedItem = AbsenceTime.Reason; + _NoticeTxt.Text = AbsenceTime.Notice; } else { @@ -79,17 +70,17 @@ namespace BeWo.View.Detail.Report { if (MessageBox.Show("Möchten Sie den Eintrag wirklich löschen?", "Eintrag löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes) return; - - _SchedulerControl.Storage.AppointmentStorage.Remove(Appointment); - ServiceFacade.DoOperationsServiceAsync(x => x.DeleteAbsenceTime(AbsenceTime)); + + Parent._SchedulerControl.Storage.AppointmentStorage.Remove(Appointment); + ServiceFacade.DoOperationsServiceSync(x => x.DeleteAbsenceTime(AbsenceTime)); SchedulerFormBehavior.Close(this, true); + + Parent.UpdateUrlaubkonto(AbsenceTime.EmployeeOid.Value); } private void SaveBtn_Click(object sender, RoutedEventArgs e) { - - var start = _DatePickerStartDate.DateTime; var end = string.IsNullOrEmpty(_DatePickerEndDate.Text) ? null : _DatePickerEndDate.DateTime as DateTime?; @@ -110,18 +101,20 @@ namespace BeWo.View.Detail.Report var t = AbsenceTime.AbsenceTimeVersion; - SchedulerHelper.OverrideAWithB(Appointment, AbsenceTime); + SchedulerHelper.OverrideAppointmentWithAbsenceTime(Appointment, AbsenceTime); } else { AbsenceTime = ServiceFacade.DoOperationsServiceSync(x => x.InsertAbsenceTimeWithReturn(AbsenceTime)); - SchedulerHelper.OverrideAWithB(Appointment, AbsenceTime); + SchedulerHelper.OverrideAppointmentWithAbsenceTime(Appointment, AbsenceTime); - _SchedulerControl.Storage.AppointmentStorage.Add(Appointment); + Parent._SchedulerControl.Storage.AppointmentStorage.Add(Appointment); } SchedulerFormBehavior.Close(this, true); + + Parent.UpdateUrlaubkonto(AbsenceTime.EmployeeOid.Value); } } } diff --git a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml new file mode 100644 index 000000000..9c14e5937 --- /dev/null +++ b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml.cs new file mode 100644 index 000000000..83a01bade --- /dev/null +++ b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml.cs @@ -0,0 +1,56 @@ +using BS.Shared.DataContracts; +using DevExpress.Xpf.Core; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail.Report +{ + public partial class AbwesenheitsEmployeeHeader : UserControl + { + public static readonly DependencyProperty EmployeeDCProperty = DependencyProperty.Register( + "EmployeeDC", + typeof(EmployeeDC), + typeof(AbwesenheitsEmployeeHeader), + new UIPropertyMetadata( + (s, e) => + { + var dc = (EmployeeDC)e.NewValue; + var c = (AbwesenheitsEmployeeHeader)s; + + if (c != null) + { + if (dc != null) + { + c._EmployeeName.Text = dc.LastNameFirstName; + c._EmployeeUrlaub.Text = $"Urlaub: {dc.Urlaubskonto.Resturlaub.ToString("0.00")}/{dc.Urlaubskonto.Urlaubsanspruch.ToString("0.00")} Tage"; + ((AbwesenheitsEmployeeHeaderTooltip)c.ToolTip).Set(dc); + } + } + })); + + public AbwesenheitsEmployeeHeader() + { + InitializeComponent(); + ToolTip = new AbwesenheitsEmployeeHeaderTooltip(); + } + + public EmployeeDC EmployeeDC + { + get { return (EmployeeDC)GetValue(EmployeeDCProperty); } + + set { SetValue(EmployeeDCProperty, value); } + } + } +} diff --git a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml new file mode 100644 index 000000000..f1508daea --- /dev/null +++ b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml.cs new file mode 100644 index 000000000..3984a3a24 --- /dev/null +++ b/BeWo/View/Detail/Report/AbwesenheitsEmployeeHeaderTooltip.xaml.cs @@ -0,0 +1,37 @@ +using BS.Shared.DataContracts; +using DevExpress.Xpf.Core; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BeWo.View.Detail.Report +{ + public partial class AbwesenheitsEmployeeHeaderTooltip : UserControl + { + public AbwesenheitsEmployeeHeaderTooltip() + { + InitializeComponent(); + } + + public void Set(EmployeeDC emp) + { + var konto = emp.Urlaubskonto; + + _TxtResturlaub.Text = konto.Resturlaub.ToString("0.00") + " Tage"; + _TxtResturlaubVorjahr.Text = konto.ResturlaubVorjahr.ToString("0.00") + " Tage"; + _TxtUrlaubsanspruch.Text = konto.Urlaubsanspruch.ToString("0.00") + " Tage"; + _TxtUrlaubsanspruchVorjahr.Text = konto.ResturlaubVorjahrTotal.ToString("0.00") + " Tage"; + } + } +} diff --git a/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml b/BeWo/View/Detail/Report/AbwesenheitsView.xaml similarity index 57% rename from BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml rename to BeWo/View/Detail/Report/AbwesenheitsView.xaml index 255fac032..cc3107c4e 100644 --- a/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml +++ b/BeWo/View/Detail/Report/AbwesenheitsView.xaml @@ -10,7 +10,9 @@ xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls" xmlns:dxschi="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal" xmlns:XtraScheduler="clr-namespace:DevExpress.XtraScheduler;assembly=DevExpress.XtraScheduler.v17.1.Core" - x:Class="BeWo.View.Detail.Report.AbwesenheitstabelleView" + xmlns:controls="clr-namespace:BeWo.View.Controls" + xmlns:report="clr-namespace:BeWo.View.Detail.Report" + x:Class="BeWo.View.Detail.Report.AbwesenheitstabelleView" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True"> @@ -21,9 +23,9 @@ @@ -32,11 +34,9 @@ - + + + @@ -47,7 +47,7 @@ - + @@ -56,72 +56,41 @@ - - - - - - - - - - - - -