LebenshilfeStade/Service/CustomServiceRecordValidator.cs - Notice2 zum Pflichtfeld
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
<Reference Include="DevExpress.Data.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.DataAccess.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Mvvm.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
@@ -136,6 +135,7 @@
|
||||
<Compile Include="ServicesOverviewReport.Designer.cs">
|
||||
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service\CustomServiceRecordValidator.cs" />
|
||||
<Compile Include="SettlementReport.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
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 LebenshilfeStade.Service
|
||||
{
|
||||
public class CustomServiceRecordValidator : ServiceRecordValidator
|
||||
{
|
||||
public override List<ServiceRecordValidationResultDC> ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics, int maxDaysEditServiceRecordsAllowed, IList<long> employeeOids, IList<long> cb2scOids)
|
||||
{
|
||||
var validation = base.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
|
||||
|
||||
// Prüfen, dass beim Speichern der Doku bei Kategorie "Wegezeit" nur Fahrtenbuch ausgefüllt werden muss und ansonsten alles AUßER
|
||||
if (newServiceRecord.Notice2.IsNullOrEmpty())
|
||||
{
|
||||
var res = new ServiceRecordValidationResultDC()
|
||||
{
|
||||
Allow = false,
|
||||
EmployeeName = newServiceRecord.Employee.LastName + ", " + newServiceRecord.Employee.FirstName,
|
||||
StartDate = newServiceRecord.Start.Value,
|
||||
EndDate = newServiceRecord.End.Value,
|
||||
ResultType = BS.Shared.ServiceRecordValidationResult.Custom,
|
||||
Message = "Das Dokumentationsfeld \"Ort der Leistung\" muss ausgefüllt werden."
|
||||
};
|
||||
|
||||
validation.Add(res);
|
||||
}
|
||||
|
||||
return validation;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user