/// <summary> /// Persists a new instance of TaskQueue. Returns true on success. /// </summary> /// <returns></returns> private bool Create() { int rowsAffected = DBTaskQueue.Create( this.newGuid, this.siteGuid, this.queuedBy, this.taskName, this.notifyOnCompletion, this.notificationToEmail, this.notificationFromEmail, this.notificationSubject, this.taskCompleteMessage, this.canStop, this.canResume, this.updateFrequency, this.queuedUTC, this.completeRatio, this.status, this.serializedTaskObject, this.serializedTaskType); this.guid = newGuid; return(rowsAffected > 0); }
/// <summary> /// Gets an instance of TaskQueue. /// </summary> /// <param name="guid"> guid </param> private void GetTaskQueue(Guid guid) { using (IDataReader reader = DBTaskQueue.GetOne(guid)) { PopulateFromReader(reader); } }
public static bool DeleteByType(string taskType) { if (taskType.Length > 255) { taskType = taskType.Substring(255); } return(DBTaskQueue.DeleteByType(taskType)); }
public static bool UnfinishedTaskExists(string taskType) { if (taskType.Length > 255) { taskType = taskType.Substring(255); } return(DBTaskQueue.GetCountUnfinishedByType(taskType) > 0); }
/// <summary> /// Gets an IList with page of instances of TaskQueue. /// </summary> public static List <TaskQueue> GetPageUnfinished( int pageNumber, int pageSize, out int totalPages) { totalPages = 1; IDataReader reader = DBTaskQueue.GetPageUnfinished(pageNumber, pageSize, out totalPages); return(LoadListFromReader(reader)); }
/// <summary> /// Gets an IList with page of site specific instances of TaskQueue. /// </summary> public static List <TaskQueue> GetPageBySite( Guid siteGuid, int pageNumber, int pageSize, out int totalPages) { totalPages = 1; IDataReader reader = DBTaskQueue.GetPageBySite(siteGuid, pageNumber, pageSize, out totalPages); return(LoadListFromReader(reader)); }
/// <summary> /// Updates this instance of TaskQueue. Returns true on success. /// </summary> /// <returns>bool</returns> private bool Update() { if (startUTC == DateTime.MinValue) { startUTC = DateTime.UtcNow; } if (lastStatusUpdateUTC == DateTime.MinValue) { lastStatusUpdateUTC = DateTime.UtcNow; } return(DBTaskQueue.Update( this.guid, this.startUTC, this.completeUTC, this.lastStatusUpdateUTC, this.completeRatio, this.status)); }
/// <summary> /// Gets an IList with all site specific instances of TaskQueue that have not finished running yet. /// </summary> public static List <TaskQueue> GetUnfinished(Guid siteGuid) { IDataReader reader = DBTaskQueue.GetUnfinished(siteGuid); return(LoadListFromReader(reader)); }
/// <summary> /// Gets an IList with all instances of TaskQueue that have completed but not been notified. /// </summary> public static List <TaskQueue> GetTasksForNotification() { IDataReader reader = DBTaskQueue.GetTasksForNotification(); return(LoadListFromReader(reader)); }
/// <summary> /// Gets an IList with all instances of TaskQueue that have not been started yet. /// </summary> public static List <TaskQueue> GetTasksNotStarted() { IDataReader reader = DBTaskQueue.GetTasksNotStarted(); return(LoadListFromReader(reader)); }
/// <summary> /// Deletes all completed tasks /// </summary> public static void DeleteCompleted() { DBTaskQueue.DeleteCompleted(); }
/// <summary> /// Deletes an instance of TaskQueue. Returns true on success. /// </summary> /// <param name="guid"> guid </param> /// <returns>bool</returns> public static bool Delete(Guid guid) { return(DBTaskQueue.Delete(guid)); }
public bool UpdateNotification() { return(DBTaskQueue.UpdateNotification(this.guid, DateTime.UtcNow)); }