BundBBetreutesWohnen/Validation/ServiceRecordValidator - kein Speichern Fehlkontakt > 2h
This commit is contained in:
@@ -119,6 +119,7 @@
|
||||
<Compile Include="Teamstundenkonto.designer.cs">
|
||||
<DependentUpon>Teamstundenkonto.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Validation\ServiceRecordValidator.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Mitarbeiterarbeitszeitkonto.resx">
|
||||
@@ -161,6 +162,10 @@
|
||||
<Project>{40d8b312-ea64-49e3-a31a-5e57ed4d5654}</Project>
|
||||
<Name>Report</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Service\Service.csproj">
|
||||
<Project>{094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}</Project>
|
||||
<Name>Service</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user