MH: AssistenzaReports Meldung beim Speichern der Zeiterfassung ohne Zeiten

SupportOID=167514
This commit is contained in:
2026-07-08 13:26:53 +02:00
parent f0e0a553b3
commit f967e5a56a
2 changed files with 34 additions and 0 deletions

View File

@@ -154,6 +154,7 @@
<Compile Include="Quittierungsbeleg.designer.cs">
<DependentUpon>Quittierungsbeleg.cs</DependentUpon>
</Compile>
<Compile Include="Service\CustomServiceRecordValidator.cs" />
<Compile Include="Service\CustomVacationService.cs" />
<Compile Include="SettlementReport2.cs">
<SubType>Component</SubType>

View File

@@ -0,0 +1,33 @@
using BeWo.Service.Plugins;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AssistenzaReports.Service
{
public class CustomServiceRecordValidator : ServiceRecordValidator
{
public override List<ServiceRecordValidationResultDC> ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statisticsXX, int maxDaysEditServiceRecordsAllowed, IList<long> employeeOids, IList<long> cb2scOids)
{
var list = base.ValidateServiceRecord(newServiceRecord, statisticsXX, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
if (newServiceRecord.Start == null && newServiceRecord.End == null ||
newServiceRecord.Start.HasValue && newServiceRecord.Start.Value.Second == 1 &&
newServiceRecord.End.HasValue && newServiceRecord.End.Value.Second == 1)
{
list.Add(new ServiceRecordValidationResultDC()
{
Allow = false,
ResultType = BS.Shared.ServiceRecordValidationResult.Custom,
Message = "Sie können den Eintrag nicht speichern, ohne eine Start- und Endzeit einzugeben."
});
}
return list;
}
}
}