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); } }
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); } }