public void Save(TaskScheduleObject taskSchedule) { try { CheckTransaction(); new Schedule(Transaction).Save(taskSchedule.Schedule); new TaskScheduleDataService(Transaction).Save(taskSchedule); if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }
private void DispatchTask() { if (TaskIndicator != null && !TaskIndicator.CanContinue()) { return; } lock (TaskQueue) { foreach (var handler in TaskHandlers) { if (TaskQueue.Count == 0) { break; } if (handler.Status == TaskHandlerStatus.Free) { var task = TaskQueue.Dequeue(); handler.SetBusy(); var obj = new TaskScheduleObject() { Task = task, TaskHandler = handler }; ThreadPool.QueueUserWorkItem(ThreadHandle, obj); } } } }
public void Save(TaskScheduleObject taskSchedule) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "TaskSchedule_SAVE", CreateParameter("@tschedID", SqlDbType.UniqueIdentifier, taskSchedule.TschedID, ParameterDirection.InputOutput), CreateParameter("@taskID", SqlDbType.UniqueIdentifier, taskSchedule.Task.TaskID), CreateParameter("@schedID", SqlDbType.UniqueIdentifier, taskSchedule.Schedule.SchedID) ); taskSchedule.TschedID = (Guid)cmd.Parameters["@tschedID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
private void gdvSubscription_DoubleClick(object sender, EventArgs e) { try { GridView view = (GridView)sender; TaskScheduleObject taskSchedule = (TaskScheduleObject)view.GetRow(view.FocusedRowHandle); TIS.Client.Schedule.Schedule schedule = new TIS.Client.Schedule.Schedule(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, taskSchedule); if (schedule.ShowDialog() == System.Windows.Forms.DialogResult.OK) { taskSchedule.State = PROF_IT.Common.Enumerations.ObjectState.Modified; } } catch (System.Exception excepion1) { System.Exception thisException = excepion1; Management.ShowException(thisException); } }
private void btnAddSubscription_Click(object sender, EventArgs e) { try { Schedule.Schedule schedule = new Schedule.Schedule(PROF_IT.Common.Enumerations.TypeForm.NewForm); if (schedule.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TaskScheduleObject taskSchedule = new TaskScheduleObject(); taskSchedule.Schedule = schedule.ScheduleMember; taskSchedule.Task = TaskMember; taskSchedule.State = PROF_IT.Common.Enumerations.ObjectState.Created; TaskMember.Subscriptions.Add(taskSchedule); gdcSubscription.DataSource = TaskMember.Subscriptions.GetActive(); } } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
public Schedule(PROF_IT.Common.Enumerations.TypeForm typeForm, TaskScheduleObject taskSchedule) { try { InitializeComponent(); _scheduleOriginal = taskSchedule.Schedule.Clone(); _schedule = taskSchedule.Schedule; _typeForm = typeForm; if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm) { throw new NotImplementedException(); } else { InitializePropertyForm(); } } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public bool Remove(TaskScheduleObject taskSchedule) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "TaskSchedule_DELETE", CreateParameter("@tschedID", SqlDbType.UniqueIdentifier, taskSchedule.TschedID, ParameterDirection.Input) ); return true; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }