41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|