Пример #1
0
        public BackgroundTask()
        {
            StartDate = DateTime.Now;
            Severity = 0;
            IndicatorCurrent = 0;
            IndicatorMaximum = 0;
            Status = BackgroundTaskStatus.Run;

            Completed = false;
            NotifyOnComplete = false;
        }
Пример #2
0
        public static void UpdateBackgroundTask(Guid guid, int taskId, int scheduleId, int packageId, string taskName, int itemId,
            string itemName, DateTime finishDate, int indicatorCurrent, int indicatorMaximum, int maximumExecutionTime,
            string source, int severity, bool completed, bool notifyOnComplete, BackgroundTaskStatus status)
        {
            SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure,
                                      ObjectQualifier + "UpdateBackgroundTask",
                                      new SqlParameter("@Guid", guid),
                                      new SqlParameter("@taskId", taskId),
                                      new SqlParameter("@scheduleId", scheduleId),
                                      new SqlParameter("@packageId", packageId),
                                      new SqlParameter("@taskName", taskName),
                                      new SqlParameter("@itemId", itemId),
                                      new SqlParameter("@itemName", itemName),
                                      new SqlParameter("@finishDate",
                                                       finishDate == DateTime.MinValue
                                                           ? DBNull.Value
                                                           : (object)finishDate),
                                      new SqlParameter("@indicatorCurrent", indicatorCurrent),
                                      new SqlParameter("@indicatorMaximum", indicatorMaximum),
                                      new SqlParameter("@maximumExecutionTime", maximumExecutionTime),
                                      new SqlParameter("@source", source),
                                      new SqlParameter("@severity", severity),
                                      new SqlParameter("@completed", completed),
                                      new SqlParameter("@notifyOnComplete", notifyOnComplete),
                                      new SqlParameter("@status", (int)status));

        }
Пример #3
0
 public static IDataReader GetProcessBackgroundTasks(BackgroundTaskStatus status)
 {
         return SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure,
                                        ObjectQualifier + "GetProcessBackgroundTasks",
                                        new SqlParameter("@status", (int)status));
 }
Пример #4
0
        public static int AddBackgroundTask(Guid guid, string taskId, int scheduleId, int packageId, int userId,
            int effectiveUserId, string taskName, int itemId, string itemName, DateTime startDate,
            int indicatorCurrent, int indicatorMaximum, int maximumExecutionTime, string source,
            int severity, bool completed, bool notifyOnComplete, BackgroundTaskStatus status)
        {
            SqlParameter prmId = new SqlParameter("@BackgroundTaskID", SqlDbType.Int);
            prmId.Direction = ParameterDirection.Output;

            SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure,
                                      ObjectQualifier + "AddBackgroundTask",
                                      prmId,
                                      new SqlParameter("@guid", guid),
                                      new SqlParameter("@taskId", taskId),
                                      new SqlParameter("@scheduleId", scheduleId),
                                      new SqlParameter("@packageId", packageId),
                                      new SqlParameter("@userId", userId),
                                      new SqlParameter("@effectiveUserId", effectiveUserId),
                                      new SqlParameter("@taskName", taskName),
                                      new SqlParameter("@itemId", itemId),
                                      new SqlParameter("@itemName", itemName),
                                      new SqlParameter("@startDate", startDate),
                                      new SqlParameter("@indicatorCurrent", indicatorCurrent),
                                      new SqlParameter("@indicatorMaximum", indicatorMaximum),
                                      new SqlParameter("@maximumExecutionTime", maximumExecutionTime),
                                      new SqlParameter("@source", source),
                                      new SqlParameter("@severity", severity),
                                      new SqlParameter("@completed", completed),
                                      new SqlParameter("@notifyOnComplete", notifyOnComplete),
                                      new SqlParameter("@status", status));

            // read identity
            return Convert.ToInt32(prmId.Value);
        }
Пример #5
0
 public static List<BackgroundTask> GetProcessTasks(BackgroundTaskStatus status)
 {
     return ObjectUtils.CreateListFromDataReader<BackgroundTask>(
         DataProvider.GetProcessBackgroundTasks(status));
 }