Files
BeWoPlaner/ReportImp/SynpraxReports/CustomSupportConceptAnalysisCreator.cs
Christian 8d752c2694 Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
# Conflicts:
#	Service/Plugins/PluginLoader.cs
2021-06-22 20:55:30 +02:00

72 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
using BeWo.Service.Configuration;
using BeWo.Service.Plugins;
namespace SynpraxReports
{
public class CustomSupportConceptAnalysisCreator : SupportConceptAnalysisCreator
{
public override List<SupportConceptOverviewDC> GetSupportConceptAnalysis2(IList<long> c2sOids, long? employeeOid, long? teamOid, long? catOid, DateTime? appointedDate,
int? expiredMonths, bool showArchivedScs)
{
var liste = base.GetSupportConceptAnalysis2(c2sOids, employeeOid, teamOid, catOid, appointedDate, expiredMonths,
showArchivedScs);
; DateTime dt = DateTime.Now;
if (appointedDate.HasValue)
{
dt = appointedDate.Value;
}
List<SupportConceptOverviewDC> result = new List<SupportConceptOverviewDC>();
foreach (var dc in liste)
{
DateTime startdate = DateTime.MinValue;
DateTime enddate = DateTime.MaxValue;
if (dc.ApprovedStartDate.HasValue)
{
startdate = dc.ApprovedStartDate.Value;
}
else if (dc.RequestedStartDate.HasValue)
{
startdate = dc.RequestedStartDate.Value;
}
if (dc.ApprovedEndDate.HasValue)
{
enddate = dc.ApprovedEndDate.Value;
}
else if (dc.RequestedEndDate.HasValue)
{
enddate = dc.RequestedEndDate.Value;
}
if (startdate <= dt && dt <= enddate)
{
result.Add(dc);
}
}
return result;
}
}
}