16-12-2022
This commit is contained in:
40
ECM.JobRunner.Web/Data/HelperService.cs
Normal file
40
ECM.JobRunner.Web/Data/HelperService.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user