38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
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.ServiceDescription.Category.Name.ToLower().Contains("arbeitszeit"))
|
|
return list;
|
|
|
|
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;
|
|
}
|
|
}
|
|
} |