Ejemplo n.º 1
0
 private IList <TaskListItemModel> GetTaskListItems(string taskName = null)
 {
     return(new List <TaskListItemModel>
     {
         new TaskListItemModel
         {
             TaskId = TaskType.UpdateEventsDirectorsNotifications.GetHashCode(),
             TaskName = "Update Events Directors Notifications",
             Description = "Runs the tasks UpdateApprovedEditionsFromStagingDb, UpdateEventsFromStagingDb, UpdateEventDirectors and UpdateNotifications respectively.",
             TaskUrl = Url.Action("UpdateEventsDirectorsNotifications"),
             LastRunTime = LogServices.GetLatestLogByAction("Task", "UpdateEventsDirectorsNotifications")?.CreatedOn,
             IsActive = false
         },
         new TaskListItemModel
         {
             TaskId = TaskType.UpdateApprovedEditionsFromStagingDb.GetHashCode(),
             TaskName = "Update Approved Editions From Staging Db",
             Description = "Makes events published if they're assigned an EventBEID on AX side.",
             TaskUrl = Url.Action("UpdateApprovedEditionsFromStagingDb"),
             LastRunTime = LogServices.GetLatestLogByAction("Task", "UpdateApprovedEditionsFromStagingDb")?.CreatedOn,
             IsActive = true
         },
         new TaskListItemModel
         {
             TaskId = TaskType.UpdateEventsFromStagingDb.GetHashCode(),
             TaskName = "Update Events From Staging Db",
             Description = "Retrives current event data from AX database via Staging database.",
             TaskUrl = Url.Action("UpdateEventsFromStagingDb"),
             LastRunTime = LogServices.GetLatestLogByAction("Task", "UpdateEventsFromStagingDb")?.CreatedOn,
             IsActive = true
         },
         new TaskListItemModel
         {
             TaskId = TaskType.UpdateEventDirectors.GetHashCode(),
             TaskName = "Update Event Directors",
             Description = "Executes related stored procedures to create event director records.",
             TaskUrl = Url.Action("UpdateEventDirectors"),
             LastRunTime = LogServices.GetLatestLogByAction("Task", "UpdateEventDirectors")?.CreatedOn,
             IsActive = true
         },
         new TaskListItemModel
         {
             TaskId = TaskType.UpdateNotifications.GetHashCode(),
             TaskName = "Update Notifications",
             Description = "Sends primary event directors notifications relating to events' status.",
             TaskUrl = Url.Action("UpdateNotifications"),
             LastRunTime = LogServices.GetLatestLogByAction("Task", "UpdateNotifications")?.CreatedOn,
             IsActive = true
         },
         new TaskListItemModel
         {
             TaskId = TaskType.UpdateEventsFromKentico.GetHashCode(),
             TaskName = "Update Events From Kentico",
             Description = "Retrieved the event data in Kentico in the beginning of the project CED.",
             TaskUrl = Url.Action("UpdateEventsFromKentico"),
             LastRunTime = LogServices.GetLatestLogByAction("Task", "UpdateEventsFromKentico")?.CreatedOn,
             IsActive = false
         },
         new TaskListItemModel
         {
             TaskId = TaskType.NotifyAboutMissingEditionImages.GetHashCode(),
             TaskName = "Notify About Editions With Missing Images",
             Description = "Notifies about editions with missing images.",
             TaskUrl = Url.Action("NotifyAboutMissingEditionImages"),
             LastRunTime = LogServices.GetLatestLogByAction("Task", "NotifyAboutEditionsWithMissingImages")?.CreatedOn,
             IsActive = true
         }
     }.OrderBy(x => x.TaskName).ToList());
 }