예제 #1
0
        private void onJobSetDetails(JobDetail jobDetails)
        {
            Random rnd = new Random();
            int    sec = rnd.Next(10, 50);

            jobDetails.Second = sec;

            newJobs.Add(jobDetails);
            Console.WriteLine(jobDetails.DayOfWeek);

            firedumpdbDataSetTableAdapters.schedulesTableAdapter scheduleAdapter = new firedumpdbDataSetTableAdapters.schedulesTableAdapter();
            scheduleAdapter.Insert((int)jobDetails.Server.id, jobDetails.Name, DateTime.Now, jobDetails.Activate, jobDetails.Hour, jobDetails.Database, "-", jobDetails.Minute, jobDetails.Second, jobDetails.DayOfWeek);
            firedumpdbDataSet.schedulesDataTable scheduleTable = new firedumpdbDataSet.schedulesDataTable();

            scheduleAdapter.FillIdByName(scheduleTable, jobDetails.Name);
            int scheduleId = (int)scheduleTable[0].id;
            int locId      = jobDetails.LocationId;

            firedumpdbDataSetTableAdapters.schedule_save_locationsTableAdapter savelocAdapter = new firedumpdbDataSetTableAdapters.schedule_save_locationsTableAdapter();
            savelocAdapter.Insert(scheduleId, locId);

            firedumpdbDataSetTableAdapters.backup_locationsTableAdapter backAdapter = new firedumpdbDataSetTableAdapters.backup_locationsTableAdapter();
            firedumpdbDataSet.backup_locationsDataTable backuptable = new firedumpdbDataSet.backup_locationsDataTable();
            backuptable = backAdapter.GetDataByID(locId);
            dataGridViewlocs.DataSource = backuptable;

            scheduleAdapter.FillOrderByDate(scheduleTable);
            dataGridView1.DataSource = scheduleTable;
        }
예제 #2
0
 public EmailSchedule()
 {
     InitializeComponent();
     firedumpdbDataSet.schedulesDataTable scheduletable = new firedumpdbDataSet.schedulesDataTable();
     scheduleAdapter.FillOrderByDate(scheduletable);
     dataGridView1.DataSource = scheduletable;
 }
예제 #3
0
        public SchedulerForm()
        {
            InitializeComponent();
            firedumpdbDataSetTableAdapters.schedulesTableAdapter scheduleAdapter = new firedumpdbDataSetTableAdapters.schedulesTableAdapter();
            firedumpdbDataSet.schedulesDataTable scheduleTable = new firedumpdbDataSet.schedulesDataTable();
            scheduleAdapter.FillOrderByDate(scheduleTable);

            dataGridView1.DataSource = scheduleTable;
        }
예제 #4
0
        private void setUpScheduleList()
        {
            scheduleQueue?.Clear();
            scheduleQueue    = new Queue <ScheduleManager>();
            schedules        = new firedumpdbDataSet.schedulesDataTable();
            schedulesAdapter = new firedumpdbDataSetTableAdapters.schedulesTableAdapter();

            //FillByDateOrder
            schedulesAdapter.FillOrderByDate(schedules);

            scheduleRowList = new List <firedumpdbDataSet.schedulesRow>();
            //copy schedules to List<>scheduleRowList
            for (int i = 0; i < schedules.Count; i++)
            {
                scheduleRowList.Add(schedules[i]);
            }
        }
예제 #5
0
        private bool isTimeValid(int day, int hour, int minute)
        {
            firedumpdbDataSetTableAdapters.schedulesTableAdapter scheduleAdapter = new firedumpdbDataSetTableAdapters.schedulesTableAdapter();
            firedumpdbDataSet.schedulesDataTable scheduletable = new firedumpdbDataSet.schedulesDataTable();
            scheduleAdapter.FillOrderByDate(scheduletable);
            if (scheduletable.Count > 0)
            {
                foreach (firedumpdbDataSet.schedulesRow row in scheduletable)
                {
                    if (isScheduleOverLap(row, day, hour, minute))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }