MH: VKM Hamm Doku 10 min in Zukunft speichern
This commit is contained in:
34
ReportImp/VkmHamm/Validation/ServiceRecordValidator.cs
Normal file
34
ReportImp/VkmHamm/Validation/ServiceRecordValidator.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace VkmHamm.Validation
|
||||
{
|
||||
public class CustomServiceRecordValidator : ServiceRecordValidator
|
||||
{
|
||||
public override bool CheckZukunft()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override List<ServiceRecordValidationResultDC> ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics,
|
||||
int maxDaysEditServiceRecordsAllowed, IList<long> employeeOids, IList<long> cb2scOids)
|
||||
{
|
||||
var list = base.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
|
||||
if (newServiceRecord.End.HasValue && newServiceRecord.End.Value > DateTime.Now.AddMinutes(10))
|
||||
{
|
||||
list.Add(new ServiceRecordValidationResultDC
|
||||
{
|
||||
ResultType = ServiceRecordValidationResult.Custom,
|
||||
Message = "Das Ende des dokumentierten Termins darf nicht mehr als 10 Minuten in der Zukunft liegen."
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,6 +163,7 @@
|
||||
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Translation\TranslationDictionary.cs" />
|
||||
<Compile Include="Validation\ServiceRecordValidator.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Data\Data.csproj">
|
||||
|
||||
Reference in New Issue
Block a user