31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Service.DCEntityMapper;
|
|
using BeWo.Service.Plugins;
|
|
using BS.Shared;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace BundBBetreutesWohnen
|
|
{
|
|
public class BetreuwoServiceRecordValidator : ServiceRecordValidator
|
|
{
|
|
public override List<ServiceRecordValidationResultDC> ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics,
|
|
int maxDaysEditServiceRecordsAllowed, IList<long> employeeOids, IList<long> cb2scOids)
|
|
{
|
|
var result = base.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
|
|
foreach (var r in result)
|
|
{
|
|
if (r.ResultType == ServiceRecordValidationResult.Custom && r.Message.StartsWith("Die eingegebene Dauer des Fehlkontakts"))
|
|
{
|
|
r.Message = r.Message.Replace("Möchten Sie trotzdem speichern?", "").Trim();
|
|
r.Allow = false;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
} |