16-12-2022

This commit is contained in:
Jonathan Jenne
2022-12-16 15:59:26 +01:00
parent 63edd9e542
commit 45f8dd2aad
32 changed files with 431 additions and 276 deletions

View File

@@ -0,0 +1,40 @@
using DigitalData.Modules.Logging;
using ECM.JobRunner.Common.JobRunnerReference;
namespace ECM.JobRunner.Web.Data
{
public class HelperService
{
private readonly Logger logger;
private readonly IEDMIServiceChannel channel;
public HelperService(LoggingService Logging, WcfService Wcf)
{
logger = Logging.LogConfig.GetLogger();
channel = Wcf.Channel;
}
public DateTime GetNextExecutionTime(string pCronExpression)
{
Quartz.CronExpression expression = new(pCronExpression);
if (expression != null)
{
var next = expression.GetNextValidTimeAfter(DateTimeOffset.Now);
if (next != null)
{
return ((DateTimeOffset)next).DateTime;
}
else
{
return DateTime.MinValue;
}
}
else
{
return DateTime.MinValue;
}
}
}
}