MH: Humanitas Einträge ohne Uhrzeiten verhindert
SupportOID=168640
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
<Compile Include="ServicesOverviewReport.Designer.cs">
|
||||
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service\CustomServiceRecordValidator.cs" />
|
||||
<Compile Include="Service\CustomVacationService.cs" />
|
||||
<Compile Include="SettlementReport.cs">
|
||||
<SubType>Component</SubType>
|
||||
|
||||
33
ReportImp/Humanitas/Service/CustomServiceRecordValidator.cs
Normal file
33
ReportImp/Humanitas/Service/CustomServiceRecordValidator.cs
Normal 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 Humanitas.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.ServiceDescription.Category.IsBillable && (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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user