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