Files
BeWoPlaner/Service/Plugins/ResourceService.cs
Lyndon bacc7fcedd Verhindern, dass Ressourcen doppelt gebucht werden mit Recht: ToDoOID=91266751
Serientermine können gelöscht werden, aber es fehlt noch eine Abfrage, ob man wirklich löschen will bei normalen Terminen.
2026-07-13 20:32:48 +02:00

37 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Service.DCEntityMapper;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace BeWo.Service.Plugins
{
public class ResourceService : AbstractIDSpecificDefaultClass<ResourceService>
{
public virtual string ValidateSchedulerAppointment(DateTime start, DateTime end, IEnumerable<long> employees, IEnumerable<long> customers, List<long> resources, long originator, long? appointmentOid, Guid? recurrenceId, int occurrenceIndex = 0, bool shouldSkipResourceAvailability = false)
{
return DAOFactory.SearchDAO.ValidateSchedulerAppointment(start, end, employees, customers, resources, originator, appointmentOid, recurrenceId, occurrenceIndex);
}
public virtual List<ResourceDC> CheckResourceAvailability(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid)
{
var list = new List<ResourceDC>();
var resources = DAOFactory.SearchDAO.CheckAvailabilityOfResources(resourceOids, start, end, selectedAppointmentOid);
foreach(var resource in resources)
{
list.AddIfNotIn(MapperFactory.ResourceDC_Resource.MapToNewDC(resource));
}
return list;
}
public virtual Dictionary<string, List<string>> CheckResourceAvailabilityWithBookingEmployees(DateTime start, DateTime end, List<long> resourceOids, long? selectedAppointmentOid, Guid? recurrenceId, int occurrenceIndex = 0, bool shouldSkipResourceAvailability = false)
{
return DAOFactory.SearchDAO.CheckResourceAvailabilityWithEmployeeInformation(start, end, resourceOids, selectedAppointmentOid, recurrenceId, occurrenceIndex);
}
}
}