37 lines
969 B
C#
37 lines
969 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Service.Plugins;
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.Extensions;
|
|
using BS.Shared.Services;
|
|
|
|
namespace PerspektivenEV.Validation
|
|
{
|
|
|
|
public class DefaultSaveInterceptor : SaveInterceptor
|
|
{
|
|
public override string AllowSaveCustomer(CustomerDC c)
|
|
{
|
|
if (c.CustomerOid.HasValue)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
if (c.RelatedTeams == null || c.RelatedTeams.Count == 0)
|
|
{
|
|
return "Bitte ordnen Sie ein Team zu bevor Sie speichern.";
|
|
}
|
|
|
|
else if (c.RelatedEmployees == null || c.RelatedEmployees.Count == 0)
|
|
{
|
|
return "Bitte ordnen Sie einen Betreuer/in zu bevor Sie speichern.";
|
|
}
|
|
return base.AllowSaveCustomer(c);
|
|
}
|
|
}
|
|
} |