Пример #1
0
        public static void UpdateSchedule(Schedule objSchedule, List <string> WeekDays, List <string> Months, string Dates)
        {
            DateTime currentDate      = DateTime.Now;
            DateTime tmpNextStartDate = new DateTime(currentDate.Year, currentDate.Month, currentDate.Day, objSchedule.StartHour, objSchedule.StartMin, 0);

            try
            {
                Scheduler.RemoveFromScheduleQueue(objSchedule);
                SchedulerDataProvider.ScheduleRepeatOptionDelete(objSchedule.ScheduleID);
                if (WeekDays.Count > 0)
                {
                    AddNewScheduleWeeks(objSchedule.ScheduleID, WeekDays);
                }
                if (Months.Count > 0)
                {
                    AddNewScheduleMonths(objSchedule.ScheduleID, Months);
                }
                if (!string.IsNullOrEmpty(Dates) && Dates.Trim().Length > 0)
                {
                    AddNewScheduleDate(objSchedule.ScheduleID, Dates);
                }

                objSchedule.NextStart = UpdateTaskHistoryNextStartDate(objSchedule.ScheduleID);
                SchedulerDataProvider.UpdateSchedule(objSchedule);

                RunScheduleItemNow(objSchedule);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
 public static void AddNewScheduleWeeks(int ScheduleID, List <string> Weeks)
 {
     try
     {
         SchedulerDataProvider.AddNewScheduleWeek(ScheduleID, Weeks);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #3
0
        /// <summary>
        /// Add scheduler exception
        /// </summary>
        /// <param name="LogTypeID">Log type ID.</param>
        /// <param name="Severity">Severity</param>
        /// <param name="Message">Message</param>
        /// <param name="Exception">Exception</param>
        /// <param name="ClientIPAddress">Client IP address.</param>
        /// <param name="PageURL">Page URL.</param>
        /// <param name="IsActive">True if active.</param>
        /// <param name="PortalID">PortalID</param>
        /// <param name="AddedBy">User name.</param>

        public static void AddSchedulerException(int LogTypeID, int Severity, string Message, string Exception, string ClientIPAddress, string PageURL, bool IsActive,
                                                 int PortalID, string AddedBy)
        {
            try
            {
                SchedulerDataProvider.AddSchedulerException(LogTypeID, Severity, Message, Exception, ClientIPAddress, PageURL, IsActive, PortalID, AddedBy);
            }
            catch (Exception)
            {
            }
        }
Пример #4
0
 public static List <SchedularView> GetAllActiveTasks(int offset, int limit)
 {
     try
     {
         return(SchedulerDataProvider.GetAllActiveTasks(offset, limit));
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #5
0
 public static List <ScheduleDate> GetScheduleDates(int ScheduleID)
 {
     try
     {
         return(SchedulerDataProvider.GetScheduleDates(ScheduleID));
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #6
0
 public static void DeleteTaskHistory(int ScheduleHistoryID)
 {
     try
     {
         SchedulerDataProvider.DeleteTaskHistory(ScheduleHistoryID);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #7
0
 public static void UpdateScheduleEnableStatus(int scheduleId, bool isEnable)
 {
     try
     {
         SchedulerDataProvider.UpdateScheduleStatus(scheduleId, isEnable);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #8
0
 public static List <Schedule> GetTasks()
 {
     try
     {
         return(SchedulerDataProvider.GetTasks());
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #9
0
 public static void AddNewScheduleDate(int ScheduleID, string Dates)
 {
     try
     {
         SchedulerDataProvider.AddNewScheduleDate(ScheduleID, Dates);
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "AddNewScheduleDate");
         // throw;
     }
 }
Пример #10
0
 public static void AddNewScheduleMonths(int ScheduleID, List <string> Months)
 {
     try
     {
         SchedulerDataProvider.AddNewScheduleMonth(ScheduleID, Months);
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "AddNewScheduleMonths");
         // throw;
     }
 }
Пример #11
0
 public static void AddNewScheduleDays(int ScheduleID, List <string> WeekDays)
 {
     try
     {
         SchedulerDataProvider.AddNewScheduleDay(ScheduleID, WeekDays);
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "AddNewScheduleDays");
         // throw;
     }
 }
Пример #12
0
 public static Schedule GetSchedule(int ScheduleID)
 {
     try
     {
         return(SchedulerDataProvider.GetSchedule(ScheduleID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "GetSchedule");
     }
     return(null);
 }
Пример #13
0
 public static ScheduleHistory GetScheduleHistory(int ScheduleHistoryID)
 {
     try
     {
         return(SchedulerDataProvider.GetScheduleHistory(ScheduleHistoryID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "GetScheduleHistory");
         return(null);
     }
 }
Пример #14
0
 public static void UpdateTaskHistory(ScheduleHistory scheduleHistory)
 {
     try
     {
         SchedulerDataProvider.UpdateTaskHistory(scheduleHistory);
     }
     catch (Exception e)
     {
         ErrorLogger.log(scheduleHistory, e, "UpdateTaskHistory");
         throw;
     }
 }
Пример #15
0
 public static int GetMaxScheduleHistoryID(int ScheduleID)
 {
     try
     {
         return(SchedulerDataProvider.GetMaxScheduleHistoryID(ScheduleID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "GetMaxScheduleHistoryID");
         // throw;
         return(0);
     }
 }
Пример #16
0
 public static string UpdateTaskHistoryNextStartDate(int ScheduleID)
 {
     try
     {
         return(SchedulerDataProvider.UpdateTaskHistoryNextStartDate(ScheduleID));
     }
     catch (Exception e)
     {
         ErrorLogger.log(e, "UpdateTaskHistoryNextStartDate");
         return(null);
         // throw;
     }
 }
Пример #17
0
        public static int AddTaskHistory(ScheduleHistory scheduleHistory)
        {
            int Id = 0;

            try
            {
                Id = SchedulerDataProvider.AddTaskHistory(scheduleHistory);
            }
            catch (Exception)
            {
                throw;
            }
            return(Id);
        }
Пример #18
0
 public static void DeleteTask(int ScheduleID, string physicalPath)
 {
     try
     {
         SchedulerDataProvider.DeleteTask(ScheduleID);
         Scheduler.RemoveFromScheduleQueueByID(ScheduleID);
         //Scheduler.ReloadSchedule();
         DeleteFile(physicalPath);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #19
0
        public static List <ScheduleHistoryView> GetAllScheduleHistory(int ScheduleID, int offset, int limit)
        {
            List <ScheduleHistoryView> scheduleHistoryList = null;

            try
            {
                scheduleHistoryList = SchedulerDataProvider.GetAllScheduleHistory(ScheduleID, offset, limit);
            }
            catch (Exception)
            {
                throw;
            }

            return(scheduleHistoryList);
        }
Пример #20
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);
        }
Пример #21
0
 public static int GetNextScheduleWeekDay(int ScheduleID, int weekday)
 {
     return(SchedulerDataProvider.GetNextScheduleWeekDay(ScheduleID, weekday));
 }
Пример #22
0
 public static DateTime?GetNextScheduleDate(int ScheduleID, string CurrentStartDate)
 {
     return(SchedulerDataProvider.GetNextScheduleDate(ScheduleID, CurrentStartDate));
 }
Пример #23
0
 public static int ScheduleDateGetNextMonth(int ScheduleID, int month)
 {
     return(SchedulerDataProvider.ScheduleDateGetNextMonth(ScheduleID, month));
 }