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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs
new file mode 100644
index 000000000..371efc2b6
--- /dev/null
+++ b/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs
@@ -0,0 +1,57 @@
+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
+{
+ ///
+ /// Interaktionslogik für TestEMailControl.xaml
+ ///
+ public partial class AbwesenheitsPrintControl : UserControl
+ {
+ public event Action ButtonAcceptClicked;
+ public event Action ButtonCancelClicked;
+
+ public AbwesenheitsPrintControl(DateTime dt)
+ {
+ InitializeComponent();
+ ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, Theme.Office2010Black);
+
+ var years = new List();
+ for (int i = DateTime.Now.Year + 5; i >= 2010; i--)
+ {
+ years.Add(i);
+ }
+
+ ComboJahr.ItemsSource = years;
+ ComboJahr.SelectedItem = dt.Year;
+
+ ComboMonat.ItemsSource = DateTimeFormatInfo.CurrentInfo.MonthNames.Where(s => !string.IsNullOrEmpty(s));
+ ComboMonat.SelectedIndex = dt.Month - 1;
+ }
+
+ public DateTime SelectedDate => new DateTime((int)ComboJahr.SelectedItem, ComboMonat.SelectedIndex + 1, 1);
+
+ private void ButtonAccept_OnClick(object sender, RoutedEventArgs e)
+ {
+ ButtonAcceptClicked?.Invoke();
+ }
+
+ private void ButtonCancel_OnClick(object sender, RoutedEventArgs e)
+ {
+ ButtonCancelClicked?.Invoke();
+ }
+ }
+}
diff --git a/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml b/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml
index d76ff2916..255fac032 100644
--- a/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml
+++ b/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml
@@ -5,6 +5,7 @@
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler"
+ xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:dxschi="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal"
@@ -13,166 +14,166 @@
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Focusable="True">
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml.cs
index 87a57789f..c372aa3be 100644
--- a/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml.cs
+++ b/BeWo/View/Detail/Report/AbwesenheitstabelleView.xaml.cs
@@ -33,6 +33,7 @@ using AppointmentStorage = DevExpress.Xpf.Scheduler.AppointmentStorage;
using IAppointmentLabelStorage = DevExpress.Xpf.Scheduler.AppointmentLabelCollection;
using BeWo.Scheduler.View;
using AppointmentLabel = DevExpress.Xpf.Scheduler.AppointmentLabel;
+using System.Windows.Navigation;
namespace BeWo.View.Detail.Report
{
@@ -52,57 +53,21 @@ namespace BeWo.View.Detail.Report
{
InitializeComponent();
- _SchedulerStorage = _SchedulerControl.Storage;
- _LabelStorage = _SchedulerControl.Storage.AppointmentStorage.Labels;
- _ResourceStorage = _SchedulerControl.Storage.ResourceStorage;
- _AppointmentStorage = _SchedulerControl.Storage.AppointmentStorage;
+ InitFilter();
+ InitDateStuff();
+ InitSchedulerStuff();
- _AppointmentStorage.CustomFieldMappings.Add(new SchedulerCustomFieldMapping("AbsenceTime", "AbsenceTime"));
- _SchedulerStorage.AppointmentsInserted += _SchedularStorage_AppointmentsInserted;
- _SchedulerStorage.AppointmentInserting += _SchedularStorage_AppointmentInserting;
- _SchedulerControl.TimelineView.VerticalResourceHeaderStyle = (Style)this.FindResource("VerticalResourceHeaderStyle");
-
- IMouseHandlerService oldMouseHandler = (IMouseHandlerService)_SchedulerControl.GetService(typeof(IMouseHandlerService));
-
- if (oldMouseHandler != null)
- {
- MouseHandlerService newMouseHandler =
- new MouseHandlerService(_SchedulerControl, oldMouseHandler);
- _SchedulerControl.RemoveService(typeof(IMouseHandlerService));
- _SchedulerControl.AddService(typeof(IMouseHandlerService), newMouseHandler);
- }
-
- var kategorien = ServiceFacade.DoOperationsServiceSync(x => x.GetAllAbsenceReason());
- foreach (var item in kategorien)
- {
- FilterAbwesenheit.Items.Add(item);
- }
-
- var arbeitsarten = ServiceFacade.DoEmployeeServiceSync(x => x.GetAllEmploymentTypes());
- foreach (var item in arbeitsarten)
- {
- FilterBeschaftigungsart.Items.Add(item);
- }
-
- var td = DateTime.Today;
- _DateTimePicker.DateTime = td.AddDays(1 - td.Day);
- _SpinEdit.Text = DateTime.DaysInMonth(td.Year, td.Month).ToString();
+ linkPdfExport.NavigateUri = BeWoApp.SiteOfOrigin;
+ //_SchedulerControl.Start = new DateTime(2020, 02, 01);
}
- private void _SchedularStorage_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e)
- {
-
- }
- private void _SchedularStorage_AppointmentsInserted(object sender, PersistentObjectsEventArgs e)
- {
-
- }
+ public List SelectedAbsenceReasons => FilterAbwesenheit.SelectedItems.Cast().ToList();
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Update();
- }
+ public List SelectedEmploymentTypes => FilterBeschaftigungsart.SelectedItems.Cast().ToList();
+
+
+ private void Button_Click(object sender, RoutedEventArgs e) => UpdateScheduler();
private void SchedularControl_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e)
{
@@ -110,7 +75,6 @@ namespace BeWo.View.Detail.Report
e.AllowResize = false;
-
e.Form = new AbwesenheitsEditView(_SchedulerControl, apt, (AbsenceTimeDC)apt.CustomFields["AbsenceTime"], _AbsenceReasonDCs);
}
@@ -121,7 +85,7 @@ namespace BeWo.View.Detail.Report
private void SchedulerControl_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e)
{
-
+
}
private void SpinEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
@@ -136,37 +100,90 @@ namespace BeWo.View.Detail.Report
private void DateEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
{
var dp = _DateTimePicker.DateTime;
-
+
_DateTimePicker.DateTime = dp.AddDays(1 - dp.Day);
_SpinEdit.Value = DateTime.DaysInMonth(dp.Year, dp.Month);
_SchedulerControl.Start = _DateTimePicker.DateTime;
}
-
- public void Update()
+
+ private void LinkPdfExport_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
- _AbsenceReasonDCs = ServiceFacade.DoOperationsServiceSync(x => x
- .GetAllAbsenceReason());
+ var control = new AbwesenheitsPrintControl(_SchedulerControl.Start);
+ var beWoWindow = new BeWoWindow();
- var absenceTimes = ServiceFacade.DoOperationsServiceSync(x => x
- .GetAbsenceTimeDCsFilter(new DateTime(2000, 1, 1), new DateTime(2021, 1, 1)))
- .Where(f => f.EmployeeOid.HasValue)
- .ToList();
+ control.ButtonCancelClicked += () => beWoWindow.Close();
- var empIDs = absenceTimes.Select(x => x.EmployeeOid.Value).Distinct().ToList();
+ control.ButtonAcceptClicked += delegate
+ {
+ UpdateReportUrl(control.SelectedDate);
+ BeWoUtils.NavigateToReportUri((sender as System.Windows.Documents.Hyperlink).NavigateUri.ToString(), Translator.Translate("Abwesenheitsübersicht"));
+
+ beWoWindow.Close();
+ };
+
+ beWoWindow.Height = 200;
+ beWoWindow.MinHeight = 200;
+ beWoWindow.Width = 250;
+ beWoWindow.MinWidth = 250;
+ beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
+ beWoWindow.GroupBoxContent = control;
+ beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow;
+ beWoWindow.rootGroupBox.Header = "Drucken";
+ beWoWindow.ShowDialog();
+ }
+
+ private void InitFilter()
+ {
+ var absenceReasons = ServiceFacade.DoOperationsServiceSync(x => x.GetAllAbsenceReason());
+ var employmentTypes = ServiceFacade.DoEmployeeServiceSync(x => x.GetAllEmploymentTypes());
+
+ FilterAbwesenheit.Items.AddRange(absenceReasons.ToArray());
+ FilterBeschaftigungsart.Items.AddRange(employmentTypes.ToArray());
+ _AbsenceReasonDCs = absenceReasons;
+ }
+
+ private void InitDateStuff()
+ {
+ var today = DateTime.Today;
+ _DateTimePicker.DateTime = today.AddDays(1 - today.Day);
+ _SpinEdit.Text = DateTime.DaysInMonth(today.Year, today.Month).ToString();
+ }
+
+ private void InitSchedulerStuff()
+ {
+ _SchedulerStorage = _SchedulerControl.Storage;
+ _LabelStorage = _SchedulerControl.Storage.AppointmentStorage.Labels;
+ _ResourceStorage = _SchedulerControl.Storage.ResourceStorage;
+ _AppointmentStorage = _SchedulerControl.Storage.AppointmentStorage;
+
+ _AppointmentStorage.CustomFieldMappings.Add(new SchedulerCustomFieldMapping("AbsenceTime", "AbsenceTime"));
+ _SchedulerControl.TimelineView.VerticalResourceHeaderStyle = (Style)this.FindResource("VerticalResourceHeaderStyle");
+
+ IMouseHandlerService oldMouseHandler = (IMouseHandlerService)_SchedulerControl.GetService(typeof(IMouseHandlerService));
+
+ if (oldMouseHandler != null)
+ {
+ MouseHandlerService newMouseHandler =
+ new MouseHandlerService(_SchedulerControl, oldMouseHandler);
+ _SchedulerControl.RemoveService(typeof(IMouseHandlerService));
+ _SchedulerControl.AddService(typeof(IMouseHandlerService), newMouseHandler);
+ }
+ }
+
+ private void UpdateScheduler()
+ {
+ var absenceReasons = ServiceFacade.DoOperationsServiceSync(x => x.GetAllAbsenceReason());
+ var tuple = ServiceFacade.DoOperationsServiceSync(x => x.GetAbsenceTimeDCEmployee21(SelectedAbsenceReasons, SelectedEmploymentTypes));
+ var absenceTimes = tuple.Item1;
+ var employees = tuple.Item2;
- var empWithAbsence = ServiceFacade.DoEmployeeServiceSync(x => x
- .GetAllEmployees()
- .Where(emp => empIDs.Contains(emp.EmployeeOid.Value)))
- .ToList()
- .OrderBy(x => x.LastNameFirstName);
-
try
{
_SchedulerStorage.BeginUpdate();
_LabelStorage.Clear();
- foreach (var reason in _AbsenceReasonDCs)
+ foreach (var reason in absenceReasons)
{
var label = _LabelStorage.CreateNewLabel(reason.AbsenceReasonOid.ToString(), reason.Description);
@@ -176,8 +193,7 @@ namespace BeWo.View.Detail.Report
}
_ResourceStorage.Clear();
- var listEmps = FilterBeschaftigungsart.SelectedItems.Count == 0 ? empWithAbsence : empWithAbsence.Where(x => x.Contracts.Exists(y => FilterBeschaftigungsart.SelectedItems.Contains(y.EmploymentType)));
- foreach (var employee in listEmps)
+ foreach (var employee in employees)
{
var resource = _SchedulerStorage.CreateResource(employee.EmployeeOid.Value.ToString());
@@ -187,10 +203,7 @@ namespace BeWo.View.Detail.Report
}
_AppointmentStorage.Clear();
- var listAbs = (FilterAbwesenheit.SelectedItems.Count == 0 ? absenceTimes : absenceTimes.Where(x => FilterAbwesenheit.SelectedItems.Contains(x.Reason)))
- .Where(y => listEmps.Select(x => x.EmployeeOid).Contains(y.EmployeeOid));
-
- foreach (var absenceTime in listAbs)
+ foreach (var absenceTime in absenceTimes)
{
var appointment = _SchedulerStorage.CreateAppointment(AppointmentType.Normal);
@@ -205,6 +218,27 @@ namespace BeWo.View.Detail.Report
_SchedulerControl.Visibility = Visibility.Visible;
}
}
+
+ private void UpdateReportUrl(DateTime date)
+ {
+ var url = BeWoApp.SiteOfOrigin
+ + "/ReportView.aspx"
+ + "?type=" + Utils.EnumName(ReportTypes.AbsenceReport)
+ + "&dt=" + date.ToString("MM.yyyy");
+
+ if (SelectedAbsenceReasons.Any())
+ url += "&ar=" + string.Join(";", SelectedAbsenceReasons.Select(x => x.AbsenceReasonOid.Value));
+
+ if (SelectedEmploymentTypes.Any())
+ url += "&et=" + string.Join(";", SelectedEmploymentTypes.Select(x => x.EmploymentTypeOid.Value));
+
+ linkPdfExport.NavigateUri = new Uri(url);
+ }
+
+ private void _SchedulerControl_PopupMenuShowing(object sender, SchedulerMenuEventArgs e)
+ {
+ e.Handled = false;
+ }
}
public class MouseHandlerService : MouseHandlerServiceWrapper
diff --git a/BeWo/View/Detail/Report/Dienstplaner.xaml b/BeWo/View/Detail/Report/Dienstplaner.xaml
deleted file mode 100644
index 57d2ee248..000000000
--- a/BeWo/View/Detail/Report/Dienstplaner.xaml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/Dienstplaner.xaml.cs b/BeWo/View/Detail/Report/Dienstplaner.xaml.cs
deleted file mode 100644
index 02cac4193..000000000
--- a/BeWo/View/Detail/Report/Dienstplaner.xaml.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-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.Input;
-using System.Windows.Forms;
-using System.Windows.Media;
-
-using BeWo.Controls;
-using BeWo.Core;
-using BeWo.ServiceProxy;
-using BeWo.ViewModel;
-
-using BS.Shared;
-using BS.Shared.Core;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
-using BS.Shared.Extensions;
-using BS.Shared.Translation;
-
-using DevExpress.Services;
-using DevExpress.XtraScheduler;
-using DevExpress.Xpf.Scheduler;
-using DevExpress.Xpf.Scheduler.Native;
-
-using SchedulerStorage = DevExpress.Xpf.Scheduler.SchedulerStorage;
-using ResourceStorage = DevExpress.Xpf.Scheduler.ResourceStorage;
-using AppointmentStorage = DevExpress.Xpf.Scheduler.AppointmentStorage;
-using IAppointmentLabelStorage = DevExpress.Xpf.Scheduler.AppointmentLabelCollection;
-using BeWo.Scheduler.View;
-using AppointmentLabel = DevExpress.Xpf.Scheduler.AppointmentLabel;
-
-namespace BeWo.View.Detail.Report
-{
- ///
- /// Interaction logic for Dienstplaner.xaml
- ///
- public partial class Dienstplaner : BeWoView
- {
- public Dienstplaner()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/DienstplanerView.xaml b/BeWo/View/Detail/Report/DienstplanerView.xaml
new file mode 100644
index 000000000..1e473a690
--- /dev/null
+++ b/BeWo/View/Detail/Report/DienstplanerView.xaml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/DienstplanerView.xaml.cs b/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
new file mode 100644
index 000000000..7a4b6cc7f
--- /dev/null
+++ b/BeWo/View/Detail/Report/DienstplanerView.xaml.cs
@@ -0,0 +1,513 @@
+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.Input;
+using System.Windows.Forms;
+using System.Windows.Media;
+
+using BeWo.Controls;
+using BeWo.Core;
+using BeWo.ServiceProxy;
+using BeWo.ViewModel;
+using BeWo.View.Controls;
+
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Compact;
+using BS.Shared.Extensions;
+using BS.Shared.Translation;
+
+using DevExpress.Xpf.Grid;
+using DevExpress.XtraGrid.Views.Grid.ViewInfo;
+using MouseEventArgs = System.Windows.Input.MouseEventArgs;
+using System.ComponentModel;
+using Button = System.Windows.Controls.Button;
+using System.Windows.Navigation;
+
+namespace BeWo.View.Detail.Report
+{
+ ///
+ /// Interaction logic for Dienstplaner.xaml
+ ///
+ public partial class DienstplanerView : BeWoView
+ {
+ private List _Wohnheime;
+ private List _DienstDCListe;
+ private List _DienstEintragListe;
+ private List _AlleDienste;
+ private Dictionary> _AbsenceTimesDict;
+
+ private GridColumn _ColumnEmp;
+ private List _ColumnDays;
+ private List _ColumnWeek;
+
+ private CompactWohnheimDC _AuswahlWohnheim;
+ private DienstZeile _AuswahlDienstZeile;
+ private DateTime _AuswahlMonat;
+ private int _AuswahlTag;
+
+ private bool _IsControlClick;
+
+ public DienstplanerView()
+ {
+ InitializeComponent();
+
+ Wohnheime = ServiceFacade.DoCustomerServiceSync(x => x.GetAllActiveWohnheimeCompact());
+
+ InitDateComboBox();
+ CreateColumns();
+
+ linkPdfExport.NavigateUri = BeWoApp.SiteOfOrigin;
+ }
+
+ #region Properties
+ public List Wohnheime
+ {
+ get { return _Wohnheime; }
+ set
+ {
+ _Wohnheime = value;
+ _WohnheimPicker.ItemsSource = value;
+ }
+ }
+
+ public CompactWohnheimDC AuswahlWohnheim
+ {
+ get => _AuswahlWohnheim;
+ set
+ {
+ _AuswahlWohnheim = value;
+ _TxtWohnheim.Content = $"{value.WohnheimName} ({AuswahlMonat.ToString("MM.yyyy")})";
+ }
+ }
+
+ public DateTime AuswahlMonat
+ {
+ get => _AuswahlMonat;
+ set => _AuswahlMonat = new DateTime(value.Year, value.Month, 1);
+ }
+
+ public DateTime Pointer => AuswahlMonat.AddDays(_AuswahlTag - 1);
+ #endregion
+
+ #region Loading
+ private void InitGridControl()
+ {
+ RefreshDienste();
+ BuildGridControlColumnDays(AuswahlMonat.Year, AuswahlMonat.Month, 1);
+ RefreshGrid();
+ ShowGrid();
+ }
+
+ private void RefreshGrid()
+ {
+ _GridControl.ItemsSource = null;
+ _GridControl.ItemsSource = _DienstEintragListe;
+ }
+
+ private void ShowGrid()
+ {
+ _GridControl.Visibility = Visibility.Visible;
+ _TxtWohnheim.Visibility = Visibility.Visible;
+ _TxtWohnheimInfo.Visibility = Visibility.Visible;
+ }
+
+ private void BuildGridControlColumnDays(int year, int month, int fixedColumns)
+ {
+ var dayCounter = 0;
+ var weekCounter = 0;
+
+ var dt = new DateTime(year, month, 1);
+ var days = DateTime.DaysInMonth(year, month);
+
+
+ while (dayCounter < days)
+ {
+ var currentDay = dt.AddDays(dayCounter);
+
+ var day = _ColumnDays[dayCounter];
+
+ day.Header = $"{new CultureInfo("de-DE").DateTimeFormat.GetDayName(currentDay.DayOfWeek).Substring(0, 2)}\n{(dayCounter + 1).ToString()}.";
+ day.Visible = true;
+ day.VisibleIndex = dayCounter + weekCounter + fixedColumns;
+
+ dayCounter++;
+
+ if (currentDay.DayOfWeek != DayOfWeek.Sunday)
+ continue;
+
+ var week = _ColumnWeek[weekCounter];
+
+ week.Header = "Wo.\nIst"; //$"{new CultureInfo("de-DE").Calendar.GetWeekOfYear(currentDay, CalendarWeekRule.FirstDay, DayOfWeek.Monday)}. Wo\nIst";
+ week.FieldName = dayCounter + "W";
+ week.Visible = true;
+ week.VisibleIndex = dayCounter + weekCounter + fixedColumns;
+
+ weekCounter++;
+ }
+
+ for (int i = dayCounter; i < _ColumnDays.Count; i++)
+ {
+ var day = _ColumnDays[i];
+
+ day.Visible = false;
+ }
+
+ for (int i = weekCounter; i < _ColumnWeek.Count; i++)
+ {
+ var week = _ColumnWeek[i];
+
+ week.Visible = false;
+ }
+ }
+
+ private void CreateColumns()
+ {
+ var dayControlTemplate = (ControlTemplate)FindResource("ctrlDay");
+ var weekControlTemplate = (ControlTemplate)FindResource("ctrlWeek");
+ var empControlTemplate = (ControlTemplate)FindResource("ctrlEmp");
+
+ _ColumnEmp = NewGridColumnUnbound("Mitarbeiter", "emp", "EM:", 200, 200, DevExpress.Data.UnboundColumnType.Object, empControlTemplate, DevExpress.Utils.DefaultBoolean.True); //NewGridColumn("Mitarbeiter", "Header", double.NaN, 100);
+ _ColumnEmp.Fixed = FixedStyle.Left;
+
+ _ColumnDays = new List();
+ _ColumnWeek = new List();
+
+ for (int i = 1; i <= 31; i++)
+ {
+ _ColumnDays.Add(NewGridColumnUnbound(string.Empty, i.ToString(), $"DA:", 28, 28, DevExpress.Data.UnboundColumnType.Object, dayControlTemplate, DevExpress.Utils.DefaultBoolean.False));
+ }
+
+ for (int i = 1; i <= 5; i++)
+ {
+ _ColumnWeek.Add(NewGridColumnUnbound("Wo.\nIst", string.Empty, $"WE:", 60, 40, DevExpress.Data.UnboundColumnType.Object, weekControlTemplate, DevExpress.Utils.DefaultBoolean.False));
+ }
+
+ _GridControl.Columns.Add(_ColumnEmp);
+ _GridControl.Columns.AddRange(_ColumnDays);
+ _GridControl.Columns.AddRange(_ColumnWeek);
+ }
+
+ private void InitDateComboBox()
+ {
+ var year = new List();
+ for (int i = 1900; i < 2100; i++)
+ {
+ year.Add(i);
+ }
+
+ _YearPicker.ItemsSource = year;
+
+ _MonthPicker.SelectedMonth = DateTime.Today.Month;
+ _YearPicker.SelectedItem = DateTime.Today.Year;
+ }
+ #endregion
+
+ private void GroupBox_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ if (!_IsControlClick)
+ {
+ _PopupPicker.IsOpen = false;
+ }
+
+ _IsControlClick = false;
+ }
+
+ private void BeWoView_Loaded(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ // Button Click
+ private void BtnAnzeigen_Click(object sender, RoutedEventArgs e)
+ {
+ _PopupPicker.IsOpen = false;
+
+ if (_WohnheimPicker.SelectedItem == null)
+ return;
+
+ AuswahlMonat = new DateTime((int)_YearPicker.SelectedItem, _MonthPicker.SelectedMonth, 1);
+
+ var year = _YearPicker.SelectedItem;
+
+ AuswahlWohnheim = _WohnheimPicker.SelectedItem as CompactWohnheimDC;
+
+ InitGridControl();
+ }
+
+ // Grid Click
+ public void DienstplanerControl_MouseDown(object sender, MouseEventArgs e)
+ {
+ _PopupPicker.IsOpen = false;
+
+ _AuswahlDienstZeile = _GridControl.GetRow(_GridControl.View.GetRowHandleByMouseEventArgs(e)) as DienstZeile;
+ _AuswahlTag = int.Parse(_GridControl.View.GetColumnByMouseEventArgs(e).FieldName);
+
+ listbox_valuepicker.ItemsSource = _AlleDienste;
+
+ _IsControlClick = true;
+ _PopupPicker.IsOpen = true;
+ }
+
+ // Popup Click
+ private void Popup_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ var oldDienst = _AuswahlDienstZeile.TryGetDienst(_AuswahlTag);
+ var newDienst = (DienstInfoDC)((Grid)sender).Tag;
+
+ _PopupPicker.IsOpen = false;
+
+
+ if (oldDienst == null)
+ {
+ if (!newDienst.IsPlatzhalter)
+ {
+ _AuswahlDienstZeile.AddDienst(_AuswahlTag, newDienst);
+ ServiceFacade.DoOperationsServiceAsync(x => x.InsertNewDienstEintrag(
+ new DienstEintragDC
+ {
+ Datum = Pointer,
+ DienstOid = newDienst.Oid.Value,
+ EmployeeOid = _AuswahlDienstZeile.Employee.EmployeeOid.Value,
+ Oid = null,
+ WohnheimOid = AuswahlWohnheim.WohnheimOid,
+ Zeile = _AuswahlDienstZeile.Zeile
+ }));
+ }
+ }
+ else
+ {
+ if (newDienst.IsPlatzhalter)
+ {
+ _AuswahlDienstZeile.RemoveDienst(_AuswahlTag);
+ ServiceFacade.DoOperationsServiceAsync(x => x.DeleteDienstEintrag(_AuswahlDienstZeile.Employee.EmployeeOid.Value, AuswahlWohnheim.WohnheimOid, _AuswahlDienstZeile.Zeile, Pointer));
+ }
+ else
+ {
+ if (oldDienst.Equals(newDienst))
+ return;
+
+ _AuswahlDienstZeile.RemoveDienst(_AuswahlTag);
+ _AuswahlDienstZeile.AddDienst(_AuswahlTag, newDienst);
+
+ //_AuswahlDienstZeile.UpdateDienst(_AuswahlTag, newDienst);
+ }
+ }
+ }
+
+ // Daten füllen
+ private void GridControl_CustomUnboundColumnData(object sender, GridColumnDataEventArgs e)
+ {
+ if (e.IsGetData)
+ {
+ var selZeile = _GridControl.GetRowByListIndex(e.ListSourceRowIndex) as DienstZeile;
+ var pos = 0;
+ var tag = e.Column.Tag.ToStringNullCheck();
+
+ switch (e.Column.Tag.ToString().Substring(0, 2))
+ {
+ case "DA":
+ pos = int.Parse(e.Column.FieldName);
+ var date = _AuswahlMonat.AddDays(pos - 1);
+
+ AbsenceReasonDC reason = null;
+ if (_AbsenceTimesDict.ContainsKey(selZeile.Employee.EmployeeOid.Value))
+ reason = _AbsenceTimesDict[selZeile.Employee.EmployeeOid.Value].FirstOrDefault(x =>
+ x.Start <= date && (!x.End.HasValue || x.End >= date))?.Reason;
+
+ e.Value = new DPCtrlDayInformation
+ {
+ DienstInfoDC = selZeile.TryGetDienst(pos),
+ IsLastRow = selZeile.Zeile == 2,
+ DayOfWeek = date.DayOfWeek,
+ IsLastColumn = pos == DateTime.DaysInMonth(AuswahlMonat.Year, AuswahlMonat.Month),
+ IsInContractRange = selZeile.GetContract(pos) != null,
+ Reason = reason
+ };
+ return;
+
+ case "WE":
+ pos = int.Parse(e.Column.FieldName.Remove(e.Column.FieldName.Length - 1));
+ e.Value = selZeile.Zeile == 2 ? _DienstEintragListe.FindAll(x => x.Employee == selZeile.Employee).SelectMany(y => y.GetDienstWoche(pos)).ToList() : null;
+ return;
+
+ case "EM":
+ e.Value = new DPCtrlEmployeeInformation
+ {
+ Employee = selZeile.Employee,
+ Contracts = selZeile.Contracts,
+ Row = selZeile.Zeile
+ };
+ return;
+ }
+ }
+ }
+
+ private void LinkPdfExport_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
+ {
+ UpdateReportUrl(_AuswahlWohnheim.WohnheimOid, _AuswahlMonat);
+ BeWoUtils.NavigateToReportUri((sender as System.Windows.Documents.Hyperlink).NavigateUri.ToString(), Translator.Translate("Dienstplan"));
+ }
+
+ private void RefreshDienste()
+ {
+ _DienstDCListe = ServiceFacade.DoOperationsServiceSync(x => x.GetDienstEintraege(AuswahlWohnheim.WohnheimOid, AuswahlMonat.Year, AuswahlMonat.Month));
+
+ _AlleDienste = ServiceFacade.DoOperationsServiceSync(x => x.GetAllDienste());
+ _AlleDienste.Insert(0, DienstInfoDC.Platzhalter);
+
+ _DienstEintragListe = _DienstDCListe
+ .SelectMany(x => DienstZeile.Init(x, _AlleDienste, RefreshGrid, AuswahlMonat))
+ .ToList();
+
+
+ var absence = ServiceFacade.DoOperationsServiceSync(x => x.GetAbsenceTimeVacationByWohnheim(AuswahlWohnheim.WohnheimOid, AuswahlMonat.Year, AuswahlMonat.Month));
+
+ var temp = new Dictionary>();
+
+ foreach (var abs in absence)
+ {
+ if (!temp.ContainsKey(abs.EmployeeOid.Value))
+ temp.Add(abs.EmployeeOid.Value, new List());
+
+ temp[abs.EmployeeOid.Value].Add(abs);
+ }
+
+ _AbsenceTimesDict = temp;
+ }
+
+ private void UpdateReportUrl(long wOid, DateTime date)
+ {
+ var url = BeWoApp.SiteOfOrigin
+ + "/ReportView.aspx"
+ + "?type=" + Utils.EnumName(ReportTypes.RosterReport)
+ + "&wid=" + wOid
+ + "&dt=" + date.ToString("MM.yyyy");
+
+ linkPdfExport.NavigateUri = new Uri(url);
+ }
+
+ #region ColumnCreate
+
+ private GridColumn NewGridColumnUnbound(string header, string fieldName, string tag, GridColumnWidth width, double minWidth, DevExpress.Data.UnboundColumnType unboundColumnType, ControlTemplate displayTemplate, DevExpress.Utils.DefaultBoolean allowResize)
+ {
+ var clmn = NewGridColumn(header, fieldName, width, minWidth, allowResize);
+
+ clmn.UnboundType = unboundColumnType;
+ clmn.Tag = tag;
+
+ if (displayTemplate != null)
+ clmn.DisplayTemplate = displayTemplate;
+
+ return clmn;
+ }
+
+ private GridColumn NewGridColumn(string header, string fieldName, GridColumnWidth width, double minWidth, DevExpress.Utils.DefaultBoolean allowResize)
+ {
+ return new GridColumn
+ {
+ AllowAutoFilter = false,
+ AllowBestFit = DevExpress.Utils.DefaultBoolean.False,
+ AllowCellMerge = false,
+ AllowColumnFiltering = DevExpress.Utils.DefaultBoolean.False,
+ AllowConditionalFormattingMenu = false,
+ AllowEditing = DevExpress.Utils.DefaultBoolean.False,
+ AllowFocus = false,
+ AllowGrouping = DevExpress.Utils.DefaultBoolean.False,
+ AllowIncrementalSearch = false,
+ AllowMoving = DevExpress.Utils.DefaultBoolean.False,
+ AllowPrinting = false,
+ AllowResizing = allowResize,
+ AllowSearchPanel = DevExpress.Utils.DefaultBoolean.False,
+ AllowSorting = DevExpress.Utils.DefaultBoolean.False,
+ Width = width,
+ MinWidth = minWidth,
+ FieldName = fieldName,
+ Header = header,
+ HorizontalHeaderContentAlignment = System.Windows.HorizontalAlignment.Center
+ };
+ }
+
+ #endregion
+
+ ///
+ /// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ ///
+
+ public class DienstZeile
+ {
+ public event Action DienstDictUpdated;
+
+ public EmployeeDC Employee { get; set; }
+ public List Contracts { get; set; }
+ public int Zeile { get; set; }
+ public DateTime Date { get; set; }
+ private Dictionary DienstDict { get; set; }
+
+ public DienstZeile(EmployeeDC emp, List contracts, int zeile, DateTime date, Dictionary dienste)
+ {
+ Employee = emp;
+ Contracts = contracts;
+ Zeile = zeile;
+ Date = date;
+ DienstDict = dienste ?? new Dictionary();
+ }
+
+ public List GetDienstWoche(int sonntag) => DienstDict.Where(x => x.Key <= sonntag && sonntag - x.Key < 7).Select(x => x.Value).ToList();
+
+ public DienstInfoDC GetDienst(int tag) => DienstDict[tag];
+
+ public DienstInfoDC TryGetDienst(int tag) => DienstDict.ContainsKey(tag) ? DienstDict[tag] : null;
+
+ public void AddDienst(int tag, DienstInfoDC dienst)
+ {
+ DienstDict.Add(tag, dienst);
+ DienstDictUpdated?.Invoke();
+ }
+
+ public void UpdateDienst(int tag, DienstInfoDC dienst)
+ {
+ DienstDict[tag] = dienst;
+ DienstDictUpdated?.Invoke();
+ }
+
+ public void RemoveDienst(int tag)
+ {
+ DienstDict.Remove(tag);
+ DienstDictUpdated?.Invoke();
+ }
+
+ public ContractDC GetContract(int tag) => Contracts.FirstOrDefault(x => (!x.EntryDate.HasValue || x.EntryDate.Value <= Date.AddDays(tag - 1)) &&
+ (!x.ContractEndDate.HasValue || x.ContractEndDate.Value >= Date.AddDays(tag - 1)));
+
+ public static List Init(DienstBlockDC eintragDC, List dienste, Action dienstDictUpdate, DateTime date)
+ {
+ var res = new List();
+
+ for (int i = 0; i < eintragDC.DienstDictArray.Length; i++)
+ {
+ var zeileDC = eintragDC.DienstDictArray[i];
+
+ var newDic = new Dictionary();
+
+ if (zeileDC != null)
+ newDic = zeileDC.ToDictionary(k => k.Key, v => dienste.Find(x => x.Oid == v.Value));
+
+ var toAdd = new DienstZeile(eintragDC.Employee, eintragDC.Contracts, i, date, newDic);
+
+ toAdd.DienstDictUpdated += dienstDictUpdate;
+
+ res.Add(toAdd);
+ }
+
+ return res;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/View/Master/ReportView.xaml.cs b/BeWo/View/Master/ReportView.xaml.cs
index d2178fd40..e4e13bc74 100644
--- a/BeWo/View/Master/ReportView.xaml.cs
+++ b/BeWo/View/Master/ReportView.xaml.cs
@@ -192,7 +192,7 @@ namespace BeWo.View.Master
private void tabitem_dienstPlaner_Selected(object sender, RoutedEventArgs e)
{
if (!_OpenViews.ContainsKey(tabitem_dienstPlaner))
- _OpenViews[tabitem_dienstPlaner] = new Dienstplaner();
+ _OpenViews[tabitem_dienstPlaner] = new DienstplanerView();
Show(tabitem_dienstPlaner);
}
diff --git a/BeWo/View/Report/Employee/EmployeeHourReportView.xaml b/BeWo/View/Report/Employee/EmployeeHourReportView.xaml
index 191a6cef8..00b38a359 100644
--- a/BeWo/View/Report/Employee/EmployeeHourReportView.xaml
+++ b/BeWo/View/Report/Employee/EmployeeHourReportView.xaml
@@ -44,7 +44,7 @@
+ Cursor="Arrow" />
@@ -69,33 +69,33 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/ViewModel/DienstVM.cs b/BeWo/ViewModel/DienstInfoVM.cs
similarity index 87%
rename from BeWo/ViewModel/DienstVM.cs
rename to BeWo/ViewModel/DienstInfoVM.cs
index 76a88d0de..6ad2f1c34 100644
--- a/BeWo/ViewModel/DienstVM.cs
+++ b/BeWo/ViewModel/DienstInfoVM.cs
@@ -1,6 +1,7 @@
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
+using BeWo.Core;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -10,7 +11,7 @@ using System.Windows.Media;
namespace BeWo.ViewModel
{
- public class DienstVM : AbstractDCMapperVM
+ public class DienstInfoVM : AbstractDCMapperVM
{
private long? _DienstOid;
private string _DienstNotice;
@@ -23,7 +24,7 @@ namespace BeWo.ViewModel
private DateTime _EndeDT;
private int _Pause;
- public DienstVM(DienstDC dienstDC) : base(dienstDC, dienstDC.DienstOid == null)
+ public DienstInfoVM(DienstInfoDC dienstDC) : base(dienstDC, dienstDC.Oid == null)
{ }
public long? DienstOid
@@ -34,7 +35,7 @@ namespace BeWo.ViewModel
if (AreDifferent(_DienstOid, value))
{
_DienstOid = value;
- StoreDirtyInformation(AreDifferent(DataContract.DienstOid, value), nameof(_DienstOid));
+ StoreDirtyInformation(AreDifferent(DataContract.Oid, value), nameof(_DienstOid));
FirePropertyChanged(nameof(_DienstOid));
}
}
@@ -48,7 +49,7 @@ namespace BeWo.ViewModel
if (AreDifferent(_DienstNotice, value))
{
_DienstNotice = value;
- StoreDirtyInformation(AreDifferent(DataContract.DienstNotice, value), nameof(_DienstNotice));
+ StoreDirtyInformation(AreDifferent(DataContract.Notice, value), nameof(_DienstNotice));
FirePropertyChanged(nameof(_DienstNotice));
}
}
@@ -62,7 +63,7 @@ namespace BeWo.ViewModel
if (AreDifferent(_DienstVersion, value))
{
_DienstVersion = value;
- StoreDirtyInformation(AreDifferent(DataContract.DienstVersion, value), nameof(_DienstVersion));
+ StoreDirtyInformation(AreDifferent(DataContract.Version, value), nameof(_DienstVersion));
FirePropertyChanged(nameof(_DienstVersion));
}
}
@@ -187,11 +188,11 @@ namespace BeWo.ViewModel
}
}
- protected override void InitByDataContract(DienstDC bDataContract)
+ protected override void InitByDataContract(DienstInfoDC bDataContract)
{
- _DienstOid = bDataContract.DienstOid;
- _DienstNotice = bDataContract.DienstNotice;
- _DienstVersion = bDataContract.DienstVersion;
+ _DienstOid = bDataContract.Oid;
+ _DienstNotice = bDataContract.Notice;
+ _DienstVersion = bDataContract.Version;
_DienstName = bDataContract.DienstName;
_Kurz = bDataContract.Kurz;
_StartDT = bDataContract.Start;
@@ -200,15 +201,15 @@ namespace BeWo.ViewModel
if (!string.IsNullOrEmpty(bDataContract.Farbe))
{
- _Farbe = (SolidColorBrush)new BrushConverter().ConvertFrom(bDataContract.Farbe);
+ _Farbe = new SolidColorBrush(ColorExtensions.FromHexStringDefault(bDataContract.Farbe, Colors.Transparent));
}
}
- protected override DienstDC MapToDataContract(DienstDC bDataContract, bool doCommit)
+ protected override DienstInfoDC MapToDataContract(DienstInfoDC bDataContract, bool doCommit)
{
- bDataContract.DienstOid = _DienstOid;
- bDataContract.DienstNotice = _DienstNotice;
- bDataContract.DienstVersion = _DienstVersion;
+ bDataContract.Oid = _DienstOid;
+ bDataContract.Notice = _DienstNotice;
+ bDataContract.Version = _DienstVersion;
bDataContract.DienstName = _DienstName;
bDataContract.Kurz = _Kurz;
bDataContract.Farbe = _FarbeString;
diff --git a/BeWo/ViewModel/ListViewModel/DienstListVM.cs b/BeWo/ViewModel/ListViewModel/DienstListVM.cs
index 243118120..4c8a9d069 100644
--- a/BeWo/ViewModel/ListViewModel/DienstListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/DienstListVM.cs
@@ -10,9 +10,9 @@ using Color = System.Drawing.Color;
namespace BeWo.ViewModel.ListViewModel
{
- public class DienstListVM : AbstractDCListMapperVM
+ public class DienstInfoListVM : AbstractDCListMapperVM
{
- public DienstListVM(List pDCs): base(pDCs)
+ public DienstInfoListVM(List pDCs): base(pDCs)
{
}
diff --git a/BeWo/ViewModel/VMFactory.cs b/BeWo/ViewModel/VMFactory.cs
index 9f5ea1df3..7fa72b5be 100644
--- a/BeWo/ViewModel/VMFactory.cs
+++ b/BeWo/ViewModel/VMFactory.cs
@@ -459,10 +459,10 @@ namespace BeWo.ViewModel
r => pCallBack(new BudgetListVM(r.ToList())));
}
- public static void CreateDienstListVMAsync(Action pCallBack)
+ public static void CreateDienstListVMAsync(Action pCallBack)
{
ServiceFacade.DoOperationsServiceAsync(s => s.GetAllDienste(),
- r => pCallBack(new DienstListVM(r.ToList())));
+ r => pCallBack(new DienstInfoListVM(r.ToList())));
}
public static void CreateTextModuleListVMAsync(Action pCallBack, bool pIsInAdministrationView = false, bool pIsInTextModuleEditor = false)
diff --git a/Data/Data.csproj b/Data/Data.csproj
index 0a478d15a..f5d38ab95 100644
--- a/Data/Data.csproj
+++ b/Data/Data.csproj
@@ -135,7 +135,8 @@
-
+
+
@@ -606,7 +607,7 @@
Designer
-
+
Designer
@@ -616,6 +617,9 @@
Designer
+
+ Designer
+
Designer
diff --git a/Data/Entities/DienstEintrag.cs b/Data/Entities/DienstEintrag.cs
new file mode 100644
index 000000000..ff2b5ff3a
--- /dev/null
+++ b/Data/Entities/DienstEintrag.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BS.Shared;
+
+namespace BeWo.Data.Entities
+{
+ public class DienstEintrag : BeWoEntityBase
+ {
+ private long _EmployeeOid;
+ private long _WohnheimOid;
+ private long _DienstOid;
+ private int _Zeile;
+ private DateTime _Datum;
+
+ public DienstEintrag()
+ {
+ _Tid = TableID.DienstEintrag;
+ }
+
+ public virtual long EmployeeOid
+ {
+ get
+ {
+ return _EmployeeOid;
+ }
+ set
+ {
+ if (AreDifferent(_EmployeeOid, value))
+ {
+ _EmployeeOid = value;
+ }
+ }
+ }
+
+ public virtual long WohnheimOid
+ {
+ get
+ {
+ return _WohnheimOid;
+ }
+ set
+ {
+ if (AreDifferent(_WohnheimOid, value))
+ {
+ _WohnheimOid = value;
+ }
+ }
+ }
+
+ public virtual long DienstOid
+ {
+ get
+ {
+ return _DienstOid;
+ }
+ set
+ {
+ if (AreDifferent(_DienstOid, value))
+ {
+ _DienstOid = value;
+ }
+ }
+ }
+
+ public virtual int Zeile
+ {
+ get
+ {
+ return _Zeile;
+ }
+ set
+ {
+ if (AreDifferent(_Zeile, value))
+ {
+ _Zeile = value;
+ }
+ }
+ }
+
+ public virtual DateTime Datum
+ {
+ get
+ {
+ return _Datum;
+ }
+ set
+ {
+ if (AreDifferent(_Datum, value))
+ {
+ _Datum = value;
+ }
+ }
+ }
+ }
+}
diff --git a/Data/Entities/Dienst.cs b/Data/Entities/DienstInfo.cs
similarity index 95%
rename from Data/Entities/Dienst.cs
rename to Data/Entities/DienstInfo.cs
index 6049f743e..7fb8523f2 100644
--- a/Data/Entities/Dienst.cs
+++ b/Data/Entities/DienstInfo.cs
@@ -8,7 +8,7 @@ using BS.Shared;
namespace BeWo.Data.Entities
{
- public class Dienst : BeWoEntityBase
+ public class DienstInfo : BeWoEntityBase
{
private string _Dienstname;
private string _Kurz;
@@ -17,9 +17,9 @@ namespace BeWo.Data.Entities
private DateTime _Ende;
private int _Pause;
- public Dienst()
+ public DienstInfo()
{
- _Tid = TableID.Dienst;
+ _Tid = TableID.DienstInfo;
}
public virtual string DienstName
diff --git a/Data/Entities/Employee.cs b/Data/Entities/Employee.cs
index f5fb0be45..339cd438f 100644
--- a/Data/Entities/Employee.cs
+++ b/Data/Entities/Employee.cs
@@ -495,6 +495,10 @@ namespace BeWo.Data.Entities
{
return Person.LastName + ", " + Person.FirstName;
}
-
- }
+
+ public override int GetHashCode()
+ {
+ return GetType().Name.GetHashCode() ^ Oid.GetHashCode();
+ }
+ }
}
\ No newline at end of file
diff --git a/Data/Mappings/DienstEintrag.hbm.xml b/Data/Mappings/DienstEintrag.hbm.xml
new file mode 100644
index 000000000..c1d9034a3
--- /dev/null
+++ b/Data/Mappings/DienstEintrag.hbm.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Data/Mappings/Dienst.hbm.xml b/Data/Mappings/DienstInfo.hbm.xml
similarity index 96%
rename from Data/Mappings/Dienst.hbm.xml
rename to Data/Mappings/DienstInfo.hbm.xml
index 5a39e27be..ee4929a64 100644
--- a/Data/Mappings/Dienst.hbm.xml
+++ b/Data/Mappings/DienstInfo.hbm.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/Host/ReportView.aspx.cs b/Host/ReportView.aspx.cs
index ff433b506..555fa837f 100644
--- a/Host/ReportView.aspx.cs
+++ b/Host/ReportView.aspx.cs
@@ -18,6 +18,7 @@ using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
using Page = System.Web.UI.Page;
+using System.Globalization;
namespace Host
{
@@ -135,6 +136,12 @@ namespace Host
case ReportTypes.SBDCharacteristics:
report = CreateSBDCharacteristicsReport();
break;
+ case ReportTypes.AbsenceReport:
+ report = CreateAbsenceReport();
+ break;
+ case ReportTypes.RosterReport:
+ report = CreateRosterReport();
+ break;
default:
report = CreateQueryReport();
break;
@@ -153,8 +160,8 @@ namespace Host
Response.Write("Session ist abgelaufen! Bitte erstellen Sie den Bericht erneut. Nach Erstellen des Berichts haben Sie 10 Min. Zeit diesen auszudrucken.");
return new XtraReport();
}
-
- private XtraReport CreateTestReportKalender()
+
+ private XtraReport CreateTestReportKalender()
{
var abc = Request.Params["r"].Split('-');
var rightsList = abc.Select(r => (UserRightType)Int32.Parse(r)).ToList();
@@ -536,6 +543,29 @@ namespace Host
return reportCreator.CreateSBDCharacteristicsReport(customerOid);
}
+ private XtraReport CreateAbsenceReport()
+ {
+ DateTime dt = DateTime.ParseExact(Request.Params["dt"], "MM.yyyy", CultureInfo.InvariantCulture);
+ List absenceIDs = null;
+ List empIDs = null;
+
+ if (Request.Params["ar"] != null)
+ absenceIDs = Request.Params["ar"].Split(';').Select(long.Parse).ToList();
+
+ if (Request.Params["et"] != null)
+ absenceIDs = Request.Params["et"].Split(';').Select(long.Parse).ToList();
+
+ return reportCreator.CreateAbsenceReport(dt, absenceIDs, empIDs);
+ }
+
+ private XtraReport CreateRosterReport()
+ {
+ DateTime dt = DateTime.ParseExact(Request.Params["dt"], "MM.yyyy", CultureInfo.InvariantCulture);
+ long wOid = int.Parse(Request.Params["wid"]);
+
+ return reportCreator.CreateRosterReport(wOid, dt);
+ }
+
private AbstractReportCreator GetReportCreator()
{
String t = slicedToken["tenant"].ToString();
diff --git a/Model/Changes_2020_02_26 Dienst zu DienstInfo geändert.txt b/Model/Changes_2020_02_26 Dienst zu DienstInfo geändert.txt
new file mode 100644
index 000000000..55c23aa26
--- /dev/null
+++ b/Model/Changes_2020_02_26 Dienst zu DienstInfo geändert.txt
@@ -0,0 +1,2 @@
+ALTER TABLE `bewodemo`.`dienst`
+RENAME TO `bewodemo`.`dienstinfo` ;
diff --git a/Model/Changes_2020_02_26 Diensteinträge hinzugefügt.txt b/Model/Changes_2020_02_26 Diensteinträge hinzugefügt.txt
new file mode 100644
index 000000000..289a440b5
--- /dev/null
+++ b/Model/Changes_2020_02_26 Diensteinträge hinzugefügt.txt
@@ -0,0 +1,18 @@
+CREATE TABLE `diensteintrag` (
+ `Oid` bigint(19) NOT NULL AUTO_INCREMENT,
+ `Tid` int(10) DEFAULT NULL,
+ `IsActive` tinyint(4) DEFAULT NULL,
+ `Notice` varchar(1024) DEFAULT NULL,
+ `InsTs` datetime DEFAULT NULL,
+ `InsUser` varchar(256) DEFAULT NULL,
+ `Version` bigint(19) DEFAULT NULL,
+ `UdpUser` varchar(256) DEFAULT NULL,
+ `SystemEntryID` int(10) DEFAULT NULL,
+
+ `EmployeeOid` bigint(19) DEFAULT NULL,
+ `WohnheimOid` bigint(19) DEFAULT NULL,
+ `DienstOid` bigint(19) DEFAULT NULL,
+ `Zeile` int(10) DEFAULT NULL,
+ `Datum` datetime DEFAULT NULL,
+ PRIMARY KEY (`Oid`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
\ No newline at end of file
diff --git a/Report/AbstractReportCreator.cs b/Report/AbstractReportCreator.cs
index 5948db1d0..78815c9b6 100644
--- a/Report/AbstractReportCreator.cs
+++ b/Report/AbstractReportCreator.cs
@@ -74,5 +74,7 @@ namespace BeWo.Report
public abstract XtraReport CreateCustomReport(long employeeOid, String reportName);
+ public abstract XtraReport CreateAbsenceReport(DateTime dt, List abs, List empTypes);
+ public abstract XtraReport CreateRosterReport(long wOid, DateTime dt);
}
}
\ No newline at end of file
diff --git a/Report/DefaultReportCreator.cs b/Report/DefaultReportCreator.cs
index 2cc82ed19..e625b5f75 100644
--- a/Report/DefaultReportCreator.cs
+++ b/Report/DefaultReportCreator.cs
@@ -24,360 +24,360 @@ using DevExpress.XtraReports.UI;
namespace BeWo.Report
{
- public class DefaultReportCreator : AbstractReportCreator
- {
- public IBeWoReport FindReportImp()
- {
- return FindReportImp(null, null);
- }
+ public class DefaultReportCreator : AbstractReportCreator
+ {
+ public IBeWoReport FindReportImp()
+ {
+ return FindReportImp(null, null);
+ }
- public IBeWoReport FindReportImp(string specificReportId)
- {
- return this.FindReportImp(specificReportId, null);
- }
+ public IBeWoReport FindReportImp(string specificReportId)
+ {
+ return this.FindReportImp(specificReportId, null);
+ }
- public IBeWoReport FindReportImp(string specificReportId, string typename)
- {
- IBeWoReport result = null;
+ public IBeWoReport FindReportImp(string specificReportId, string typename)
+ {
+ IBeWoReport result = null;
- Type[] lAllReportTypes = null;
+ Type[] lAllReportTypes = null;
- if (Tenant != null && File.Exists(ReportPath))
- {
- lAllReportTypes = Assembly.LoadFrom(ReportPath).GetTypes();
- result = FindReportImp(lAllReportTypes, specificReportId, typename, true);
- }
-
-
- if (result == null)
- {
- lAllReportTypes = typeof(IBeWoReport).Assembly.GetTypes();
- result = FindReportImp(lAllReportTypes, specificReportId, typename, false);
- }
-
- return result;
- }
-
- public IBeWoReport FindReportImp(Type[] lAllReportTypes, string specificReportId, string typename, bool doNotUseReportsWithIdentifier)
- {
- IBeWoReport result = null;
-
- if (!string.IsNullOrEmpty(specificReportId) && !string.IsNullOrEmpty(typename))
- {
- var cbSpecific = lAllReportTypes
- .Where(i => typeof(IBeWoReport).IsAssignableFrom(i))
- .FirstOrDefault(t => t.GetCustomAttributes(typeof(IDSpecificClassAttribute), true)
- .ToList()
- .Exists(i =>
- {
- var attr = (IDSpecificClassAttribute)i;
- if (attr.Identifiers != null)
- return attr.Identifiers.Contains(specificReportId);
- if (!String.IsNullOrEmpty(attr.Identifier))
- return attr.Identifier.Equals(specificReportId);
- return false;
-
- }
- ) && t.FullName == typename);
- if (cbSpecific != null)
- result = Activator.CreateInstance(cbSpecific) as IBeWoReport;
- }
-
- if (!string.IsNullOrEmpty(typename))
- {
- var cbSpecific = lAllReportTypes.FirstOrDefault(t => t.FullName == typename);
- if (cbSpecific != null)
- result = Activator.CreateInstance(cbSpecific) as IBeWoReport;
- }
-
- if (!string.IsNullOrEmpty(specificReportId))
- {
- var cbSpecific = lAllReportTypes
- .Where(i => typeof(IBeWoReport).IsAssignableFrom(i))
- .FirstOrDefault(t => t.GetCustomAttributes(typeof(IDSpecificClassAttribute), true)
- .ToList()
- .Exists(i =>
- {
- var attr = (IDSpecificClassAttribute)i;
- if (attr.Identifiers != null)
- return attr.Identifiers.Contains(specificReportId);
- if (!String.IsNullOrEmpty(attr.Identifier))
- return attr.Identifier.Equals(specificReportId);
- return false;
-
- }
- ));
- if (cbSpecific != null)
- result = Activator.CreateInstance(cbSpecific) as IBeWoReport;
- }
-
- if (result == null)
- {
- foreach (var iType in lAllReportTypes)
- if (typeof(IBeWoReport).IsAssignableFrom(iType))
- if (iType.Name == specificReportId)
- result = Activator.CreateInstance(iType) as IBeWoReport;
- }
-
- if (result == null)
- {
- var list = lAllReportTypes.Where(t => typeof(IBeWoReport).IsAssignableFrom(t)).ToList();
-
- if (list.Count == 1)
- {
- var type = list[0];
- if (doNotUseReportsWithIdentifier)
- {
- var attrs = type.GetCustomAttributes(typeof(IDSpecificClassAttribute), true);
- if (attrs.Length == 0)
- return Activator.CreateInstance(type) as IBeWoReport;
- }
- else
- {
- result = Activator.CreateInstance(type) as IBeWoReport;
- }
-
- }
- else if (list.Count > 1)
- {
- foreach (var type in list)
- {
- var attrs = type.GetCustomAttributes(typeof (IDSpecificClassAttribute), true);
- if (attrs.Length == 0)
- return Activator.CreateInstance(type) as IBeWoReport;
- }
- if (!doNotUseReportsWithIdentifier)
- {
- result = Activator.CreateInstance(list[0]) as IBeWoReport;
- }
- }
-
- }
-
- return result;
- }
-
- public override XtraReport CreateCustomerDataReport(long customerOid)
- {
- var lCustomerDataReport = FindReportImp();
- lCustomerDataReport.SetReportDataSource(CustomerDataRO.Create(MapperFactory.CustomerDC_Customer.MapToNewDC(DAOFactory.GenericDAO.LoadByID(customerOid))));
- return lCustomerDataReport as XtraReport;
- }
-
- public override XtraReport CreateCustomerInvoiceReport(long invoiceOid)
- {
-
- IBeWoReport lInvoiceCustomerReport = FindReportImp();
- lInvoiceCustomerReport.SetReportDataSource(InvoiceCustomerRO.Create(MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDC(DAOFactory.GenericDAO.LoadByID(invoiceOid))));
- return lInvoiceCustomerReport as XtraReport;
- }
-
- public override XtraReport CreateAssessmentSheetReport(long customerOid, int month, int year)
- {
- IBeWoReport report = FindReportImp();
- report.SetReportDataSource(AssessmentSheetRO.Create(DAOFactory.GenericDAO.LoadByID(customerOid), new DateTime(year, month, 1)));
- return report as XtraReport;
- }
-
- public override XtraReport CreateFlsReport(String flsReportId, String subType)
- {
- string flsReportPath = Path.Combine(TempPath, flsReportId + ".xml");
- var lFLSAnalysisDataReportDC = Utils.XMLDeserialize(flsReportPath);
+ if (Tenant != null && File.Exists(ReportPath))
+ {
+ lAllReportTypes = Assembly.LoadFrom(ReportPath).GetTypes();
+ result = FindReportImp(lAllReportTypes, specificReportId, typename, true);
+ }
- IBeWoReport lFLSReportObject = null;
+ if (result == null)
+ {
+ lAllReportTypes = typeof(IBeWoReport).Assembly.GetTypes();
+ result = FindReportImp(lAllReportTypes, specificReportId, typename, false);
+ }
- if (!String.IsNullOrEmpty(subType))
- lFLSReportObject = this.FindReportImp(subType);
+ return result;
+ }
- if (lFLSReportObject == null)
- lFLSReportObject = this.FindReportImp(lFLSAnalysisDataReportDC.ShowGroups
- ? "FLSAuswertung"
- : "Leistungsdokumentation");
+ public IBeWoReport FindReportImp(Type[] lAllReportTypes, string specificReportId, string typename, bool doNotUseReportsWithIdentifier)
+ {
+ IBeWoReport result = null;
- lFLSReportObject.SetReportDataSource(FLSReportRO.Create(lFLSAnalysisDataReportDC));
- return lFLSReportObject as XtraReport;
- }
+ if (!string.IsNullOrEmpty(specificReportId) && !string.IsNullOrEmpty(typename))
+ {
+ var cbSpecific = lAllReportTypes
+ .Where(i => typeof(IBeWoReport).IsAssignableFrom(i))
+ .FirstOrDefault(t => t.GetCustomAttributes(typeof(IDSpecificClassAttribute), true)
+ .ToList()
+ .Exists(i =>
+ {
+ var attr = (IDSpecificClassAttribute)i;
+ if (attr.Identifiers != null)
+ return attr.Identifiers.Contains(specificReportId);
+ if (!String.IsNullOrEmpty(attr.Identifier))
+ return attr.Identifier.Equals(specificReportId);
+ return false;
- public override XtraReport CreateQueryReport(long queryOid, String queryReportId)
- {
- var query = DAOFactory.GenericDAO.LoadByID(queryOid);
+ }
+ ) && t.FullName == typename);
+ if (cbSpecific != null)
+ result = Activator.CreateInstance(cbSpecific) as IBeWoReport;
+ }
- if (query == null)
- return new XtraReport();
-
- var path = Path.Combine(TempPath, queryReportId + ".xml");
+ if (!string.IsNullOrEmpty(typename))
+ {
+ var cbSpecific = lAllReportTypes.FirstOrDefault(t => t.FullName == typename);
+ if (cbSpecific != null)
+ result = Activator.CreateInstance(cbSpecific) as IBeWoReport;
+ }
- var table = Utils.XMLDeserialize(path);
+ if (!string.IsNullOrEmpty(specificReportId))
+ {
+ var cbSpecific = lAllReportTypes
+ .Where(i => typeof(IBeWoReport).IsAssignableFrom(i))
+ .FirstOrDefault(t => t.GetCustomAttributes(typeof(IDSpecificClassAttribute), true)
+ .ToList()
+ .Exists(i =>
+ {
+ var attr = (IDSpecificClassAttribute)i;
+ if (attr.Identifiers != null)
+ return attr.Identifiers.Contains(specificReportId);
+ if (!String.IsNullOrEmpty(attr.Identifier))
+ return attr.Identifier.Equals(specificReportId);
+ return false;
- var queryReport = FindReportImp(null, query.ReportTypeName);
- queryReport.SetReportDataSource(QueryRO.Create(query, table));
+ }
+ ));
+ if (cbSpecific != null)
+ result = Activator.CreateInstance(cbSpecific) as IBeWoReport;
+ }
- return queryReport as XtraReport;
- }
+ if (result == null)
+ {
+ foreach (var iType in lAllReportTypes)
+ if (typeof(IBeWoReport).IsAssignableFrom(iType))
+ if (iType.Name == specificReportId)
+ result = Activator.CreateInstance(iType) as IBeWoReport;
+ }
- public override XtraReport CreateServiceInvoiceReport(String dcIds, long? invoiceBaseOid)
- {
- if (String.IsNullOrEmpty(dcIds) && invoiceBaseOid.HasValue)
- {
- var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoiceBaseOid.Value);
- dcIds = String.Format("{0}", serviceInvoice.Oid);
- }
+ if (result == null)
+ {
+ var list = lAllReportTypes.Where(t => typeof(IBeWoReport).IsAssignableFrom(t)).ToList();
- if (!string.IsNullOrEmpty(dcIds))
- {
- var serviceInvoiceOid2CostbearerId = new Dictionary();
- var dcList = new List();
+ if (list.Count == 1)
+ {
+ var type = list[0];
+ if (doNotUseReportsWithIdentifier)
+ {
+ var attrs = type.GetCustomAttributes(typeof(IDSpecificClassAttribute), true);
+ if (attrs.Length == 0)
+ return Activator.CreateInstance(type) as IBeWoReport;
+ }
+ else
+ {
+ result = Activator.CreateInstance(type) as IBeWoReport;
+ }
- var dcidStrs = dcIds.Split(';');
- foreach (var oidStr in dcidStrs)
- {
- var oid = long.Parse(oidStr);
- var invoice = DAOFactory.GenericDAO.LoadByID(oid);
- var dc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(invoice);
- dcList.Add(dc);
+ }
+ else if (list.Count > 1)
+ {
+ foreach (var type in list)
+ {
+ var attrs = type.GetCustomAttributes(typeof(IDSpecificClassAttribute), true);
+ if (attrs.Length == 0)
+ return Activator.CreateInstance(type) as IBeWoReport;
+ }
+ if (!doNotUseReportsWithIdentifier)
+ {
+ result = Activator.CreateInstance(list[0]) as IBeWoReport;
+ }
+ }
- if (serviceInvoiceOid2CostbearerId.ContainsKey(oid))
- continue;
+ }
- if (!String.IsNullOrEmpty(invoice.InvoiceBase.InvoiceId))
- serviceInvoiceOid2CostbearerId.Add(oid, invoice.InvoiceBase.InvoiceId);
- else
- {
- foreach (var period in invoice.ServiceInvoicePeriodList)
- {
- try
- {
- if (period.SupportConceptApprovalPeriod != null)
- {
- AddCostBearerIdToDict(oid, serviceInvoiceOid2CostbearerId,
- period.SupportConceptApprovalPeriod.CostBearer2SupportConcept);
+ return result;
+ }
- }
- foreach (var item in period.InvoiceItemList)
- {
- if (item.SupportConceptApprovalPeriodOid.HasValue)
- {
- var approvalPeriod =
- DAOFactory.GenericDAO.LoadByID(item.SupportConceptApprovalPeriodOid.Value);
- if (approvalPeriod.CostBearer2SupportConcept != null)
- {
- AddCostBearerIdToDict(oid, serviceInvoiceOid2CostbearerId, approvalPeriod.CostBearer2SupportConcept);
- }
- }
- }
- }
- catch (Exception)
- {
- //ignore
- }
-
- }
- }
- }
+ public override XtraReport CreateCustomerDataReport(long customerOid)
+ {
+ var lCustomerDataReport = FindReportImp();
+ lCustomerDataReport.SetReportDataSource(CustomerDataRO.Create(MapperFactory.CustomerDC_Customer.MapToNewDC(DAOFactory.GenericDAO.LoadByID(customerOid))));
+ return lCustomerDataReport as XtraReport;
+ }
- IBeWoReport allReports = null;
+ public override XtraReport CreateCustomerInvoiceReport(long invoiceOid)
+ {
- foreach (var iDC in dcList)
- {
- String reportId = null;
- if (serviceInvoiceOid2CostbearerId.ContainsKey(iDC.ServiceInvoiceOid.Value))
- reportId = serviceInvoiceOid2CostbearerId[iDC.ServiceInvoiceOid.Value];
+ IBeWoReport lInvoiceCustomerReport = FindReportImp();
+ lInvoiceCustomerReport.SetReportDataSource(InvoiceCustomerRO.Create(MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDC(DAOFactory.GenericDAO.LoadByID(invoiceOid))));
+ return lInvoiceCustomerReport as XtraReport;
+ }
- IBeWoReport singleReport = FindReportImp(reportId);
+ public override XtraReport CreateAssessmentSheetReport(long customerOid, int month, int year)
+ {
+ IBeWoReport report = FindReportImp();
+ report.SetReportDataSource(AssessmentSheetRO.Create(DAOFactory.GenericDAO.LoadByID(customerOid), new DateTime(year, month, 1)));
+ return report as XtraReport;
+ }
- singleReport.SetReportDataSource(ServiceInvoiceRO.Create(iDC));
- ((XtraReport)singleReport).CreateDocument();
- if (allReports == null)
- allReports = singleReport;
- else
- ((XtraReport)allReports).Pages.AddRange(((XtraReport)singleReport).Pages);
- }
+ public override XtraReport CreateFlsReport(String flsReportId, String subType)
+ {
+ string flsReportPath = Path.Combine(TempPath, flsReportId + ".xml");
+ var lFLSAnalysisDataReportDC = Utils.XMLDeserialize(flsReportPath);
- return allReports as XtraReport;
- }
- return new XtraReport();
- }
+
+ IBeWoReport lFLSReportObject = null;
+
+ if (!String.IsNullOrEmpty(subType))
+ lFLSReportObject = this.FindReportImp(subType);
+
+ if (lFLSReportObject == null)
+ lFLSReportObject = this.FindReportImp(lFLSAnalysisDataReportDC.ShowGroups
+ ? "FLSAuswertung"
+ : "Leistungsdokumentation");
+
+ lFLSReportObject.SetReportDataSource(FLSReportRO.Create(lFLSAnalysisDataReportDC));
+ return lFLSReportObject as XtraReport;
+ }
+
+ public override XtraReport CreateQueryReport(long queryOid, String queryReportId)
+ {
+ var query = DAOFactory.GenericDAO.LoadByID(queryOid);
+
+ if (query == null)
+ return new XtraReport();
+
+ var path = Path.Combine(TempPath, queryReportId + ".xml");
+
+ var table = Utils.XMLDeserialize(path);
+
+ var queryReport = FindReportImp(null, query.ReportTypeName);
+ queryReport.SetReportDataSource(QueryRO.Create(query, table));
+
+ return queryReport as XtraReport;
+ }
+
+ public override XtraReport CreateServiceInvoiceReport(String dcIds, long? invoiceBaseOid)
+ {
+ if (String.IsNullOrEmpty(dcIds) && invoiceBaseOid.HasValue)
+ {
+ var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoiceBaseOid.Value);
+ dcIds = String.Format("{0}", serviceInvoice.Oid);
+ }
+
+ if (!string.IsNullOrEmpty(dcIds))
+ {
+ var serviceInvoiceOid2CostbearerId = new Dictionary();
+ var dcList = new List();
+
+ var dcidStrs = dcIds.Split(';');
+ foreach (var oidStr in dcidStrs)
+ {
+ var oid = long.Parse(oidStr);
+ var invoice = DAOFactory.GenericDAO.LoadByID(oid);
+ var dc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(invoice);
+ dcList.Add(dc);
+
+ if (serviceInvoiceOid2CostbearerId.ContainsKey(oid))
+ continue;
+
+ if (!String.IsNullOrEmpty(invoice.InvoiceBase.InvoiceId))
+ serviceInvoiceOid2CostbearerId.Add(oid, invoice.InvoiceBase.InvoiceId);
+ else
+ {
+ foreach (var period in invoice.ServiceInvoicePeriodList)
+ {
+ try
+ {
+ if (period.SupportConceptApprovalPeriod != null)
+ {
+ AddCostBearerIdToDict(oid, serviceInvoiceOid2CostbearerId,
+ period.SupportConceptApprovalPeriod.CostBearer2SupportConcept);
+
+ }
+ foreach (var item in period.InvoiceItemList)
+ {
+ if (item.SupportConceptApprovalPeriodOid.HasValue)
+ {
+ var approvalPeriod =
+ DAOFactory.GenericDAO.LoadByID(item.SupportConceptApprovalPeriodOid.Value);
+ if (approvalPeriod.CostBearer2SupportConcept != null)
+ {
+ AddCostBearerIdToDict(oid, serviceInvoiceOid2CostbearerId, approvalPeriod.CostBearer2SupportConcept);
+ }
+ }
+ }
+ }
+ catch (Exception)
+ {
+ //ignore
+ }
+
+ }
+ }
+ }
+
+ IBeWoReport allReports = null;
+
+ foreach (var iDC in dcList)
+ {
+ String reportId = null;
+ if (serviceInvoiceOid2CostbearerId.ContainsKey(iDC.ServiceInvoiceOid.Value))
+ reportId = serviceInvoiceOid2CostbearerId[iDC.ServiceInvoiceOid.Value];
+
+ IBeWoReport singleReport = FindReportImp(reportId);
+
+ singleReport.SetReportDataSource(ServiceInvoiceRO.Create(iDC));
+ ((XtraReport)singleReport).CreateDocument();
+ if (allReports == null)
+ allReports = singleReport;
+ else
+ ((XtraReport)allReports).Pages.AddRange(((XtraReport)singleReport).Pages);
+ }
+
+ return allReports as XtraReport;
+ }
+ return new XtraReport();
+ }
public virtual void AddCostBearerIdToDict(long serviceInvoiceOid, Dictionary serviceInvoiceOid2CostbearerId, CostBearer2SupportConcept c2s)
- {
- if (c2s != null && c2s.CostBearer != null)
- {
- var id = c2s.CostBearer.ID;
- if (String.IsNullOrEmpty(id) && c2s.CostBearer.IsSingleInvoicePerCustomer)
- id = "Sammelrechnung";
- if (!serviceInvoiceOid2CostbearerId.ContainsKey(serviceInvoiceOid))
- serviceInvoiceOid2CostbearerId.Add(serviceInvoiceOid, id);
- }
- }
+ {
+ if (c2s != null && c2s.CostBearer != null)
+ {
+ var id = c2s.CostBearer.ID;
+ if (String.IsNullOrEmpty(id) && c2s.CostBearer.IsSingleInvoicePerCustomer)
+ id = "Sammelrechnung";
+ if (!serviceInvoiceOid2CostbearerId.ContainsKey(serviceInvoiceOid))
+ serviceInvoiceOid2CostbearerId.Add(serviceInvoiceOid, id);
+ }
+ }
- public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
- {
- var os = new OperationsServiceImp();
- var m = os.GetMandator2(false);
- if (m.AllowSbd)
- {
- return CreateSbdLeistungsnachweisForAllCustomers(month, year, orgaOid, empOid, serviceCategoryOid ?? 0, startDay, endDay);
- }
+ public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
+ {
+ var os = new OperationsServiceImp();
+ var m = os.GetMandator2(false);
+ if (m.AllowSbd)
+ {
+ return CreateSbdLeistungsnachweisForAllCustomers(month, year, orgaOid, empOid, serviceCategoryOid ?? 0, startDay, endDay);
+ }
List lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
- if (lROs.Count > 0)
- {
- String reportId = null;
- if (orgaOid > 0)
- {
- var organisation = DAOFactory.GenericDAO.LoadByID(orgaOid);
- if (organisation != null)
- reportId = organisation.Name;
- }
+ if (lROs.Count > 0)
+ {
+ String reportId = null;
+ if (orgaOid > 0)
+ {
+ var organisation = DAOFactory.GenericDAO.LoadByID(orgaOid);
+ if (organisation != null)
+ reportId = organisation.Name;
+ }
var lServiceOverviewAllCustomersReport = this.FindReportImp(reportId);
- lServiceOverviewAllCustomersReport.SetReportDataSource(lROs[0]);
- (lServiceOverviewAllCustomersReport as XtraReport).CreateDocument();
- var Report = lServiceOverviewAllCustomersReport as XtraReport;
+ lServiceOverviewAllCustomersReport.SetReportDataSource(lROs[0]);
+ (lServiceOverviewAllCustomersReport as XtraReport).CreateDocument();
+ var Report = lServiceOverviewAllCustomersReport as XtraReport;
- for (int i = 1; i < lROs.Count; i++)
- {
- var lNext = FindReportImp(reportId);
- lNext.SetReportDataSource(lROs[i]);
- (lNext as XtraReport).CreateDocument();
- Report.Pages.AddRange((lNext as XtraReport).Pages);
- }
+ for (int i = 1; i < lROs.Count; i++)
+ {
+ var lNext = FindReportImp(reportId);
+ lNext.SetReportDataSource(lROs[i]);
+ (lNext as XtraReport).CreateDocument();
+ Report.Pages.AddRange((lNext as XtraReport).Pages);
+ }
- return lServiceOverviewAllCustomersReport as XtraReport;
- }
- return new XtraReport();
- }
-
- public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
- {
- var os = new OperationsServiceImp();
- var m = os.GetMandator2(false);
- if (m.AllowSbd)
- {
- return CreateSbdLeistungsnachweisForSingleCustomerReport(customerOid, month, year, orgaOid, empOid, serviceCategoryOid ?? 0, startDay, endDay);
+ return lServiceOverviewAllCustomersReport as XtraReport;
+ }
+ return new XtraReport();
+ }
- }
+ public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
+ {
+ var os = new OperationsServiceImp();
+ var m = os.GetMandator2(false);
+ if (m.AllowSbd)
+ {
+ return CreateSbdLeistungsnachweisForSingleCustomerReport(customerOid, month, year, orgaOid, empOid, serviceCategoryOid ?? 0, startDay, endDay);
+
+ }
String reportId = null;
- if (orgaOid > 0)
- {
- var organisation = DAOFactory.GenericDAO.LoadByID(orgaOid);
- if (organisation != null)
- reportId = organisation.Name;
- }
+ if (orgaOid > 0)
+ {
+ var organisation = DAOFactory.GenericDAO.LoadByID(orgaOid);
+ if (organisation != null)
+ reportId = organisation.Name;
+ }
var lServiceOverviewSingleCustomerReport = this.FindReportImp