public ActionResult CreateNewEntry(ManualActionExecutionData.ManualActionExecution element, [FromQuery(Name = "eventSource")] string eventSource) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } ChainScheduleManager <ManualChainedActionExecution> .AddEntry(new ManualChainedActionExecution(element), eventSource); return(Ok()); }
public ActionResult CreateNewEntries(ManualActionExecutionData element) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } foreach (ManualActionExecutionData.ManualActionExecution manualActionExecution in element.ExecutionList) { ChainScheduleManager <ManualChainedActionExecution> .AddEntry(new ManualChainedActionExecution(manualActionExecution), element.Name); } return(Ok()); }
private List <ManualOverviewEntry> GetManualEnties() { List <ManualOverviewEntry> returnval = new List <ManualOverviewEntry>(); int count = 0; //TODO: Group by Name, create Duration if it doesn't exists set startetime to entime from last execution ChainScheduleManager <ManualChainedActionExecution> loadedData = DataBaseObjectStorage.LoadFromDataBase(() => new ChainScheduleManager <ManualChainedActionExecution>()); foreach (ChainScheduleManager <ManualChainedActionExecution> .ChainedExecutionData chainedExecutionData in loadedData.Jobs) { returnval.Add(new ManualOverviewEntry() { StartTime = chainedExecutionData.StartTime, ActionName = chainedExecutionData.ElementEventSource, ActivationPriority = count++, ChannelName = GetChannelName(chainedExecutionData.ChainedActionExecutionData.ManualActionExecution.ChannelId), EndTime = chainedExecutionData.StartTime + chainedExecutionData.Duration, MasterEnabled = chainedExecutionData.ChainedActionExecutionData.ManualActionExecution.ActivateMasterChannel }); } return(returnval); }
public ActionResult DeleteManualEntry(int number) { ChainScheduleManager <ManualChainedActionExecution> .DeleteEntry(DataBaseObjectStorage.LoadFromDataBase(() => new ChainScheduleManager <ManualChainedActionExecution>()).Jobs[number]); return(Ok()); }