Urlaubskonto Berechnung
Urlaubskonto Anzeige AbwesenheitsView
This commit is contained in:
@@ -329,6 +329,14 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\Detail\Report\AbwesenheitsEmployeeHeaderTooltip.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\Detail\Report\AbwesenheitsEmployeeHeader.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\Detail\Report\DienstplanerView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -337,7 +345,7 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\Detail\Report\AbwesenheitstabelleView.xaml">
|
||||
<Page Include="View\Detail\Report\AbwesenheitsView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -977,11 +985,17 @@
|
||||
<Compile Include="View\Detail\AbsenceTimesView.xaml.cs">
|
||||
<DependentUpon>AbsenceTimesView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\Report\AbwesenheitsEmployeeHeaderTooltip.xaml.cs">
|
||||
<DependentUpon>AbwesenheitsEmployeeHeaderTooltip.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\Report\AbwesenheitsEmployeeHeader.xaml.cs">
|
||||
<DependentUpon>AbwesenheitsEmployeeHeader.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\Report\DienstplanerView.xaml.cs">
|
||||
<DependentUpon>DienstplanerView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\Report\AbwesenheitstabelleView.xaml.cs">
|
||||
<DependentUpon>AbwesenheitstabelleView.xaml</DependentUpon>
|
||||
<Compile Include="View\Detail\Report\AbwesenheitsView.xaml.cs">
|
||||
<DependentUpon>AbwesenheitsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\Report\AbwesenheitsEditView.xaml.cs">
|
||||
<DependentUpon>AbwesenheitsEditView.xaml</DependentUpon>
|
||||
|
||||
@@ -1321,6 +1321,7 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<string>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary<long, string>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary<long, BS.Shared.ValueListEntryType>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary<int, BS.Shared.DataContracts.UrlaubskontoDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFault))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFaultType))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.OvertimeDC>))]
|
||||
@@ -1351,6 +1352,7 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.ValueListEntryDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.CustomerEmployeeRelationDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.CustomerEmployeeRelationDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.UrlaubskontoDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeAPPCodeDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.EmployeeAPPCodeDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeTokenRelationDC>))]
|
||||
@@ -1517,12 +1519,7 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Employee2SchedulerAppointmentDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Employee2SchedulerAppointmentDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary<BS.Shared.DataContracts.ValueListEntryDC, System.Collections.Generic.List<BS.Shared.DataContracts.ResourceDC>>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisRootDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Reports.AuslastungAnalysisEmployeeDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisEmployeeDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Reports.AuslastungAnalysisSupportConceptDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisSupportConceptDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Tuple<System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Compact.CompactTokenDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.FlexibleReportFilterDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.ServiceDescriptionDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.FlexibleReportResultDC))]
|
||||
@@ -1545,6 +1542,7 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.DienstBlockDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.DienstBlockDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.DienstEintragDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AbsenceOverviewFilterDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.BargeldkassenDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BargeldkassenDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.BargeldtransaktionDC>))]
|
||||
@@ -1640,7 +1638,11 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary<BS.Shared.DataContracts.Compact.CompactCustomerDC, bool>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary<long, bool>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.Dictionary<BS.Shared.DataContracts.ServiceRecordDC, System.Collections.Generic.List<BS.Shared.ServiceRecordValidationResult>>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Compact.CompactTokenDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisRootDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Reports.AuslastungAnalysisEmployeeDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisEmployeeDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Reports.AuslastungAnalysisSupportConceptDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AuslastungAnalysisSupportConceptDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Reports.AuslastungAnalysisRootDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.Reports.AccountingReportDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.Reports.AccountingReportRowDC>))]
|
||||
@@ -4742,26 +4744,6 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetReportTemplatesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.ReportTemplateDC> GetReportTemplates(string url);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee11", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee11Response")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeDCEmployee11BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
System.Tuple<System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> 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<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee21(System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceReasonDC> absenceReasons, System.Collections.Generic.List<BS.Shared.DataContracts.EmploymentTypeDC> 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<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> 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<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee41(System.DateTime start, System.DateTime end, System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceReasonDC> absenceReasons, System.Collections.Generic.List<BS.Shared.DataContracts.EmploymentTypeDC> 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<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee51(System.DateTime start, System.DateTime end, System.Collections.Generic.List<long> absenceReasonIDs, System.Collections.Generic.List<long> employmentTypeIDs);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAllAbsenceReason", ReplyAction="http://tempuri.org/IOperationsService/GetAllAbsenceReasonResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAllAbsenceReasonBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceReasonDC> GetAllAbsenceReason();
|
||||
@@ -4875,6 +4857,14 @@ namespace BeWo.ServiceProxy
|
||||
"ult", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC> GetAbsenceTimeVacationByWohnheim(long wohnId, int year, int month);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceOverview", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceOverviewResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceOverviewBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC> GetAbsenceOverview(BS.Shared.DataContracts.AbsenceOverviewFilterDC filter);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetUrlaubskontoByEmployee", ReplyAction="http://tempuri.org/IOperationsService/GetUrlaubskontoByEmployeeResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetUrlaubskontoByEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
BS.Shared.DataContracts.UrlaubskontoDC GetUrlaubskontoByEmployee(long empOid, int year);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCResponse" +
|
||||
"")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCBeWoFaul" +
|
||||
@@ -5820,31 +5810,6 @@ namespace BeWo.ServiceProxy
|
||||
return base.Channel.GetReportTemplates(url);
|
||||
}
|
||||
|
||||
public System.Tuple<System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee11()
|
||||
{
|
||||
return base.Channel.GetAbsenceTimeDCEmployee11();
|
||||
}
|
||||
|
||||
public System.Tuple<System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee21(System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceReasonDC> absenceReasons, System.Collections.Generic.List<BS.Shared.DataContracts.EmploymentTypeDC> employmentTypes)
|
||||
{
|
||||
return base.Channel.GetAbsenceTimeDCEmployee21(absenceReasons, employmentTypes);
|
||||
}
|
||||
|
||||
public System.Tuple<System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee31(System.DateTime start, System.DateTime end)
|
||||
{
|
||||
return base.Channel.GetAbsenceTimeDCEmployee31(start, end);
|
||||
}
|
||||
|
||||
public System.Tuple<System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee41(System.DateTime start, System.DateTime end, System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceReasonDC> absenceReasons, System.Collections.Generic.List<BS.Shared.DataContracts.EmploymentTypeDC> employmentTypes)
|
||||
{
|
||||
return base.Channel.GetAbsenceTimeDCEmployee41(start, end, absenceReasons, employmentTypes);
|
||||
}
|
||||
|
||||
public System.Tuple<System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceTimeDC>, System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC>> GetAbsenceTimeDCEmployee51(System.DateTime start, System.DateTime end, System.Collections.Generic.List<long> absenceReasonIDs, System.Collections.Generic.List<long> employmentTypeIDs)
|
||||
{
|
||||
return base.Channel.GetAbsenceTimeDCEmployee51(start, end, absenceReasonIDs, employmentTypeIDs);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.AbsenceReasonDC> GetAllAbsenceReason()
|
||||
{
|
||||
return base.Channel.GetAllAbsenceReason();
|
||||
@@ -5970,6 +5935,16 @@ namespace BeWo.ServiceProxy
|
||||
return base.Channel.GetAbsenceTimeVacationByWohnheim(wohnId, year, month);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.EmployeeDC> GetAbsenceOverview(BS.Shared.DataContracts.AbsenceOverviewFilterDC filter)
|
||||
{
|
||||
return base.Channel.GetAbsenceOverview(filter);
|
||||
}
|
||||
|
||||
public BS.Shared.DataContracts.UrlaubskontoDC GetUrlaubskontoByEmployee(long empOid, int year)
|
||||
{
|
||||
return base.Channel.GetUrlaubskontoByEmployee(empOid, year);
|
||||
}
|
||||
|
||||
public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType)
|
||||
{
|
||||
base.Channel.UpdateIsChatActiveCustomerAPPCodeDC(customerOid, activeType);
|
||||
|
||||
@@ -20,42 +20,33 @@ using SchedulerControl = DevExpress.Xpf.Scheduler.SchedulerControl;
|
||||
|
||||
namespace BeWo.View.Detail.Report
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für TestEMailControl.xaml
|
||||
/// </summary>
|
||||
public partial class AbwesenheitsEditView : UserControl
|
||||
{
|
||||
private SchedulerControl _SchedulerControl;
|
||||
private AbwesenheitstabelleView Parent;
|
||||
|
||||
public bool IsEditMode { get; set; }
|
||||
public AbsenceTimeDC AbsenceTime { get; set; }
|
||||
public Appointment Appointment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Für Appointment-Bearbeitung
|
||||
/// </summary>
|
||||
/// <param name="appointment"></param>
|
||||
/// <param name="absenceTimeDC"></param>
|
||||
/// <param name="reasons"></param>
|
||||
public AbwesenheitsEditView(SchedulerControl schedulerControl, Appointment appointment, AbsenceTimeDC absenceTimeDC, List<AbsenceReasonDC> reasons)
|
||||
|
||||
public AbwesenheitsEditView(AbwesenheitstabelleView abwesenheitstabelleView, Appointment appointment, List<AbsenceReasonDC> reasons)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_SchedulerControl = schedulerControl;
|
||||
Parent = abwesenheitstabelleView;
|
||||
|
||||
_ReasonPicker.Items.AddRange(reasons.ToArray());
|
||||
Appointment = appointment;
|
||||
|
||||
IsEditMode = appointment.CustomFields["AbsenceTime"] != null;
|
||||
IsEditMode = (AbsenceTimeDC)appointment.CustomFields[nameof(AbsenceTimeDC)] != null;
|
||||
|
||||
if (IsEditMode)
|
||||
{
|
||||
_DeleteBtn.Visibility = Visibility.Visible;
|
||||
|
||||
AbsenceTime = absenceTimeDC;
|
||||
AbsenceTime = (AbsenceTimeDC)appointment.CustomFields[nameof(AbsenceTimeDC)];
|
||||
|
||||
_ReasonPicker.SelectedItem = absenceTimeDC.Reason;
|
||||
_NoticeTxt.Text = absenceTimeDC.Notice;
|
||||
_ReasonPicker.SelectedItem = AbsenceTime.Reason;
|
||||
_NoticeTxt.Text = AbsenceTime.Notice;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -79,17 +70,17 @@ namespace BeWo.View.Detail.Report
|
||||
{
|
||||
if (MessageBox.Show("Möchten Sie den Eintrag wirklich löschen?", "Eintrag löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes)
|
||||
return;
|
||||
|
||||
_SchedulerControl.Storage.AppointmentStorage.Remove(Appointment);
|
||||
ServiceFacade.DoOperationsServiceAsync(x => x.DeleteAbsenceTime(AbsenceTime));
|
||||
|
||||
Parent._SchedulerControl.Storage.AppointmentStorage.Remove(Appointment);
|
||||
ServiceFacade.DoOperationsServiceSync(x => x.DeleteAbsenceTime(AbsenceTime));
|
||||
|
||||
SchedulerFormBehavior.Close(this, true);
|
||||
|
||||
Parent.UpdateUrlaubkonto(AbsenceTime.EmployeeOid.Value);
|
||||
}
|
||||
|
||||
private void SaveBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
var start = _DatePickerStartDate.DateTime;
|
||||
var end = string.IsNullOrEmpty(_DatePickerEndDate.Text) ? null : _DatePickerEndDate.DateTime as DateTime?;
|
||||
|
||||
@@ -110,18 +101,20 @@ namespace BeWo.View.Detail.Report
|
||||
|
||||
var t = AbsenceTime.AbsenceTimeVersion;
|
||||
|
||||
SchedulerHelper.OverrideAWithB(Appointment, AbsenceTime);
|
||||
SchedulerHelper.OverrideAppointmentWithAbsenceTime(Appointment, AbsenceTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
AbsenceTime = ServiceFacade.DoOperationsServiceSync(x => x.InsertAbsenceTimeWithReturn(AbsenceTime));
|
||||
|
||||
SchedulerHelper.OverrideAWithB(Appointment, AbsenceTime);
|
||||
SchedulerHelper.OverrideAppointmentWithAbsenceTime(Appointment, AbsenceTime);
|
||||
|
||||
_SchedulerControl.Storage.AppointmentStorage.Add(Appointment);
|
||||
Parent._SchedulerControl.Storage.AppointmentStorage.Add(Appointment);
|
||||
}
|
||||
|
||||
SchedulerFormBehavior.Close(this, true);
|
||||
|
||||
Parent.UpdateUrlaubkonto(AbsenceTime.EmployeeOid.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml
Normal file
15
BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml
Normal file
@@ -0,0 +1,15 @@
|
||||
<UserControl x:Class="BeWo.View.Detail.Report.AbwesenheitsEmployeeHeader"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
mc:Ignorable="d"
|
||||
Height="Auto" Width="Auto">
|
||||
<Grid >
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock x:Name="_EmployeeName" Text="Max, Mustermann" HorizontalAlignment="Left" Foreground="White" />
|
||||
<TextBlock x:Name="_EmployeeUrlaub" Text="40 Urlaubstage" HorizontalAlignment="Left" Foreground="White" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
56
BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml.cs
Normal file
56
BeWo/View/Detail/Report/AbwesenheitsEmployeeHeader.xaml.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.Xpf.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BeWo.View.Detail.Report
|
||||
{
|
||||
public partial class AbwesenheitsEmployeeHeader : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty EmployeeDCProperty = DependencyProperty.Register(
|
||||
"EmployeeDC",
|
||||
typeof(EmployeeDC),
|
||||
typeof(AbwesenheitsEmployeeHeader),
|
||||
new UIPropertyMetadata(
|
||||
(s, e) =>
|
||||
{
|
||||
var dc = (EmployeeDC)e.NewValue;
|
||||
var c = (AbwesenheitsEmployeeHeader)s;
|
||||
|
||||
if (c != null)
|
||||
{
|
||||
if (dc != null)
|
||||
{
|
||||
c._EmployeeName.Text = dc.LastNameFirstName;
|
||||
c._EmployeeUrlaub.Text = $"Urlaub: {dc.Urlaubskonto.Resturlaub.ToString("0.00")}/{dc.Urlaubskonto.Urlaubsanspruch.ToString("0.00")} Tage";
|
||||
((AbwesenheitsEmployeeHeaderTooltip)c.ToolTip).Set(dc);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
public AbwesenheitsEmployeeHeader()
|
||||
{
|
||||
InitializeComponent();
|
||||
ToolTip = new AbwesenheitsEmployeeHeaderTooltip();
|
||||
}
|
||||
|
||||
public EmployeeDC EmployeeDC
|
||||
{
|
||||
get { return (EmployeeDC)GetValue(EmployeeDCProperty); }
|
||||
|
||||
set { SetValue(EmployeeDCProperty, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<UserControl x:Class="BeWo.View.Detail.Report.AbwesenheitsEmployeeHeaderTooltip"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
mc:Ignorable="d"
|
||||
Height="Auto" Width="Auto">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Resturlaub Vorjahr" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
<TextBlock x:Name="_TxtResturlaubVorjahr" Text="35,00 Tage" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
<TextBlock Text="Urlaubsanspruch Vorjahr" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
<TextBlock x:Name="_TxtUrlaubsanspruchVorjahr" Text="35,00 Tage" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
|
||||
<TextBlock Text="Resturlaub" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
<TextBlock x:Name="_TxtResturlaub" Text="35,00 Tage" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
<TextBlock Text="Urlaubsanspruch" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
<TextBlock x:Name="_TxtUrlaubsanspruch" Text="35,00 Tage" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" Foreground="Black" Margin="3"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,37 @@
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.Xpf.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BeWo.View.Detail.Report
|
||||
{
|
||||
public partial class AbwesenheitsEmployeeHeaderTooltip : UserControl
|
||||
{
|
||||
public AbwesenheitsEmployeeHeaderTooltip()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Set(EmployeeDC emp)
|
||||
{
|
||||
var konto = emp.Urlaubskonto;
|
||||
|
||||
_TxtResturlaub.Text = konto.Resturlaub.ToString("0.00") + " Tage";
|
||||
_TxtResturlaubVorjahr.Text = konto.ResturlaubVorjahr.ToString("0.00") + " Tage";
|
||||
_TxtUrlaubsanspruch.Text = konto.Urlaubsanspruch.ToString("0.00") + " Tage";
|
||||
_TxtUrlaubsanspruchVorjahr.Text = konto.ResturlaubVorjahrTotal.ToString("0.00") + " Tage";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,9 @@
|
||||
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
|
||||
xmlns:dxschi="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal"
|
||||
xmlns:XtraScheduler="clr-namespace:DevExpress.XtraScheduler;assembly=DevExpress.XtraScheduler.v17.1.Core"
|
||||
x:Class="BeWo.View.Detail.Report.AbwesenheitstabelleView"
|
||||
xmlns:controls="clr-namespace:BeWo.View.Controls"
|
||||
xmlns:report="clr-namespace:BeWo.View.Detail.Report"
|
||||
x:Class="BeWo.View.Detail.Report.AbwesenheitstabelleView"
|
||||
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" Focusable="True">
|
||||
|
||||
@@ -21,9 +23,9 @@
|
||||
<ControlTemplate TargetType="{x:Type dxschi:VisualResourceHeader}">
|
||||
<Grid>
|
||||
<dxschi:VerticalHeaderControl SnapsToDevicePixels="True"
|
||||
ResourceColor="{Binding ResourceHeader.Brushes.ResourceHeader}"
|
||||
Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
dxschi:SchedulerItemsControl.ElementPosition="{Binding (dxschi:SchedulerItemsControl.ElementPosition), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ResourceColor="{Binding ResourceHeader.Brushes.ResourceHeader}"
|
||||
Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
dxschi:SchedulerItemsControl.ElementPosition="{Binding (dxschi:SchedulerItemsControl.ElementPosition), RelativeSource={RelativeSource TemplatedParent}}"
|
||||
/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -32,11 +34,9 @@
|
||||
<Setter Property="ContentTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" SnapsToDevicePixels="True" Margin="4"
|
||||
FontSize="12"
|
||||
Foreground="White"
|
||||
Text="{Binding ResourceCaption}"
|
||||
/>
|
||||
<Grid>
|
||||
<report:AbwesenheitsEmployeeHeader EmployeeDC="{Binding CustomFields[EmployeeDC]}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
@@ -47,7 +47,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" MinWidth="10"/>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -56,72 +56,41 @@
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<!--Erste Zeile Links-->
|
||||
<Grid Grid.Column="0" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Abwesenheitskategorie" Margin="3,3,0,3" />
|
||||
<dxe:ComboBoxEdit x:Name="FilterAbwesenheit" Grid.Column="1" Grid.Row="0" Margin="0,3,3,3" DisplayMember="Description">
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal">
|
||||
<Label Grid.Column="2" Margin="3,3,0,3" Content="Datum:" />
|
||||
<controls:MonthPicker Grid.Column="3" x:Name="_MonthPicker" Margin="0,3,3,3" MinWidth="84" HorizontalContentAlignment="Right" />
|
||||
<dxe:ComboBoxEdit Grid.Column="4" x:Name="_YearPicker" Margin="0,3,3,3" IsManipulationEnabled="False" MinWidth="60" HorizontalContentAlignment="Right"/>
|
||||
<Button Content="Erstellen" Margin="3" MinWidth="100" Click="Button_Click"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal">
|
||||
<Label Content="Anzahl der angezeigten Tage"/>
|
||||
<dxe:SpinEdit x:Name="_SpinEdit" Margin="3" AllowNullInput="False" Height="23" Width="50" IsFloatValue="False" EditValueChanged="SpinEdit_EditValueChanged"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal">
|
||||
<Label Content="Abwesenheitskategorie" Margin="3,3,0,3" />
|
||||
<dxe:ComboBoxEdit x:Name="FilterAbwesenheit" Margin="0,3,3,3" DisplayMember="Description">
|
||||
<dxe:ComboBoxEdit.StyleSettings>
|
||||
<dxe:CheckedComboBoxStyleSettings />
|
||||
</dxe:ComboBoxEdit.StyleSettings>
|
||||
</dxe:ComboBoxEdit>
|
||||
|
||||
<Label Grid.Column="2" Grid.Row="0" Content="Beschäftigungsart" Margin="3,3,0,3"/>
|
||||
<dxe:ComboBoxEdit x:Name="FilterBeschaftigungsart" Grid.Column="3" Grid.Row="0" Margin="0,3,3,3" DisplayMember="Name">
|
||||
<Label Content="Beschäftigungsart" Margin="3,3,0,3"/>
|
||||
<dxe:ComboBoxEdit x:Name="FilterBeschaftigungsart" Margin="0,3,3,3" DisplayMember="Name">
|
||||
<dxe:ComboBoxEdit.StyleSettings>
|
||||
<dxe:CheckedComboBoxStyleSettings />
|
||||
</dxe:ComboBoxEdit.StyleSettings>
|
||||
</dxe:ComboBoxEdit>
|
||||
</Grid>
|
||||
<!--Erste Zeile Rechts-->
|
||||
<Grid Grid.Column="2" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="3" Margin="3" Content="Anzahl der angezeigten Tage"/>
|
||||
<dxe:SpinEdit x:Name="_SpinEdit" Grid.Column="4" Grid.Row="0" Margin="3" AllowNullInput="False" Height="23" Width="50" IsFloatValue="False" EditValueChanged="SpinEdit_EditValueChanged"/>
|
||||
</Grid>
|
||||
<!--Zweite Zeile Links-->
|
||||
<Grid Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left">
|
||||
<Button Grid.Column="0" Grid.Row="0" Content="Erstellen" Margin="3" MinWidth="100" Click="Button_Click"/>
|
||||
</Grid>
|
||||
<!--Zweite Zeile Rechts-->
|
||||
<Grid Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Datum" Margin="3"/>
|
||||
<dxe:DateEdit x:Name="_DateTimePicker" Grid.Column="1" Grid.Row="0" Margin="3,3,0,3" EditValueChanged="DateEdit_EditValueChanged" />
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<dxsch:SchedulerControl dx:ThemeManager.ThemeName="Office2010Black" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3"
|
||||
x:Name="_SchedulerControl" ActiveViewType="Timeline" Visibility="Collapsed" GroupType="Resource"
|
||||
IsManipulationEnabled="True" AllowDrop="False" IsTabStop="False" EditAppointmentFormShowing="SchedularControl_EditAppointmentFormShowing"
|
||||
EditRecurrentAppointmentFormShowing="SchedularControl_EditRecurrentAppointmentFormShowing" FormCustomizationUsingMVVMLocal="False"
|
||||
AppointmentViewInfoCustomizing="SchedulerControl_AppointmentViewInfoCustomizing" PopupMenuShowing="_SchedulerControl_PopupMenuShowing"
|
||||
x:Name="_SchedulerControl" ActiveViewType="Timeline" Visibility="Collapsed" GroupType="Resource"
|
||||
IsManipulationEnabled="True" AllowDrop="False" IsTabStop="False" EditAppointmentFormShowing="SchedularControl_EditAppointmentFormShowing"
|
||||
EditRecurrentAppointmentFormShowing="SchedularControl_EditRecurrentAppointmentFormShowing" FormCustomizationUsingMVVMLocal="False"
|
||||
AppointmentViewInfoCustomizing="SchedulerControl_AppointmentViewInfoCustomizing" PopupMenuShowing="SchedulerControl_PopupMenuShowing"
|
||||
|
||||
>
|
||||
<dxsch:SchedulerControl.DefaultMenuCustomizations>
|
||||
<dxb:RemoveBarItemAndLinkAction ItemName="NewAllDayEvent" />
|
||||
@@ -129,7 +98,9 @@
|
||||
<dxb:RemoveBarItemAndLinkAction ItemName="NewRecurringEvent" />
|
||||
</dxsch:SchedulerControl.DefaultMenuCustomizations>
|
||||
<dxsch:SchedulerControl.OptionsCustomization>
|
||||
<dxsch:OptionsCustomization AllowAppointmentCopy="None" AllowAppointmentCreate="All" AllowAppointmentDelete="None" AllowAppointmentDrag="None" AllowAppointmentDragBetweenResources="None" AllowAppointmentEdit="All" AllowAppointmentResize="None" AllowInplaceEditor="None" AllowAppointmentMultiSelect="False"/>
|
||||
<dxsch:OptionsCustomization AllowAppointmentCopy="None" AllowAppointmentCreate="All" AllowAppointmentDelete="None" AllowAppointmentDrag="None"
|
||||
AllowAppointmentDragBetweenResources="None" AllowAppointmentEdit="All" AllowAppointmentResize="None" AllowInplaceEditor="None"
|
||||
AllowAppointmentMultiSelect="False"/>
|
||||
</dxsch:SchedulerControl.OptionsCustomization>
|
||||
<dxsch:SchedulerControl.OptionsView>
|
||||
<dxsch:OptionsView/>
|
||||
@@ -8,6 +8,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Media;
|
||||
|
||||
using BeWo.Controls;
|
||||
@@ -23,17 +24,16 @@ 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;
|
||||
using System.Windows.Navigation;
|
||||
using ColorConverter = System.Windows.Media.ColorConverter;
|
||||
using SchedulerControl = DevExpress.Xpf.Scheduler.SchedulerControl;
|
||||
using AppointmentViewInfoCustomizingEventArgs = DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs;
|
||||
using DevExpress.XtraScheduler;
|
||||
|
||||
namespace BeWo.View.Detail.Report
|
||||
{
|
||||
@@ -48,26 +48,34 @@ namespace BeWo.View.Detail.Report
|
||||
private AppointmentStorage _AppointmentStorage;
|
||||
|
||||
private List<AbsenceReasonDC> _AbsenceReasonDCs;
|
||||
private Dictionary<long, EmployeeDC> _EmployeeDict;
|
||||
|
||||
private AbsenceOverviewFilterDC _SelectedFilter;
|
||||
|
||||
|
||||
public AbwesenheitstabelleView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
InitFilter();
|
||||
InitDateStuff();
|
||||
InitSchedulerStuff();
|
||||
InitializeFilter();
|
||||
InitializeDateSelction();
|
||||
InitializeScheduler();
|
||||
|
||||
linkPdfExport.NavigateUri = BeWoApp.SiteOfOrigin;
|
||||
//_SchedulerControl.Start = new DateTime(2020, 02, 01);
|
||||
|
||||
_EmployeeDict = new Dictionary<long, EmployeeDC>();
|
||||
}
|
||||
|
||||
|
||||
public List<AbsenceReasonDC> SelectedAbsenceReasons => FilterAbwesenheit.SelectedItems.Cast<AbsenceReasonDC>().ToList();
|
||||
|
||||
public List<EmploymentTypeDC> SelectedEmploymentTypes => FilterBeschaftigungsart.SelectedItems.Cast<EmploymentTypeDC>().ToList();
|
||||
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e) => UpdateScheduler();
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdateFilter();
|
||||
UpdateScheduler();
|
||||
}
|
||||
|
||||
private void SchedularControl_EditAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e)
|
||||
{
|
||||
@@ -75,7 +83,7 @@ namespace BeWo.View.Detail.Report
|
||||
|
||||
e.AllowResize = false;
|
||||
|
||||
e.Form = new AbwesenheitsEditView(_SchedulerControl, apt, (AbsenceTimeDC)apt.CustomFields["AbsenceTime"], _AbsenceReasonDCs);
|
||||
e.Form = new AbwesenheitsEditView(this, apt, _AbsenceReasonDCs);
|
||||
}
|
||||
|
||||
private void SchedularControl_EditRecurrentAppointmentFormShowing(object sender, EditAppointmentFormEventArgs e)
|
||||
@@ -83,9 +91,9 @@ namespace BeWo.View.Detail.Report
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
private void SchedulerControl_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e)
|
||||
private void SchedulerControl_AppointmentViewInfoCustomizing(object sender, AppointmentViewInfoCustomizingEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void SpinEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
|
||||
@@ -93,20 +101,10 @@ namespace BeWo.View.Detail.Report
|
||||
if (e.NewValue == null || !int.TryParse(e.NewValue.ToString(), out var count))
|
||||
return;
|
||||
|
||||
if (count > 0)
|
||||
if (count > 0 && count <= DateTime.DaysInMonth(_SelectedFilter.Year, _SelectedFilter.Month))
|
||||
_SchedulerControl.TimelineView.IntervalCount = count;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private void LinkPdfExport_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
var control = new AbwesenheitsPrintControl(_SchedulerControl.Start);
|
||||
@@ -133,7 +131,12 @@ namespace BeWo.View.Detail.Report
|
||||
beWoWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void InitFilter()
|
||||
private void SchedulerControl_PopupMenuShowing(object sender, SchedulerMenuEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void InitializeFilter()
|
||||
{
|
||||
var absenceReasons = ServiceFacade.DoOperationsServiceSync(x => x.GetAllAbsenceReason());
|
||||
var employmentTypes = ServiceFacade.DoEmployeeServiceSync(x => x.GetAllEmploymentTypes());
|
||||
@@ -143,50 +146,101 @@ namespace BeWo.View.Detail.Report
|
||||
_AbsenceReasonDCs = absenceReasons;
|
||||
}
|
||||
|
||||
private void InitDateStuff()
|
||||
private void InitializeDateSelction()
|
||||
{
|
||||
var today = DateTime.Today;
|
||||
_DateTimePicker.DateTime = today.AddDays(1 - today.Day);
|
||||
_SpinEdit.Text = DateTime.DaysInMonth(today.Year, today.Month).ToString();
|
||||
var year = new List<int>();
|
||||
for (int i = 1900; i < DateTime.Today.Year + 100; i++)
|
||||
{
|
||||
year.Add(i);
|
||||
}
|
||||
|
||||
_YearPicker.ItemsSource = year;
|
||||
|
||||
_MonthPicker.SelectedMonth = DateTime.Today.Month;
|
||||
_YearPicker.SelectedItem = DateTime.Today.Year;
|
||||
}
|
||||
|
||||
private void InitSchedulerStuff()
|
||||
private void InitializeScheduler()
|
||||
{
|
||||
_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)
|
||||
try
|
||||
{
|
||||
MouseHandlerService newMouseHandler =
|
||||
new MouseHandlerService(_SchedulerControl, oldMouseHandler);
|
||||
_SchedulerControl.RemoveService(typeof(IMouseHandlerService));
|
||||
_SchedulerControl.AddService(typeof(IMouseHandlerService), newMouseHandler);
|
||||
_SchedulerControl.BeginInit();
|
||||
|
||||
_SchedulerStorage = _SchedulerControl.Storage;
|
||||
_LabelStorage = _SchedulerControl.Storage.AppointmentStorage.Labels;
|
||||
_ResourceStorage = _SchedulerControl.Storage.ResourceStorage;
|
||||
_AppointmentStorage = _SchedulerControl.Storage.AppointmentStorage;
|
||||
|
||||
_AppointmentStorage.CustomFieldMappings.Add(new SchedulerCustomFieldMapping(nameof(AbsenceTimeDC), nameof(AbsenceTimeDC)));
|
||||
_ResourceStorage.CustomFieldMappings.Add(new SchedulerCustomFieldMapping(nameof(EmployeeDC), nameof(EmployeeDC)));
|
||||
|
||||
_SchedulerControl.TimelineView.VerticalResourceHeaderStyle = (Style)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);
|
||||
}
|
||||
|
||||
_SchedulerControl.TimelineView.VerticalResourceHeaderStyle = (Style)FindResource("VerticalResourceHeaderStyle");
|
||||
}
|
||||
finally
|
||||
{
|
||||
_SchedulerControl.EndInit();
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateUrlaubkonto(long empOid)
|
||||
{
|
||||
_EmployeeDict[empOid].Urlaubskonto = ServiceFacade.DoOperationsServiceSync(x => x.GetUrlaubskontoByEmployee(empOid, 2020));
|
||||
|
||||
var xx = _ResourceStorage.GetResourceById(empOid.ToString());
|
||||
|
||||
xx.CustomFields[nameof(EmployeeDC)] = null;
|
||||
xx.CustomFields[nameof(EmployeeDC)] = _EmployeeDict[empOid];
|
||||
}
|
||||
|
||||
private void UpdateFilter()
|
||||
{
|
||||
_SelectedFilter = new AbsenceOverviewFilterDC
|
||||
{
|
||||
Year = (int)_YearPicker.SelectedItem,
|
||||
Month = _MonthPicker.SelectedMonth
|
||||
};
|
||||
|
||||
if (SelectedAbsenceReasons.Any())
|
||||
_SelectedFilter.AbsenceReasons = SelectedAbsenceReasons.Select(x => x.AbsenceReasonOid.Value).ToList();
|
||||
|
||||
if (SelectedEmploymentTypes.Any())
|
||||
_SelectedFilter.EmploymentType = SelectedEmploymentTypes.Select(x => x.EmploymentTypeOid.Value).ToList();
|
||||
|
||||
}
|
||||
|
||||
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 absenceOverview = ServiceFacade.DoOperationsServiceSync(x => x.GetAbsenceOverview(_SelectedFilter));
|
||||
var start = new DateTime(_SelectedFilter.Year, _SelectedFilter.Month, 1);
|
||||
|
||||
try
|
||||
{
|
||||
_SchedulerStorage.BeginUpdate();
|
||||
|
||||
_SchedulerControl.LimitInterval = new TimeInterval(start, start.AddMonths(1).AddTicks(-1));
|
||||
_SchedulerControl.Start = start;
|
||||
_SpinEdit.MinValue = 1;
|
||||
_SpinEdit.MaxValue = DateTime.DaysInMonth(_SelectedFilter.Year, _SelectedFilter.Month);
|
||||
_SpinEdit.Value = _SpinEdit.MaxValue.Value;
|
||||
|
||||
_LabelStorage.Clear();
|
||||
foreach (var reason in absenceReasons)
|
||||
{
|
||||
var label = _LabelStorage.CreateNewLabel(reason.AbsenceReasonOid.ToString(), reason.Description);
|
||||
if (!String.IsNullOrEmpty(reason.Color))
|
||||
if (!string.IsNullOrEmpty(reason.Color))
|
||||
{
|
||||
label.Color = (Color)ColorConverter.ConvertFromString(reason.Color);
|
||||
}
|
||||
@@ -194,24 +248,27 @@ namespace BeWo.View.Detail.Report
|
||||
_LabelStorage.Add(label);
|
||||
}
|
||||
|
||||
_EmployeeDict.Clear();
|
||||
_ResourceStorage.Clear();
|
||||
foreach (var employee in employees)
|
||||
_AppointmentStorage.Clear();
|
||||
foreach (var employee in absenceOverview)
|
||||
{
|
||||
var resource = _SchedulerStorage.CreateResource(employee.EmployeeOid.Value.ToString());
|
||||
|
||||
resource.Caption = employee.LastNameFirstName;
|
||||
resource.CustomFields[nameof(EmployeeDC)] = employee;
|
||||
|
||||
_EmployeeDict.Add(employee.EmployeeOid.Value, employee);
|
||||
_ResourceStorage.Add(resource);
|
||||
}
|
||||
|
||||
_AppointmentStorage.Clear();
|
||||
foreach (var absenceTime in absenceTimes)
|
||||
{
|
||||
var appointment = _SchedulerStorage.CreateAppointment(AppointmentType.Normal);
|
||||
foreach (var absence in employee.AbsenceTimes)
|
||||
{
|
||||
var appointment = _SchedulerStorage.CreateAppointment(AppointmentType.Normal);
|
||||
|
||||
SchedulerHelper.OverrideAWithB(appointment, absenceTime);
|
||||
SchedulerHelper.OverrideAppointmentWithAbsenceTime(appointment, absence);
|
||||
|
||||
_AppointmentStorage.Add(appointment);
|
||||
_AppointmentStorage.Add(appointment);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -236,11 +293,6 @@ namespace BeWo.View.Detail.Report
|
||||
|
||||
linkPdfExport.NavigateUri = new Uri(url);
|
||||
}
|
||||
|
||||
private void _SchedulerControl_PopupMenuShowing(object sender, SchedulerMenuEventArgs e)
|
||||
{
|
||||
e.Handled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public class MouseHandlerService : MouseHandlerServiceWrapper
|
||||
@@ -262,7 +314,7 @@ namespace BeWo.View.Detail.Report
|
||||
|
||||
public static class SchedulerHelper
|
||||
{
|
||||
public static void OverrideAWithB(Appointment appointment, AbsenceTimeDC absenceTime)
|
||||
public static void OverrideAppointmentWithAbsenceTime(Appointment appointment, AbsenceTimeDC absenceTime)
|
||||
{
|
||||
appointment.AllDay = true;
|
||||
appointment.Subject = absenceTime.Reason.Description;
|
||||
@@ -271,8 +323,8 @@ namespace BeWo.View.Detail.Report
|
||||
appointment.ResourceId = absenceTime.EmployeeOid.Value.ToString();
|
||||
appointment.LabelKey = absenceTime.Reason.AbsenceReasonOid.ToString();
|
||||
appointment.Description = absenceTime.Notice;
|
||||
appointment.CustomFields["AbsenceTime"] = null;
|
||||
appointment.CustomFields["AbsenceTime"] = absenceTime;
|
||||
appointment.CustomFields[nameof(AbsenceTimeDC)] = null;
|
||||
appointment.CustomFields[nameof(AbsenceTimeDC)] = absenceTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +197,7 @@ namespace BeWo.View.Detail.Report
|
||||
private void InitDateComboBox()
|
||||
{
|
||||
var year = new List<int>();
|
||||
for (int i = 1900; i < 2100; i++)
|
||||
for (int i = 1900; i < DateTime.Today.Year + 100; i++)
|
||||
{
|
||||
year.Add(i);
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ namespace BeWo.View.Master
|
||||
#if DEBUG
|
||||
tabitem_serviceOverview.Visibility = Visibility.Visible;
|
||||
tabitem_abwesenheitsTabelle.Visibility = Visibility.Visible;
|
||||
|
||||
tabitem_dienstPlaner.Visibility = Visibility.Visible;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ namespace Host
|
||||
|
||||
if (Request.Params["et"] != null)
|
||||
absenceIDs = Request.Params["et"].Split(';').Select(long.Parse).ToList();
|
||||
|
||||
|
||||
return reportCreator.CreateAbsenceReport(dt, absenceIDs, empIDs);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ namespace BeWo.Report
|
||||
public abstract XtraReport CreateCustomReport(long employeeOid, String reportName);
|
||||
|
||||
public abstract XtraReport CreateAbsenceReport(DateTime dt, List<long> abs, List<long> empTypes);
|
||||
|
||||
public abstract XtraReport CreateRosterReport(long wOid, DateTime dt);
|
||||
|
||||
public abstract XtraReport CreateKilometerauswertung(long customerOid, DateTime rangeDate);
|
||||
|
||||
public abstract XtraReport CreateKilometerauswertungForAllCustomers(List<long> customerOids, DateTime rangeDate);
|
||||
|
||||
@@ -179,10 +179,10 @@ namespace BeWo.Report
|
||||
return report as XtraReport;
|
||||
}
|
||||
|
||||
public override XtraReport CreateFlsReport(String flsReportId, String subType)
|
||||
{
|
||||
string flsReportPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, flsReportId + ".xml");
|
||||
var lFLSAnalysisDataReportDC = Utils.XMLDeserialize<FLSAnalysisDataReportDC>(flsReportPath);
|
||||
public override XtraReport CreateFlsReport(String flsReportId, String subType)
|
||||
{
|
||||
string flsReportPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, flsReportId + ".xml");
|
||||
var lFLSAnalysisDataReportDC = Utils.XMLDeserialize<FLSAnalysisDataReportDC>(flsReportPath);
|
||||
|
||||
|
||||
IBeWoReport<FLSReportRO> lFLSReportObject = null;
|
||||
@@ -199,14 +199,14 @@ namespace BeWo.Report
|
||||
return lFLSReportObject as XtraReport;
|
||||
}
|
||||
|
||||
public override XtraReport CreateQueryReport(long queryOid, String queryReportId)
|
||||
{
|
||||
var query = DAOFactory.GenericDAO.LoadByID<Query>(queryOid);
|
||||
public override XtraReport CreateQueryReport(long queryOid, String queryReportId)
|
||||
{
|
||||
var query = DAOFactory.GenericDAO.LoadByID<Query>(queryOid);
|
||||
|
||||
if (query == null)
|
||||
return new XtraReport();
|
||||
|
||||
var path = BS.Shared.Core.Utils.CreateSavePath(TempPath, queryReportId + ".xml");
|
||||
if (query == null)
|
||||
return new XtraReport();
|
||||
|
||||
var path = BS.Shared.Core.Utils.CreateSavePath(TempPath, queryReportId + ".xml");
|
||||
|
||||
var table = Utils.XMLDeserialize<DataTable>(path);
|
||||
|
||||
@@ -402,48 +402,48 @@ namespace BeWo.Report
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
private IList<long> GetMeineKlientenOids()
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
private IList<long> GetMeineKlientenOids()
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
|
||||
ApplicationUser loggedInUser = null;
|
||||
|
||||
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
||||
{
|
||||
loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
||||
}
|
||||
else
|
||||
{
|
||||
loggedInUser = SessionFacade.LoggedInUser;
|
||||
}
|
||||
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
||||
{
|
||||
loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
||||
}
|
||||
else
|
||||
{
|
||||
loggedInUser = SessionFacade.LoggedInUser;
|
||||
}
|
||||
|
||||
if (loggedInUser != null && loggedInUser.Employee != null)
|
||||
{
|
||||
foreach (var e2c in loggedInUser.Employee.Employee2CustomerList)
|
||||
{
|
||||
if (e2c.Customer.IsActive == ActivationTypeId.Active)
|
||||
{
|
||||
foreach (var v2o in e2c.ValueList)
|
||||
{
|
||||
if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
|
||||
if (loggedInUser != null && loggedInUser.Employee != null)
|
||||
{
|
||||
foreach (var e2c in loggedInUser.Employee.Employee2CustomerList)
|
||||
{
|
||||
if (e2c.Customer.IsActive == ActivationTypeId.Active)
|
||||
{
|
||||
foreach (var v2o in e2c.ValueList)
|
||||
{
|
||||
if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
|
||||
{
|
||||
if (!customerOids.Contains(e2c.Customer.Oid.Value))
|
||||
{
|
||||
customerOids.Add(e2c.Customer.Oid.Value);
|
||||
}
|
||||
if (!customerOids.Contains(e2c.Customer.Oid.Value))
|
||||
{
|
||||
customerOids.Add(e2c.Customer.Oid.Value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return customerOids;
|
||||
}
|
||||
return customerOids;
|
||||
}
|
||||
|
||||
public virtual IList<long> GetKlientenOidsMeinesTeams(long? teamOid)
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
public virtual IList<long> GetKlientenOidsMeinesTeams(long? teamOid)
|
||||
{
|
||||
IList<long> customerOids = new List<long>();
|
||||
|
||||
ApplicationUser loggedInUser = null;
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace BeWo.Report
|
||||
teams.AddRange(DAOFactory.SearchDAO.FindLeadingTeams(loggedInUser.Employee.Oid.Value));
|
||||
teams.AddRange(DAOFactory.SearchDAO.FindTeamsOfEmployee(loggedInUser.Employee.Oid.Value));
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (var team in teams)
|
||||
{
|
||||
@@ -487,7 +487,7 @@ namespace BeWo.Report
|
||||
{
|
||||
customerOids.Add(e2c.Customer.Oid.Value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,97 +497,97 @@ namespace BeWo.Report
|
||||
}
|
||||
}
|
||||
|
||||
return customerOids;
|
||||
}
|
||||
return customerOids;
|
||||
}
|
||||
|
||||
public virtual XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
var roList = new List<ServicesOverviewRO>();
|
||||
public virtual XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
var roList = new List<ServicesOverviewRO>();
|
||||
|
||||
foreach (var coid in customerOids)
|
||||
{
|
||||
var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
|
||||
foreach (var coid in customerOids)
|
||||
{
|
||||
var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
|
||||
|
||||
if (ro != null)
|
||||
{
|
||||
roList.Add(ro);
|
||||
}
|
||||
}
|
||||
if (ro != null)
|
||||
{
|
||||
roList.Add(ro);
|
||||
}
|
||||
}
|
||||
|
||||
var sortedList = roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
|
||||
|
||||
if (sortedList.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid.HasValue && orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid.Value);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Name;
|
||||
}
|
||||
if (sortedList.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid.HasValue && orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid.Value);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Name;
|
||||
}
|
||||
|
||||
var rootReport = CreateReportForServicesOverviewRo(sortedList[0], reportId);
|
||||
if (rootReport.Pages.Count == 0)
|
||||
{
|
||||
rootReport.CreateDocument();
|
||||
}
|
||||
if (rootReport.Pages.Count == 0)
|
||||
{
|
||||
rootReport.CreateDocument();
|
||||
}
|
||||
|
||||
|
||||
for (int i = 1; i < sortedList.Count; i++)
|
||||
{
|
||||
var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId);
|
||||
if (lNext.Pages.Count == 0)
|
||||
{
|
||||
lNext.CreateDocument();
|
||||
}
|
||||
{
|
||||
var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId);
|
||||
if (lNext.Pages.Count == 0)
|
||||
{
|
||||
lNext.CreateDocument();
|
||||
}
|
||||
|
||||
rootReport.Pages.AddRange(lNext.Pages);
|
||||
rootReport.Pages.AddRange(lNext.Pages);
|
||||
}
|
||||
|
||||
return rootReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
return rootReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public virtual XtraReport CreateReportForServicesOverviewRo(ServicesOverviewRO ro, String reportId)
|
||||
{
|
||||
|
||||
|
||||
var serviceOverviewReport = this.FindReportImp<ServicesOverviewRO>(reportId);
|
||||
serviceOverviewReport.SetReportDataSource(ro);
|
||||
|
||||
|
||||
|
||||
return serviceOverviewReport as XtraReport;
|
||||
}
|
||||
|
||||
public virtual XtraReport AddSubServicesOverviewReportToReport(XtraReport masterReport, IBeWoReport<ServicesOverviewRO> newReport, ServicesOverviewRO ro)
|
||||
{
|
||||
if (ro.Services.Count > 0)
|
||||
{
|
||||
newReport.SetReportDataSource(ro);
|
||||
((XtraReport)newReport).CreateDocument();
|
||||
if (masterReport == null)
|
||||
{
|
||||
masterReport = newReport as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (masterReport.Pages.Count == 0)
|
||||
{
|
||||
masterReport.CreateDocument();
|
||||
}
|
||||
public virtual XtraReport AddSubServicesOverviewReportToReport(XtraReport masterReport, IBeWoReport<ServicesOverviewRO> newReport, ServicesOverviewRO ro)
|
||||
{
|
||||
if (ro.Services.Count > 0)
|
||||
{
|
||||
newReport.SetReportDataSource(ro);
|
||||
((XtraReport)newReport).CreateDocument();
|
||||
if (masterReport == null)
|
||||
{
|
||||
masterReport = newReport as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (masterReport.Pages.Count == 0)
|
||||
{
|
||||
masterReport.CreateDocument();
|
||||
}
|
||||
|
||||
masterReport.Pages.AddRange(((XtraReport)newReport).Pages);
|
||||
masterReport.Pages.AddRange(((XtraReport)newReport).Pages);
|
||||
|
||||
}
|
||||
}
|
||||
return masterReport;
|
||||
}
|
||||
}
|
||||
}
|
||||
return masterReport;
|
||||
}
|
||||
|
||||
public override XtraReport CreateSbdLeistungsnachweisForAllCustomers(int month, int year, long orgaOid, long empOid, long serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
return CreateReportForStundenaufstellungROs(SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
|
||||
{
|
||||
return CreateReportForStundenaufstellungROs(SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
|
||||
|
||||
//var lROs = SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
||||
|
||||
@@ -660,25 +660,25 @@ namespace BeWo.Report
|
||||
|
||||
long result;
|
||||
|
||||
if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.SearchDAO.GetSettlementInvoiceByInvoiceBaseOid(invoiceBaseOid.Value));
|
||||
}
|
||||
else if (Int64.TryParse(dcId, out result))
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(result)); // = Utils.XMLDeserialize<SettlementDC>(lPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
string lPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, dcId);
|
||||
lSettlementDC = Utils.XMLDeserialize<Settlement2DC>(lPath);
|
||||
}
|
||||
String reportId = null;
|
||||
if (lSettlementDC.CostBearer2SupportConceptOid.HasValue)
|
||||
{
|
||||
CostBearer2SupportConcept c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(lSettlementDC.CostBearer2SupportConceptOid.Value);
|
||||
reportId = c2s.CostBearer.ID;
|
||||
}
|
||||
if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.SearchDAO.GetSettlementInvoiceByInvoiceBaseOid(invoiceBaseOid.Value));
|
||||
}
|
||||
else if (Int64.TryParse(dcId, out result))
|
||||
{
|
||||
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(result)); // = Utils.XMLDeserialize<SettlementDC>(lPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
string lPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, dcId);
|
||||
lSettlementDC = Utils.XMLDeserialize<Settlement2DC>(lPath);
|
||||
}
|
||||
String reportId = null;
|
||||
if (lSettlementDC.CostBearer2SupportConceptOid.HasValue)
|
||||
{
|
||||
CostBearer2SupportConcept c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(lSettlementDC.CostBearer2SupportConceptOid.Value);
|
||||
reportId = c2s.CostBearer.ID;
|
||||
}
|
||||
|
||||
if (lSettlementDC.DifferentHourlyRateCount > 0)
|
||||
{
|
||||
@@ -720,35 +720,35 @@ namespace BeWo.Report
|
||||
{
|
||||
IBeWoReport<MitarbeiterstundenkontoRO> report;
|
||||
|
||||
if (ansicht == 1)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterarbeitszeitkonto");
|
||||
if (ansicht == 1)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterarbeitszeitkonto");
|
||||
}
|
||||
else if (ansicht == 2)
|
||||
{
|
||||
var reportjahr = FindReportImp<MitarbeiterstundenkontoMonateRO>("MitarbeiterarbeitszeitkontoJahr");
|
||||
var jahrStart = new DateTime(startDate.Year, 1, 1);
|
||||
var ds = new MitarbeiterstundenkontoMonateRO(employeeOid, teamOids, jahrStart, endDate, null);
|
||||
{
|
||||
var reportjahr = FindReportImp<MitarbeiterstundenkontoMonateRO>("MitarbeiterarbeitszeitkontoJahr");
|
||||
var jahrStart = new DateTime(startDate.Year, 1, 1);
|
||||
var ds = new MitarbeiterstundenkontoMonateRO(employeeOid, teamOids, jahrStart, endDate, null);
|
||||
|
||||
reportjahr.SetReportDataSource(ds);
|
||||
reportjahr.SetReportDataSource(ds);
|
||||
|
||||
return reportjahr as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (teamOids != null && teamOids.Count > 0)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Teamstundenkonto");
|
||||
}
|
||||
else
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterstundenkonto");
|
||||
}
|
||||
}
|
||||
return reportjahr as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (teamOids != null && teamOids.Count > 0)
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Teamstundenkonto");
|
||||
}
|
||||
else
|
||||
{
|
||||
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterstundenkonto");
|
||||
}
|
||||
}
|
||||
|
||||
var x =
|
||||
MitarbeiterstundenkontoRO.Create(employeeOid, teamOids, startDate, endDate, null);
|
||||
report.SetReportDataSource(x);
|
||||
var x =
|
||||
MitarbeiterstundenkontoRO.Create(employeeOid, teamOids, startDate, endDate, null);
|
||||
report.SetReportDataSource(x);
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
@@ -861,7 +861,7 @@ namespace BeWo.Report
|
||||
{
|
||||
var report = FindReportImp<KilometerauswertungsRO>();
|
||||
|
||||
report.SetReportDataSource(KilometerauswertungsRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid)), rangeDate));
|
||||
report.SetReportDataSource(KilometerauswertungsRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid)), rangeDate));
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
@@ -870,16 +870,18 @@ namespace BeWo.Report
|
||||
{
|
||||
var report = FindReportImp<KilometerauswertungsListRO>();
|
||||
|
||||
report.SetReportDataSource(KilometerauswertungsListRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<Customer>(customerOids)), rangeDate));
|
||||
report.SetReportDataSource(KilometerauswertungsListRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<Customer>(customerOids)), rangeDate));
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
|
||||
public override XtraReport CreateAbsenceReport(DateTime dt, List<long> abs, List<long> empTypes)
|
||||
public override XtraReport CreateAbsenceReport(DateTime dt, List<long> abs, List<long> emps)
|
||||
{
|
||||
var report = FindReportImp<AbsenceRO>();
|
||||
|
||||
report.SetReportDataSource(AbsenceRO.Create(dt, (new OperationsServiceImp()).GetAbsenceTimeDCEmployee51(dt, dt.AddMonths(1).AddTicks(-1), abs, empTypes)));
|
||||
var service = new OperationsServiceImp();
|
||||
var filter = new AbsenceOverviewFilterDC() { AbsenceReasons = abs, EmploymentType = emps, Year = dt.Year, Month = dt.Month };
|
||||
|
||||
report.SetReportDataSource(AbsenceRO.Create(service.GetAbsenceOverview(filter), filter));
|
||||
|
||||
return report as XtraReport;
|
||||
|
||||
@@ -890,7 +892,7 @@ namespace BeWo.Report
|
||||
var service = new OperationsServiceImp();
|
||||
var service2 = new CustomerServiceImp();
|
||||
var report = FindReportImp<RosterRO>();
|
||||
|
||||
|
||||
report.SetReportDataSource(RosterRO.Create(service.GetDienstEintraege(wOid, dt.Year, dt.Month), service.GetAllDienste(), service2.GetAllActiveWohnheimeCompact().First(x => x.WohnheimOid == wOid), dt.Year, dt.Month));
|
||||
|
||||
return report as XtraReport;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace BeWo.Report.DefaultReports
|
||||
|
||||
public void SetReportDataSource(AbsenceRO pRO)
|
||||
{
|
||||
int i = DateTime.DaysInMonth(pRO.ReportDateTime.Year, pRO.ReportDateTime.Month);
|
||||
int i = DateTime.DaysInMonth(pRO.ReportFilter.Year, pRO.ReportFilter.Month);
|
||||
|
||||
cellHeader29.Visible = cellDetail29.Visible = i >= 29;
|
||||
cellHeader30.Visible = cellDetail30.Visible = i >= 30;
|
||||
|
||||
@@ -10,14 +10,13 @@ namespace BeWo.Report.ReportObjects
|
||||
{
|
||||
public class AbsenceRO : AbstractBeWoReportObject<AbsenceRO>
|
||||
{
|
||||
public DateTime ReportDateTime { get; set; }
|
||||
public AbsenceOverviewFilterDC ReportFilter { get; set; }
|
||||
public List<AbsenceReportRow> AbsenceReportRows { get; set; }
|
||||
|
||||
public static AbsenceRO Create(DateTime dt, Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> tuple)
|
||||
public static AbsenceRO Create(List<EmployeeDC> employees, AbsenceOverviewFilterDC filter)
|
||||
{
|
||||
var res = new AbsenceRO() { ReportDateTime = dt, AbsenceReportRows = new List<AbsenceReportRow>() };
|
||||
|
||||
var employees = tuple.Item2.OrderBy(x => x.LastNameFirstName);
|
||||
var res = new AbsenceRO() { ReportFilter = filter, AbsenceReportRows = new List<AbsenceReportRow>() };
|
||||
var dt = new DateTime(filter.Year, filter.Month, 1);
|
||||
|
||||
foreach (var emp in employees)
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace BeWo.Report.ReportObjects
|
||||
Employee = emp.LastNameFirstName
|
||||
};
|
||||
|
||||
var absenceTimes = tuple.Item1.Where(x => x.EmployeeOid == emp.EmployeeOid)
|
||||
var absenceTimes = emp.AbsenceTimes
|
||||
.OrderByDescending(x => x.End ?? DateTime.MaxValue)
|
||||
.OrderBy(x => x.Start)
|
||||
.ToArray();
|
||||
@@ -38,7 +37,7 @@ namespace BeWo.Report.ReportObjects
|
||||
{
|
||||
var abs = absenceTimes[0];
|
||||
|
||||
while (dayInMonth < DateTime.DaysInMonth(dt.Year, dt.Month))
|
||||
while (dayInMonth < DateTime.DaysInMonth(filter.Year, filter.Month))
|
||||
{
|
||||
if (abs.Start.Value > dt.AddDays(dayInMonth))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using System.Text.RegularExpressions;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
@@ -31,14 +31,14 @@ namespace BeWo.Service.Plugins
|
||||
public virtual List<DateTime> GetFeiertage(int year)
|
||||
{
|
||||
var list = GetFeiertage(year, "NRW");
|
||||
|
||||
|
||||
return list.Select(f => f.Datum).ToList();
|
||||
}
|
||||
|
||||
public FeiertagDC GetFeiertag(DateTime start)
|
||||
{
|
||||
var feiertage = GetFeiertage(start.Year, "NRW");
|
||||
|
||||
|
||||
foreach (var ft in feiertage)
|
||||
{
|
||||
if (start == ft.Datum)
|
||||
@@ -62,8 +62,8 @@ namespace BeWo.Service.Plugins
|
||||
public virtual List<FeiertagDC> GetFeiertage(int year, String bundesland)
|
||||
{
|
||||
List<FeiertagDC> list = new List<FeiertagDC>();
|
||||
|
||||
list.Add(new FeiertagDC { Datum = new DateTime(year, 1, 1), Name="Neujahr"});
|
||||
|
||||
list.Add(new FeiertagDC { Datum = new DateTime(year, 1, 1), Name = "Neujahr" });
|
||||
//list.Add(new DateTime(year, 1, 6)); // , "Heilige Drei Könige"));
|
||||
list.Add(new FeiertagDC { Datum = new DateTime(year, 5, 1), Name = "Tag der Arbeit" });
|
||||
//list.Add(new DateTime(year, 8, 15)); // , "Mariä Himmelfahrt"));
|
||||
@@ -105,8 +105,8 @@ namespace BeWo.Service.Plugins
|
||||
j = (year + (year / 4) + i + 2 - c + (c / 4)) % 7;
|
||||
|
||||
l = i - j;
|
||||
int month = (int) (3 + ((l + 40) / 44));
|
||||
int day = (int) (l + 28 - 31 * (month / 4));
|
||||
int month = (int)(3 + ((l + 40) / 44));
|
||||
int day = (int)(l + 28 - 31 * (month / 4));
|
||||
|
||||
return new DateTime(year, month, day);
|
||||
|
||||
@@ -152,13 +152,132 @@ namespace BeWo.Service.Plugins
|
||||
return list;
|
||||
}
|
||||
|
||||
//public virtual UrlaubskontoDC BerechneUrlaubskonto(Employee emp, DateTime datum)
|
||||
//{
|
||||
|
||||
// //Verträge prüfen...
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
public virtual List<long> GetVacationReasonIDs()
|
||||
{
|
||||
var res = new List<long>();
|
||||
var filters = new List<string> { "URLAUB" };
|
||||
var reasons = DAOFactory.GenericDAO.GetAllActive<AbsenceReason>();
|
||||
|
||||
foreach (var reason in reasons)
|
||||
{
|
||||
var desc = reason.Description.ToUpper();
|
||||
|
||||
foreach (var filter in filters)
|
||||
{
|
||||
if (desc.Contains(filter))
|
||||
{
|
||||
res.Add(reason.Oid.Value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public virtual DateTime GetExpirationDate(int year)
|
||||
{
|
||||
return new DateTime(year, 3, 31);
|
||||
}
|
||||
|
||||
public virtual Dictionary<int, UrlaubskontoDC> BerechneUrlaubskonto(Employee emp, int year)
|
||||
{
|
||||
try
|
||||
{
|
||||
var absReason = GetVacationReasonIDs();
|
||||
var absences = emp.AbsenceTimes.Where(x => absReason.Contains(x.AbsenceReason.Oid.Value) &&
|
||||
(x.Start.HasValue && x.Start.Value.Year <= year))
|
||||
//(!x.End.HasValue || x.End.Value.Year >= year)
|
||||
.OrderBy(x => x.Start);
|
||||
|
||||
// Startzeitpunkt für Berechnung berechnen
|
||||
var firstContractYear = emp.Contracts?.Min(x => x.EntryDate)?.Year ?? int.MaxValue;
|
||||
var firstAbsenceTimeYear = absences.Min(x => x.Start)?.Year ?? int.MaxValue;
|
||||
var firstYear = Math.Min(year, Math.Min(firstContractYear, firstAbsenceTimeYear));
|
||||
|
||||
// Urlaubskonten erzeugen
|
||||
var konten = new Dictionary<int, UrlaubskontoDC>();
|
||||
for (int i = firstYear; i <= year; i++)
|
||||
{
|
||||
konten.Add(i, new UrlaubskontoDC());
|
||||
}
|
||||
|
||||
// Jahresurlaubanspruch berechnen
|
||||
foreach (var contract in emp.Contracts)
|
||||
{
|
||||
var start = contract.EntryDate?.Year ?? firstYear;
|
||||
var end = contract.ContractEndDate?.Year ?? year;
|
||||
|
||||
for (int i = start; i <= end; i++)
|
||||
{
|
||||
var tmp = konten[i];
|
||||
|
||||
tmp.Urlaubsanspruch += contract.LeaveDays ?? 0;
|
||||
tmp.Resturlaub = tmp.Urlaubsanspruch;
|
||||
}
|
||||
}
|
||||
|
||||
// Abwesenheiten in Jahr x berücksichtigen
|
||||
var absencesYear = new List<Tuple<int, AbsenceTime>>();
|
||||
foreach (var abs in absences)
|
||||
{
|
||||
var till = Math.Min(abs.End?.Year ?? year, year);
|
||||
for (int i = abs.Start.Value.Year; i <= till; i++)
|
||||
{
|
||||
absencesYear.Add(new Tuple<int, AbsenceTime>(i, abs));
|
||||
}
|
||||
}
|
||||
|
||||
// Urlaubsanspruch berechnen
|
||||
var yearFiller = firstYear;
|
||||
absencesYear = absencesYear.OrderBy(x => x.Item1).ToList();
|
||||
foreach (var tuple in absencesYear)
|
||||
{
|
||||
var absYear = tuple.Item1;
|
||||
var absence = tuple.Item2;
|
||||
|
||||
// Resturlaub Vorjahr übertragen
|
||||
while (yearFiller < absYear)
|
||||
{
|
||||
var tmp = konten[yearFiller];
|
||||
var tmp2 = konten[yearFiller + 1];
|
||||
|
||||
tmp2.ResturlaubVorjahrTotal = tmp.Resturlaub;
|
||||
tmp2.ResturlaubVorjahr = tmp.Resturlaub;
|
||||
|
||||
yearFiller++;
|
||||
}
|
||||
|
||||
var current = konten[absYear];
|
||||
|
||||
var start = DateTimeExtensions.GetMax(absence.Start, new DateTime(absYear, 1, 1));
|
||||
var end = DateTimeExtensions.GetMin(absence.End, new DateTime(absYear, 12, 31));
|
||||
|
||||
var dauer = (decimal)(absence.End.Value - absence.Start.Value).Days + 1;
|
||||
var expiration = GetExpirationDate(year);
|
||||
|
||||
// Resturlaub vom Vorjahr verwenden, wenn möglich
|
||||
if (current.ResturlaubVorjahr > 0 && start <= expiration)
|
||||
{
|
||||
var firstEnd = (DateTime)DateTimeExtensions.GetMin(end, expiration);
|
||||
var dauerVorjahr = (decimal)(firstEnd - absence.Start.Value).Days + 1;
|
||||
|
||||
var bucheVorjahr = Math.Min(current.ResturlaubVorjahr, dauerVorjahr);
|
||||
|
||||
current.ResturlaubVorjahr -= bucheVorjahr;
|
||||
dauer -= bucheVorjahr;
|
||||
}
|
||||
|
||||
// Restliche Dauer vom Urlaub abziehen
|
||||
current.Resturlaub -= dauer;
|
||||
}
|
||||
|
||||
return konten;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -848,26 +848,6 @@ namespace BeWo.Service.ServiceContracts
|
||||
[OperationContract]
|
||||
IList<ReportTemplateDC> GetReportTemplates(string url);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee11();
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee21(List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee31(DateTime start, DateTime end);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee41(DateTime start, DateTime end, List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee51(DateTime start, DateTime end, List<long> absenceReasonIDs, List<long> employmentTypeIDs);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
IList<AbsenceReasonDC> GetAllAbsenceReason();
|
||||
@@ -967,5 +947,33 @@ namespace BeWo.Service.ServiceContracts
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<AbsenceTimeDC> GetAbsenceTimeVacationByWohnheim(long wohnId, int year, int month);
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//List<EmployeeDC> GetAbsenceTimeDCEmployee21(List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes);
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//List<EmployeeDC> GetAbsenceTimeDCEmployee31(DateTime start, DateTime end);
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//List<EmployeeDC> GetAbsenceTimeDCEmployee41(DateTime start, DateTime end, List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes);
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//List<EmployeeDC> GetAbsenceTimeDCEmployee51(DateTime start, DateTime end, List<long> absenceReasonIDs, List<long> employmentTypeIDs);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<EmployeeDC> GetAbsenceOverview(AbsenceOverviewFilterDC filter);
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//Dictionary<int, UrlaubskontoDC> GetUrlaubskontenByEmployee(long empOid, AbsenceOverviewFilterDC filter);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
UrlaubskontoDC GetUrlaubskontoByEmployee(long empOid, int year);
|
||||
}
|
||||
}
|
||||
@@ -3228,11 +3228,11 @@ namespace BeWo.Service.ServiceImplementations
|
||||
#endif
|
||||
var appCodes = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(employeeOid).ToList();
|
||||
|
||||
if(appCodes.Count > 0)
|
||||
if (appCodes.Count > 0)
|
||||
{
|
||||
var response = DeletZufallsCode(apikey, kundennummer, "E" + employeeOid);
|
||||
|
||||
if(response != 0)
|
||||
if (response != 0)
|
||||
{
|
||||
return new EmployeeAPPCodeDC { Result = response };
|
||||
}
|
||||
@@ -3240,7 +3240,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
var zufallscode = ErzeugeZufallsCode(apikey, kundennummer, "E" + employeeOid);
|
||||
|
||||
if(zufallscode != null)
|
||||
if (zufallscode != null)
|
||||
{
|
||||
var appcodes = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(employeeOid).ToList();
|
||||
|
||||
@@ -3260,7 +3260,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return null;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -3427,7 +3427,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
var customerChatCodes = DAOFactory.SearchDAO.FindAllCustomerAppCodes(customerOid).ToList();
|
||||
|
||||
foreach(var items in customerChatCodes)
|
||||
foreach (var items in customerChatCodes)
|
||||
{
|
||||
items.IsChatAktiv = activeType == 1 ? activeType : 0;
|
||||
}
|
||||
@@ -3465,7 +3465,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
var serverUrl = ErmittleServerURL(customerId);
|
||||
|
||||
if(serverUrl.IsNullOrEmpty())
|
||||
if (serverUrl.IsNullOrEmpty())
|
||||
{
|
||||
return 3; // ServerURl konnte nicht ermittelt werden
|
||||
}
|
||||
@@ -3485,12 +3485,12 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return Convert.ToInt32(result.Result);
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -3532,7 +3532,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
//return !jsonDatentyp.result.Equals("0") ? null : jsonDatentyp.chatcode;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -3551,11 +3551,11 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
var response = client.Execute(request);
|
||||
|
||||
var result = JsonConvert.DeserializeAnonymousType(response.Content, new {Status = string.Empty, Url = string.Empty, SyncType = string.Empty});
|
||||
var result = JsonConvert.DeserializeAnonymousType(response.Content, new { Status = string.Empty, Url = string.Empty, SyncType = string.Empty });
|
||||
|
||||
return result.Url;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -3606,12 +3606,12 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
try
|
||||
{
|
||||
var dcList = new List<ServiceRecordDC> {sr};
|
||||
var dcList = new List<ServiceRecordDC> { sr };
|
||||
|
||||
var oidList = InsertNewServiceRecords(dcList);
|
||||
var serviceRecordOid = oidList[0];
|
||||
|
||||
if(!string.IsNullOrEmpty(sig.DataBild))
|
||||
if (!string.IsNullOrEmpty(sig.DataBild))
|
||||
{
|
||||
var lSignature = MapperFactory.SignatureDC_Signature.MapToNewEntity(sig);
|
||||
|
||||
@@ -4601,25 +4601,25 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
var lResult = new List<SupportConceptTreeNodeDC>();
|
||||
|
||||
foreach(var iSc in pSupportConcepts)
|
||||
foreach (var iSc in pSupportConcepts)
|
||||
{
|
||||
var lScNode = new SupportConceptTreeNodeDC
|
||||
{
|
||||
NodeType = NodeType.SupportConcept,
|
||||
SupportConcept = MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDC(iSc),
|
||||
NodeType = NodeType.SupportConcept,
|
||||
SupportConcept = MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDC(iSc),
|
||||
Description = $"{iSc.Customer.Person.LastName}, {iSc.Customer.Person.FirstName}"
|
||||
};
|
||||
|
||||
foreach(var iSc2Cb in iSc.CostBearer2SupportConceptList)
|
||||
|
||||
foreach (var iSc2Cb in iSc.CostBearer2SupportConceptList)
|
||||
{
|
||||
var treeNode = new SupportConceptTreeNodeDC
|
||||
{
|
||||
NodeType = NodeType.SupportConceptCostBearerRelDC,
|
||||
SupportConcept = lScNode.SupportConcept,
|
||||
NodeType = NodeType.SupportConceptCostBearerRelDC,
|
||||
SupportConcept = lScNode.SupportConcept,
|
||||
SupportConceptCostBearerRelDC = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(iSc2Cb)
|
||||
};
|
||||
|
||||
if(iSc2Cb.CostBearer.Organisation != null)
|
||||
if (iSc2Cb.CostBearer.Organisation != null)
|
||||
{
|
||||
treeNode.Description = iSc2Cb.CostBearer.Organisation.Name;
|
||||
}
|
||||
@@ -4869,7 +4869,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var customerAppCode = new CustomerAPPCodeDC();
|
||||
var result = DeletZufallsCode(apikey, kundennummer, "C" + customeroid);
|
||||
|
||||
if(result == 0 || result == 32)
|
||||
if (result == 0 || result == 32)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -4877,9 +4877,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
var anzahl = customerappcode.Count;
|
||||
|
||||
if(anzahl > 0)
|
||||
if (anzahl > 0)
|
||||
{
|
||||
foreach(var code in customerappcode)
|
||||
foreach (var code in customerappcode)
|
||||
{
|
||||
code.CustomerCode = string.Empty;
|
||||
code.CustomerCodeGenDate = DateTime.Now;
|
||||
@@ -4894,7 +4894,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
customerAppCode.Result = 4;
|
||||
return customerAppCode;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -4909,7 +4909,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var employeeAppCode = new EmployeeAPPCodeDC();
|
||||
var result = DeletZufallsCode(apikey, kundennummer, "E" + employeeoid);
|
||||
|
||||
if(result == 0 || result == 32)
|
||||
if (result == 0 || result == 32)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -4917,9 +4917,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
var anzahl = employeeappcode.Count;
|
||||
|
||||
if(anzahl > 0)
|
||||
if (anzahl > 0)
|
||||
{
|
||||
foreach(var code in employeeappcode)
|
||||
foreach (var code in employeeappcode)
|
||||
{
|
||||
code.EmployeeCode = string.Empty;
|
||||
code.EmployeeCodeGenDate = DateTime.Now;
|
||||
@@ -4936,7 +4936,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return employeeAppCode;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -5769,107 +5769,107 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee11()
|
||||
{
|
||||
try
|
||||
{
|
||||
return GetAbsenceTimeDCEmployee41(DateTime.MinValue, DateTime.MaxValue, null, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
//public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee11()
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// return GetAbsenceTimeDCEmployee41(DateTime.MinValue, DateTime.MaxValue, null, null);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw Utils.CreateBeWoFaultException(e);
|
||||
// }
|
||||
//}
|
||||
|
||||
public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee21(List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes)
|
||||
{
|
||||
try
|
||||
{
|
||||
return GetAbsenceTimeDCEmployee41(DateTime.MinValue, DateTime.MaxValue, absenceReasons, employmentTypes);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
//public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee21(List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// return GetAbsenceTimeDCEmployee41(DateTime.MinValue, DateTime.MaxValue, absenceReasons, employmentTypes);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw Utils.CreateBeWoFaultException(e);
|
||||
// }
|
||||
//}
|
||||
|
||||
public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee31(DateTime start, DateTime end)
|
||||
{
|
||||
try
|
||||
{
|
||||
return GetAbsenceTimeDCEmployee41(start, end, null, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
//public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee31(DateTime start, DateTime end)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// return GetAbsenceTimeDCEmployee41(start, end, null, null);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw Utils.CreateBeWoFaultException(e);
|
||||
// }
|
||||
//}
|
||||
|
||||
public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee41(DateTime start, DateTime end, List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes)
|
||||
{
|
||||
try
|
||||
{
|
||||
var absenceReasonIDs = (absenceReasons == null || !absenceReasons.Any()) ? null : absenceReasons.Select(x => x.AbsenceReasonOid.Value).ToList();
|
||||
var employmentTypeIDs = (employmentTypes == null || !employmentTypes.Any()) ? null : employmentTypes.Select(x => x.EmploymentTypeOid.Value).ToList();
|
||||
//public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee41(DateTime start, DateTime end, List<AbsenceReasonDC> absenceReasons, List<EmploymentTypeDC> employmentTypes)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// var absenceReasonIDs = (absenceReasons == null || !absenceReasons.Any()) ? null : absenceReasons.Select(x => x.AbsenceReasonOid.Value).ToList();
|
||||
// var employmentTypeIDs = (employmentTypes == null || !employmentTypes.Any()) ? null : employmentTypes.Select(x => x.EmploymentTypeOid.Value).ToList();
|
||||
|
||||
return GetAbsenceTimeDCEmployee51(start, end, absenceReasonIDs, employmentTypeIDs);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
// return GetAbsenceTimeDCEmployee51(start, end, absenceReasonIDs, employmentTypeIDs);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw Utils.CreateBeWoFaultException(e);
|
||||
// }
|
||||
//}
|
||||
|
||||
public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee51(DateTime start, DateTime end, List<long> absenceReasonIDs, List<long> employmentTypeIDs)
|
||||
{
|
||||
try
|
||||
{
|
||||
Func<AbsenceTime, bool> endHasValueMatch = (x) => x.End.HasValue;
|
||||
//public Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>> GetAbsenceTimeDCEmployee51(DateTime start, DateTime end, List<long> absenceReasonIDs, List<long> employmentTypeIDs)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// Func<AbsenceTime, bool> endHasValueMatch = (x) => x.End.HasValue;
|
||||
|
||||
Func<AbsenceTime, bool> leftMatch;
|
||||
Func<AbsenceTime, bool> rightMatch;
|
||||
Func<AbsenceTime, bool> absenceReasonMatch;
|
||||
Func<Employee, bool> employmentTypeMatch;
|
||||
// Func<AbsenceTime, bool> leftMatch;
|
||||
// Func<AbsenceTime, bool> rightMatch;
|
||||
// Func<AbsenceTime, bool> absenceReasonMatch;
|
||||
// Func<Employee, bool> employmentTypeMatch;
|
||||
|
||||
if (start != DateTime.MinValue) leftMatch = (x) => start <= x.End;
|
||||
else leftMatch = (x) => true;
|
||||
// if (start != DateTime.MinValue) leftMatch = (x) => start <= x.End;
|
||||
// else leftMatch = (x) => true;
|
||||
|
||||
if (end != DateTime.MaxValue) rightMatch = (x) => end >= x.Start;
|
||||
else rightMatch = (x) => true;
|
||||
// if (end != DateTime.MaxValue) rightMatch = (x) => end >= x.Start;
|
||||
// else rightMatch = (x) => true;
|
||||
|
||||
if (absenceReasonIDs != null) absenceReasonMatch = (x) => absenceReasonIDs.Contains(x.AbsenceReason.Oid.Value);
|
||||
else absenceReasonMatch = (x) => true;
|
||||
// if (absenceReasonIDs != null) absenceReasonMatch = (x) => absenceReasonIDs.Contains(x.AbsenceReason.Oid.Value);
|
||||
// else absenceReasonMatch = (x) => true;
|
||||
|
||||
if (employmentTypeIDs != null) employmentTypeMatch = (x) => employmentTypeIDs.Contains(x.Oid.Value);
|
||||
else employmentTypeMatch = (x) => true;
|
||||
// if (employmentTypeIDs != null) employmentTypeMatch = (x) => employmentTypeIDs.Contains(x.Oid.Value);
|
||||
// else employmentTypeMatch = (x) => true;
|
||||
|
||||
Func<AbsenceTime, bool> absenceMatch = (x) => rightMatch(x) && (!endHasValueMatch(x) || leftMatch(x)) && absenceReasonMatch(x);
|
||||
//startMatch(x) && (!endHasValueMatch(x) || endMatch(x)) && absenceReasonMatch(x);
|
||||
// Func<AbsenceTime, bool> absenceMatch = (x) => rightMatch(x) && (!endHasValueMatch(x) || leftMatch(x)) && absenceReasonMatch(x);
|
||||
// //startMatch(x) && (!endHasValueMatch(x) || endMatch(x)) && absenceReasonMatch(x);
|
||||
|
||||
var res1 = new List<AbsenceTime>();
|
||||
var res2 = new HashSet<Employee>();
|
||||
// var res1 = new List<AbsenceTime>();
|
||||
// var res2 = new HashSet<Employee>();
|
||||
|
||||
var allAbsences = DAOFactory.GenericDAO.GetAllActive<AbsenceTime>().Where(x => x.EmployeeOid.HasValue);
|
||||
var allEmployees = DAOFactory.GenericDAO.GetAllActive<Employee>().ToList();
|
||||
// var allAbsences = DAOFactory.GenericDAO.GetAllActive<AbsenceTime>().Where(x => x.EmployeeOid.HasValue);
|
||||
// var allEmployees = DAOFactory.GenericDAO.GetAllActive<Employee>().ToList();
|
||||
|
||||
foreach (var absence in allAbsences.Where(absenceMatch)) //allAbsences.Where(absenceMatch))
|
||||
{
|
||||
var employee = allEmployees.Find(x => x.Oid == absence.EmployeeOid.Value);
|
||||
// foreach (var absence in allAbsences.Where(absenceMatch)) //allAbsences.Where(absenceMatch))
|
||||
// {
|
||||
// var employee = allEmployees.Find(x => x.Oid == absence.EmployeeOid.Value);
|
||||
|
||||
if (!employmentTypeMatch(employee))
|
||||
continue;
|
||||
// if (!employmentTypeMatch(employee))
|
||||
// continue;
|
||||
|
||||
res1.Add(absence);
|
||||
res2.Add(employee);
|
||||
}
|
||||
// res1.Add(absence);
|
||||
// res2.Add(employee);
|
||||
// }
|
||||
|
||||
return new Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>>(MapperFactory.AbsenceTimeDC_AbsenceTime.MapToNewDCs(res1), MapperFactory.EmployeeDC_Employee.MapToNewDCs(res2.ToList()));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
// return new Tuple<IList<AbsenceTimeDC>, IList<EmployeeDC>>(MapperFactory.AbsenceTimeDC_AbsenceTime.MapToNewDCs(res1), MapperFactory.EmployeeDC_Employee.MapToNewDCs(res2.ToList()));
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw Utils.CreateBeWoFaultException(e);
|
||||
// }
|
||||
//}
|
||||
|
||||
public IList<AbsenceReasonDC> GetAllAbsenceReason()
|
||||
{
|
||||
@@ -6010,7 +6010,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
var list = DAOFactory.GenericDAO.GetAllActive<RatingType>();
|
||||
var result = MapperFactory.RatingTypeDC_RatingType.MapToNewDCs(list);
|
||||
|
||||
|
||||
return result.OrderBy(r => r.Position).ToList();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -6081,9 +6081,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
|
||||
var allRatingTypes = MapperFactory.RatingTypeDC_RatingType.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<RatingType>());
|
||||
|
||||
|
||||
List<GoalRatingDC> result = new List<GoalRatingDC>();
|
||||
|
||||
|
||||
var records = DAOFactory.SearchDAO.FindServiceRecords(supportConceptOid, costBearer2SupportConceptOid, serviceCategoryOid, start, end);
|
||||
|
||||
foreach (var serviceRecord in records)
|
||||
@@ -6108,23 +6108,23 @@ namespace BeWo.Service.ServiceImplementations
|
||||
if (ve.Type == ValueListEntryType.SupportConceptGoalType ||
|
||||
ve.Type == ValueListEntryType.SupportConceptIndividualGoalType)
|
||||
{
|
||||
|
||||
|
||||
//Bei Maßnahmen nimm das übergeordnete Ziel
|
||||
if (ve.ParentOid.HasValue && oid2Entry.ContainsKey(ve.ParentOid.Value))
|
||||
{
|
||||
gr.GoalEntry = oid2Entry[ve.ParentOid.Value];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
result.Add(gr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -6212,7 +6212,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -6286,7 +6286,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
DAOFactory.GenericDAO.Insert(confRecSig);
|
||||
}
|
||||
catch(Exception exception)
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
@@ -6300,7 +6300,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
DAOFactory.GenericDAO.Insert(confRecSigs);
|
||||
}
|
||||
catch(Exception exception)
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
@@ -6314,7 +6314,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
DAOFactory.GenericDAO.Delete(confirmationReceiptSignatureToDelete);
|
||||
}
|
||||
catch(Exception exception)
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
@@ -6334,7 +6334,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDC(updatedConfirmationReceiptSignature);
|
||||
}
|
||||
catch(Exception exception)
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
@@ -6350,7 +6350,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return signatureDCs;
|
||||
}
|
||||
catch(Exception exception)
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
@@ -6366,7 +6366,57 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return signatureDCs;
|
||||
}
|
||||
catch(Exception exception)
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
}
|
||||
|
||||
public List<EmployeeDC> GetAbsenceOverview(AbsenceOverviewFilterDC filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = new List<EmployeeDC>();
|
||||
var vs = PluginLoader.FindClass<VacationService>();
|
||||
|
||||
var allEmployees = DAOFactory.GenericDAO.GetAllActive<Employee>().ToList();
|
||||
|
||||
foreach (var emp in allEmployees.OrderBy(x => x.Person.LastNameFirstName))
|
||||
{
|
||||
if (filter.EmploymentType != null)
|
||||
if (!emp.Contracts.Any(x => x.EmploymentType != null && filter.EmploymentType.Contains(x.EmploymentType.Oid.Value)))
|
||||
continue;
|
||||
|
||||
|
||||
var dict = vs.BerechneUrlaubskonto(emp, filter.Year);
|
||||
|
||||
if(filter.AbsenceReasons != null)
|
||||
emp.AbsenceTimes.RemoveRange(x => !filter.AbsenceReasons.Contains(x.AbsenceReason.Oid.Value));
|
||||
|
||||
var empDC = MapperFactory.EmployeeDC_Employee.MapToNewDC(emp);
|
||||
empDC.Urlaubskonto = dict[filter.Year];
|
||||
|
||||
res.Add(empDC);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
}
|
||||
|
||||
public UrlaubskontoDC GetUrlaubskontoByEmployee(long empOid, int year)
|
||||
{
|
||||
try
|
||||
{
|
||||
var vs = PluginLoader.FindClass<VacationService>();
|
||||
var emp = DAOFactory.GenericDAO.GetByID<Employee>(empOid);
|
||||
|
||||
return vs.BerechneUrlaubskonto(emp, year)[year];
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
|
||||
21
Shared/DataContracts/AbsenceOverviewFilterDC.cs
Normal file
21
Shared/DataContracts/AbsenceOverviewFilterDC.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace BS.Shared.DataContracts
|
||||
{
|
||||
[DataContract]
|
||||
public partial class AbsenceOverviewFilterDC : IDataContract
|
||||
{
|
||||
[DataMember]
|
||||
public List<long> AbsenceReasons { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public List<long> EmploymentType { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public int Year { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public int Month { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -129,8 +129,9 @@ namespace BS.Shared.DataContracts
|
||||
[DataMember]
|
||||
public virtual String Schutzstufe { get; set; }
|
||||
|
||||
//[DataMember]
|
||||
//public UrlaubskontoDC Urlaubskonto { get; set; }
|
||||
[DataMember]
|
||||
public UrlaubskontoDC Urlaubskonto { get; set; }
|
||||
|
||||
|
||||
public SolidColorBrush GetBrush()
|
||||
{
|
||||
|
||||
28
Shared/DataContracts/UrlaubskontoDC.cs
Normal file
28
Shared/DataContracts/UrlaubskontoDC.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace BS.Shared.DataContracts
|
||||
{
|
||||
[DebuggerDisplay("E: {EmployeeOid} V:{ResturlaubVorjahr}/{ResturlaubVorjahrTotal} N:{Resturlaub}/{Urlaubsanspruch}")]
|
||||
[DataContract]
|
||||
public class UrlaubskontoDC : IDataContract
|
||||
{
|
||||
[DataMember]
|
||||
public long EmployeeOid { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public decimal ResturlaubVorjahr { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public decimal ResturlaubVorjahrTotal { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public decimal Resturlaub { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public decimal Urlaubsanspruch { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ namespace BS.Shared.Extensions
|
||||
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
public static DateTimeUnit GetDateTimeUnit(this DateTime Date1, DateTime Date2, TimeUnit unit)
|
||||
public static DateTimeUnit GetDateTimeUnit(this DateTime Date1, DateTime Date2, TimeUnit unit)
|
||||
{
|
||||
List<DateTime> period = new List<DateTime>() { Date1, Date2 };
|
||||
period.Sort(DateTime.Compare);
|
||||
@@ -76,7 +76,7 @@ namespace BS.Shared.Extensions
|
||||
break;
|
||||
case TimeUnit.Halfyear:
|
||||
int halfyear = 0;
|
||||
|
||||
|
||||
while (startDate.AddMonths(6) <= ds.EndDate)
|
||||
{
|
||||
startDate = startDate.AddMonths(6);
|
||||
@@ -99,7 +99,7 @@ namespace BS.Shared.Extensions
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return ds;
|
||||
@@ -198,15 +198,15 @@ namespace BS.Shared.Extensions
|
||||
|
||||
public static int GetWeekdayOccurence(this DateTime pDateTime, bool pForward)
|
||||
{
|
||||
if (pForward)
|
||||
if (pForward)
|
||||
{
|
||||
return (int)Math.Ceiling(pDateTime.Day / 7d);
|
||||
}
|
||||
|
||||
return (int)Math.Ceiling((DateTime.DaysInMonth(pDateTime.Year, pDateTime.Month) - pDateTime.Day) / 7d);
|
||||
return (int)Math.Ceiling((DateTime.DaysInMonth(pDateTime.Year, pDateTime.Month) - pDateTime.Day) / 7d);
|
||||
}
|
||||
|
||||
public static bool InBetween(this DateTime pDateTime, DateTime pSpanStart, DateTime pSpanStop, bool ignoreTimeAndCompareWholeDays)
|
||||
public static bool InBetween(this DateTime pDateTime, DateTime pSpanStart, DateTime pSpanStop, bool ignoreTimeAndCompareWholeDays)
|
||||
{
|
||||
DateTime stop = pSpanStop;
|
||||
if (ignoreTimeAndCompareWholeDays)
|
||||
@@ -278,135 +278,135 @@ namespace BS.Shared.Extensions
|
||||
}
|
||||
}
|
||||
|
||||
public static WeekOfMonth GetWeekOfMonth(this DateTime pDateTime, DayOfWeek WeekStartingOn)
|
||||
{
|
||||
var x = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(pDateTime, CalendarWeekRule.FirstFourDayWeek, WeekStartingOn);
|
||||
var y = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(pDateTime.AddDays(1 - pDateTime.Day), CalendarWeekRule.FirstFourDayWeek, WeekStartingOn);
|
||||
var r = x - y + 1;
|
||||
public static WeekOfMonth GetWeekOfMonth(this DateTime pDateTime, DayOfWeek WeekStartingOn)
|
||||
{
|
||||
var x = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(pDateTime, CalendarWeekRule.FirstFourDayWeek, WeekStartingOn);
|
||||
var y = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(pDateTime.AddDays(1 - pDateTime.Day), CalendarWeekRule.FirstFourDayWeek, WeekStartingOn);
|
||||
var r = x - y + 1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 1:
|
||||
return WeekOfMonth.First;
|
||||
case 2:
|
||||
return WeekOfMonth.Second;
|
||||
case 3:
|
||||
return WeekOfMonth.Third;
|
||||
case 4:
|
||||
return WeekOfMonth.Fourth;
|
||||
default:
|
||||
return WeekOfMonth.None;
|
||||
}
|
||||
}
|
||||
switch (r)
|
||||
{
|
||||
case 1:
|
||||
return WeekOfMonth.First;
|
||||
case 2:
|
||||
return WeekOfMonth.Second;
|
||||
case 3:
|
||||
return WeekOfMonth.Third;
|
||||
case 4:
|
||||
return WeekOfMonth.Fourth;
|
||||
default:
|
||||
return WeekOfMonth.None;
|
||||
}
|
||||
}
|
||||
|
||||
public static DateTime GetXthLastOccurenceInMonth(this DateTime pDateTime, DayOfWeek pDayOfWeek, int x)
|
||||
{
|
||||
var initialDate = new DateTime(pDateTime.Year, pDateTime.Month, DateTime.DaysInMonth(pDateTime.Year, pDateTime.Month));
|
||||
var lastOccurence = initialDate;
|
||||
public static DateTime GetXthLastOccurenceInMonth(this DateTime pDateTime, DayOfWeek pDayOfWeek, int x)
|
||||
{
|
||||
var initialDate = new DateTime(pDateTime.Year, pDateTime.Month, DateTime.DaysInMonth(pDateTime.Year, pDateTime.Month));
|
||||
var lastOccurence = initialDate;
|
||||
|
||||
for (var currentDate = initialDate; currentDate >= new DateTime(pDateTime.Year, pDateTime.Month, 1); currentDate = currentDate.AddDays(-1))
|
||||
{
|
||||
if (!currentDate.DayOfWeek.Equals(pDayOfWeek)) continue;
|
||||
for (var currentDate = initialDate; currentDate >= new DateTime(pDateTime.Year, pDateTime.Month, 1); currentDate = currentDate.AddDays(-1))
|
||||
{
|
||||
if (!currentDate.DayOfWeek.Equals(pDayOfWeek)) continue;
|
||||
|
||||
lastOccurence = currentDate;
|
||||
break;
|
||||
}
|
||||
lastOccurence = currentDate;
|
||||
break;
|
||||
}
|
||||
|
||||
return lastOccurence.AddDays(-1*7*x);
|
||||
}
|
||||
return lastOccurence.AddDays(-1 * 7 * x);
|
||||
}
|
||||
|
||||
public static int GetOccurenceNumber(this DateTime pDateTime)
|
||||
{
|
||||
var initialDate = new DateTime(pDateTime.Year, pDateTime.Month, DateTime.DaysInMonth(pDateTime.Year, pDateTime.Month));
|
||||
var lastOccurence = initialDate;
|
||||
var dayOfWeek = pDateTime.DayOfWeek;
|
||||
public static int GetOccurenceNumber(this DateTime pDateTime)
|
||||
{
|
||||
var initialDate = new DateTime(pDateTime.Year, pDateTime.Month, DateTime.DaysInMonth(pDateTime.Year, pDateTime.Month));
|
||||
var lastOccurence = initialDate;
|
||||
var dayOfWeek = pDateTime.DayOfWeek;
|
||||
|
||||
for (var currentDate = initialDate; currentDate >= new DateTime(pDateTime.Year, pDateTime.Month, 1); currentDate = currentDate.AddDays(-1))
|
||||
{
|
||||
if (!currentDate.DayOfWeek.Equals(dayOfWeek)) continue;
|
||||
for (var currentDate = initialDate; currentDate >= new DateTime(pDateTime.Year, pDateTime.Month, 1); currentDate = currentDate.AddDays(-1))
|
||||
{
|
||||
if (!currentDate.DayOfWeek.Equals(dayOfWeek)) continue;
|
||||
|
||||
lastOccurence = currentDate;
|
||||
break;
|
||||
}
|
||||
lastOccurence = currentDate;
|
||||
break;
|
||||
}
|
||||
|
||||
return Convert.ToInt32((lastOccurence - pDateTime).TotalDays / 7);
|
||||
}
|
||||
return Convert.ToInt32((lastOccurence - pDateTime).TotalDays / 7);
|
||||
}
|
||||
|
||||
public static int GetIso8601WeekOfYear(this DateTime time)
|
||||
{
|
||||
var day = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(time);
|
||||
if (day >= DayOfWeek.Monday && day <= DayOfWeek.Wednesday)
|
||||
{
|
||||
time = time.AddDays(3);
|
||||
}
|
||||
public static int GetIso8601WeekOfYear(this DateTime time)
|
||||
{
|
||||
var day = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(time);
|
||||
if (day >= DayOfWeek.Monday && day <= DayOfWeek.Wednesday)
|
||||
{
|
||||
time = time.AddDays(3);
|
||||
}
|
||||
|
||||
return CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(time, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
|
||||
}
|
||||
return CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(time, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
|
||||
}
|
||||
|
||||
public static DateTime FirstDateOfWeek(this DateTime date, int weekOfYear)
|
||||
{
|
||||
var jan1 = new DateTime(date.Year, 1, 1);
|
||||
var daysOffset = DayOfWeek.Thursday - jan1.DayOfWeek;
|
||||
public static DateTime FirstDateOfWeek(this DateTime date, int weekOfYear)
|
||||
{
|
||||
var jan1 = new DateTime(date.Year, 1, 1);
|
||||
var daysOffset = DayOfWeek.Thursday - jan1.DayOfWeek;
|
||||
|
||||
var firstThursday = jan1.AddDays(daysOffset);
|
||||
var cal = CultureInfo.CurrentCulture.Calendar;
|
||||
var firstWeek = cal.GetWeekOfYear(firstThursday, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
|
||||
var firstThursday = jan1.AddDays(daysOffset);
|
||||
var cal = CultureInfo.CurrentCulture.Calendar;
|
||||
var firstWeek = cal.GetWeekOfYear(firstThursday, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
|
||||
|
||||
var weekNum = weekOfYear;
|
||||
if (firstWeek <= 1)
|
||||
{
|
||||
weekNum -= 1;
|
||||
}
|
||||
var result = firstThursday.AddDays(weekNum * 7);
|
||||
return result.AddDays(-3);
|
||||
}
|
||||
var weekNum = weekOfYear;
|
||||
if (firstWeek <= 1)
|
||||
{
|
||||
weekNum -= 1;
|
||||
}
|
||||
var result = firstThursday.AddDays(weekNum * 7);
|
||||
return result.AddDays(-3);
|
||||
}
|
||||
|
||||
public static bool CompareShortDates(this DateTime date, DateTime pDate)
|
||||
{
|
||||
return date.Year == pDate.Year && date.Month == pDate.Month && date.Day == pDate.Day;
|
||||
}
|
||||
public static bool CompareShortDates(this DateTime date, DateTime pDate)
|
||||
{
|
||||
return date.Year == pDate.Year && date.Month == pDate.Month && date.Day == pDate.Day;
|
||||
}
|
||||
|
||||
public static double GetIntersectingMinutes(this DateTime start1, DateTime end1, DateTime start2, DateTime end2)
|
||||
{
|
||||
var e = end1 <= end2 ? end1 : end2;
|
||||
var s = start1 >= start2 ? start1 : start2;
|
||||
public static double GetIntersectingMinutes(this DateTime start1, DateTime end1, DateTime start2, DateTime end2)
|
||||
{
|
||||
var e = end1 <= end2 ? end1 : end2;
|
||||
var s = start1 >= start2 ? start1 : start2;
|
||||
|
||||
return s > e ? 0 : (e - s).TotalMinutes;
|
||||
}
|
||||
return s > e ? 0 : (e - s).TotalMinutes;
|
||||
}
|
||||
|
||||
public static DateTime GetNextDayOfWeek(this DateTime start, DayOfWeek WeekDay)
|
||||
{
|
||||
var result = start;
|
||||
public static DateTime GetNextDayOfWeek(this DateTime start, DayOfWeek WeekDay)
|
||||
{
|
||||
var result = start;
|
||||
|
||||
while (!result.DayOfWeek.Equals(WeekDay))
|
||||
{
|
||||
result = result.AddDays(1);
|
||||
}
|
||||
while (!result.DayOfWeek.Equals(WeekDay))
|
||||
{
|
||||
result = result.AddDays(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static DateTime GetShortDateTime(this DateTime date)
|
||||
{
|
||||
return new DateTime(date.Year, date.Month, date.Day);
|
||||
}
|
||||
public static DateTime GetShortDateTime(this DateTime date)
|
||||
{
|
||||
return new DateTime(date.Year, date.Month, date.Day);
|
||||
}
|
||||
|
||||
public static int GetDayNumberBetweenTwoDates(this DateTime anteriorDate, DateTime posteriorDate)
|
||||
{
|
||||
var value = 0;
|
||||
public static int GetDayNumberBetweenTwoDates(this DateTime anteriorDate, DateTime posteriorDate)
|
||||
{
|
||||
var value = 0;
|
||||
|
||||
var shortAnteriorDate = new DateTime(anteriorDate.Year, anteriorDate.Month, anteriorDate.Day);
|
||||
var shortPosteriorDate = new DateTime(posteriorDate.Year, posteriorDate.Month, posteriorDate.Day);
|
||||
var tmpDate = shortAnteriorDate;
|
||||
var shortAnteriorDate = new DateTime(anteriorDate.Year, anteriorDate.Month, anteriorDate.Day);
|
||||
var shortPosteriorDate = new DateTime(posteriorDate.Year, posteriorDate.Month, posteriorDate.Day);
|
||||
var tmpDate = shortAnteriorDate;
|
||||
|
||||
while (tmpDate < shortPosteriorDate)
|
||||
{
|
||||
tmpDate = tmpDate.AddDays(1);
|
||||
value++;
|
||||
}
|
||||
while (tmpDate < shortPosteriorDate)
|
||||
{
|
||||
tmpDate = tmpDate.AddDays(1);
|
||||
value++;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Erzeugt aus zwei Datumsobjekten ein neues mit den Datumsangaben des ersten und den Zeitangaben des zweiten Parameters.
|
||||
@@ -426,7 +426,7 @@ namespace BS.Shared.Extensions
|
||||
|
||||
public static WeekDays GetSchedulerWeekDays(this DateTime pDateTime)
|
||||
{
|
||||
return (WeekDays) (int) Math.Pow(2, (double) pDateTime.DayOfWeek);
|
||||
return (WeekDays)(int)Math.Pow(2, (double)pDateTime.DayOfWeek);
|
||||
}
|
||||
|
||||
public static WeekOfMonth GetWeekOfMonthForRecurrenceInfo(this DateTime pDate)
|
||||
@@ -553,5 +553,31 @@ namespace BS.Shared.Extensions
|
||||
{
|
||||
return date.MergeDateAndTimeSpan(new TimeSpan(0, 0, 1));
|
||||
}
|
||||
|
||||
public static DateTime? GetMin(this DateTime? d1, DateTime? d2)
|
||||
{
|
||||
if (d1 != null && d2 == null)
|
||||
return d1;
|
||||
if (d1 == null && d2 != null)
|
||||
return d2;
|
||||
|
||||
if (d1 <= d2)
|
||||
return d1;
|
||||
|
||||
return d2;
|
||||
}
|
||||
|
||||
public static DateTime? GetMax(this DateTime? d1, DateTime? d2)
|
||||
{
|
||||
if (d1 != null && d2 == null)
|
||||
return d1;
|
||||
if (d1 == null && d2 != null)
|
||||
return d2;
|
||||
|
||||
if (d1 >= d2)
|
||||
return d1;
|
||||
|
||||
return d2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,7 @@
|
||||
<Compile Include="Core\EventArgs.cs" />
|
||||
<Compile Include="Core\ObservableSortCollection.cs" />
|
||||
<Compile Include="Core\WohnheimbuchungsIntervall.cs" />
|
||||
<Compile Include="DataContracts\AbsenceOverviewFilterDC.cs" />
|
||||
<Compile Include="DataContracts\AdditionalServiceBookingDC.cs" />
|
||||
<Compile Include="DataContracts\AdditionalServiceDC.cs" />
|
||||
<Compile Include="DataContracts\AdditionalServiceGroupOfPeopleDC.cs" />
|
||||
@@ -214,6 +215,7 @@
|
||||
<Compile Include="DataContracts\RatingDC.cs" />
|
||||
<Compile Include="DataContracts\TextbausteinDC.cs" />
|
||||
<Compile Include="DataContracts\TimeSheetStatusItemDC.cs" />
|
||||
<Compile Include="DataContracts\UrlaubskontoDC.cs" />
|
||||
<Compile Include="DataContracts\VertretungsKlientAccountingsListeItemsDC.cs" />
|
||||
<Compile Include="DataContracts\QuittierungsCheckViewListItemsDC.cs" />
|
||||
<Compile Include="DataContracts\VertretungsListeMitarbeiterItemsDC.cs" />
|
||||
|
||||
Reference in New Issue
Block a user