Ejemplo n.º 1
0
 public static void UpdateTaskHistory(ScheduleHistory scheduleHistory)
 {
     try
     {
         SchedulerDataProvider.UpdateTaskHistory(scheduleHistory);
     }
     catch (Exception e)
     {
         ErrorLogger.log(scheduleHistory, e, "UpdateTaskHistory");
         throw;
     }
 }
Ejemplo n.º 2
0
 public static void AddNewScheduleDate(int ScheduleID, string Dates)
 {
     try
     {
         SchedulerDataProvider.AddNewScheduleDate(ScheduleID, Dates);
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "AddNewScheduleDate");
         // throw;
     }
 }
Ejemplo n.º 3
0
 public static Schedule GetSchedule(int ScheduleID)
 {
     try
     {
         return(SchedulerDataProvider.GetSchedule(ScheduleID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "GetSchedule");
     }
     return(null);
 }
Ejemplo n.º 4
0
 public static void AddNewScheduleMonths(int ScheduleID, List <string> Months)
 {
     try
     {
         SchedulerDataProvider.AddNewScheduleMonth(ScheduleID, Months);
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "AddNewScheduleMonths");
         // throw;
     }
 }
Ejemplo n.º 5
0
 public static void AddNewScheduleDays(int ScheduleID, List <string> WeekDays)
 {
     try
     {
         SchedulerDataProvider.AddNewScheduleDay(ScheduleID, WeekDays);
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "AddNewScheduleDays");
         // throw;
     }
 }
Ejemplo n.º 6
0
 public static ScheduleHistory GetScheduleHistory(int ScheduleHistoryID)
 {
     try
     {
         return(SchedulerDataProvider.GetScheduleHistory(ScheduleHistoryID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "GetScheduleHistory");
         return(null);
     }
 }
Ejemplo n.º 7
0
 public static string UpdateTaskHistoryNextStartDate(int ScheduleID)
 {
     try
     {
         return(SchedulerDataProvider.UpdateTaskHistoryNextStartDate(ScheduleID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "UpdateTaskHistoryNextStartDate");
         return(null);
         // throw;
     }
 }
Ejemplo n.º 8
0
 public static int GetMaxScheduleHistoryID(int ScheduleID)
 {
     try
     {
         return(SchedulerDataProvider.GetMaxScheduleHistoryID(ScheduleID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "GetMaxScheduleHistoryID");
         // throw;
         return(0);
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Add new schedule.
        /// </summary>
        /// <param name="objSchedule"></param>
        /// <returns></returns>
        public static Schedule AddNewSchedule(Schedule objSchedule)
        {
            try
            {
                objSchedule.ScheduleID = SchedulerDataProvider.AddNewSchedule(objSchedule);

                //  RunScheduleItemNow(objSchedule);
            }
            catch (Exception e)
            {
                ErrorLogger.log(objSchedule, e, "AddNewSchedule");
                string fileName = objSchedule.AssemblyFileName;
                string filepath = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "bin\\" + fileName);
                DeleteFile(filepath);
                throw;
            }

            return(objSchedule);
        }
Ejemplo n.º 10
0
        //Add a queue request to Threadpool with a
        //callback to RunPooledThread which calls Run()
        public void AddQueueUserWorkItem(Schedule s)
        {
            numberOfProcessesInQueue += 1;
            numberOfProcesses        += 1;
            var obj = new ScheduleHistory(s);

            try
            {
                //Create a callback to subroutine RunPooledThread
                WaitCallback callback = RunPooledThread;
                //And put in a request to ThreadPool to run the process.
                ThreadPool.QueueUserWorkItem(callback, obj);
                Thread.Sleep(1000);
            }
            catch (Exception exc)
            {
                ErrorLogger.log(s, exc, "AddQueueUserWorkItem");
            }
        }