コード例 #1
0
        private void ScheduleDetail_Load(object sender, EventArgs e)
        {
            if (taskHeader == null)
            {
                return;
            }

            try
            {
                TaskHeaderManager mgr     = new TaskHeaderManager(Constants.ConnectionString);
                List <TaskHeader> headers = mgr.GetData(taskHeader.ScheduleID);
                if (headers.Count == 1)
                {
                    txtTaskName.Text     = headers[0].TaskName;
                    dtScheduleDate.Value = headers[0].ScheduleFrom;
                    //taskHeader.Site = Constants.SiteName.ADIGLOBAL;
                    chkRepeat.Checked    = headers[0].TaskRepeat;
                    numRepeatCount.Value = headers[0].TaskRepeatInterval;
                    cmbRepeatType.Text   = headers[0].TaskRepeatUnit;
                    chkEnabled.Checked   = headers[0].Enabled;
                    txtDescription.Text  = headers[0].TaskDescription.Trim();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void TaskheaderUpdate(Int64 TaskHeaderID)
        {
            TaskHeaderManager headerManager = new TaskHeaderManager(Constants.ConnectionString);
            List <TaskHeader> taskHeaders   = headerManager.GetData(TaskHeaderID);

            if (taskHeaders.Count == 1)
            {
                taskHeaders[0].LastRun = taskHeaders[0].NextRun;
                headerManager.Save(taskHeaders[0]);
                headerManager.GenerateScheduleNextRun(TaskHeaderID);
            }
        }
コード例 #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (taskHeader == null)
            {
                taskHeader = new TaskHeader();
            }

            taskHeader.TaskName           = txtTaskName.Text.Trim();
            taskHeader.ScheduleFrom       = dtScheduleDate.Value;
            taskHeader.Site               = Constants.SiteName.ADIGLOBAL;
            taskHeader.TaskRepeat         = chkRepeat.Checked;
            taskHeader.TaskRepeatInterval = Convert.ToInt32(numRepeatCount.Value);
            taskHeader.TaskRepeatUnit     = cmbRepeatType.Text;
            taskHeader.Enabled            = chkEnabled.Checked;
            taskHeader.TaskDescription    = txtDescription.Text.Trim();

            try
            {
                TaskHeaderManager mgr = new TaskHeaderManager(Constants.ConnectionString);
                var x = mgr.Save(taskHeader);
            }
            catch (Exception ex) { }
        }
コード例 #4
0
 public TasksScheduler()
 {
     detailManager = new TaskDetailManager(Constants.ConnectionString);
     thManager     = new TaskHeaderManager(Constants.ConnectionString);
 }