Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
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) { }
        }
Ejemplo n.º 3
0
 public TasksScheduler()
 {
     detailManager = new TaskDetailManager(Constants.ConnectionString);
     thManager = new TaskHeaderManager(Constants.ConnectionString);
 }
Ejemplo n.º 4
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);
     }
 }
Ejemplo n.º 5
0
 private void LoadScheduleHeaders(Boolean DeleteAndReload = false)
 {
     if (DeleteAndReload)
     {
         for (int i = 1; i < listViewScheduleTasks.Items.Count; i++)
             listViewScheduleTasks.Items[i].Remove();
     }
     List<TaskHeader> headers = new TaskHeaderManager(Constants.ConnectionString).GetData();
     foreach (TaskHeader h in headers)
     {
         SetTaskScheduleHeader(h);
     }
 }