public void Remove(TaskScheduleObject value) { try { List.Remove(value); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public int Add(TaskScheduleObject value) { try { return(List.Add(value)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// Called by TaskScheduleObject when it changes internal void TaskScheduleObjectChanged(TaskScheduleObject taskSchedule) { try { int index = List.IndexOf(taskSchedule); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// Methods. object IBindingList.AddNew() { try { TaskScheduleObject taskSchedule = new TaskScheduleObject(); List.Add(taskSchedule); return(taskSchedule); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
protected override void OnRemoveComplete(int index, object value) { try { TaskScheduleObject taskSchedule = (TaskScheduleObject)value; taskSchedule.Parent = this; OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
protected override void OnSetComplete(int index, object oldValue, object newValue) { try { if (oldValue != newValue) { TaskScheduleObject oldTaskSchedule = (TaskScheduleObject)oldValue; TaskScheduleObject newTaskSchedule = (TaskScheduleObject)newValue; oldTaskSchedule.Parent = null; newTaskSchedule.Parent = this; OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index)); } } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public void Remove(TaskScheduleObject taskSchedule) { try { CheckTransaction(); new TaskScheduleDataService(Transaction).Remove(taskSchedule); new Schedule(Transaction).Remove(taskSchedule.Schedule); 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(); } }
public static TaskScheduleObject TaskScheduleRowToObject(DataRow taskSchedule) { TaskScheduleObject obj = new TaskScheduleObject(); try { if (taskSchedule != null) { obj.TschedID = RowFunctions.GetValueFromRowToGuid(taskSchedule, TaskScheduleObject.TSCHED_ID, true, DataRowVersion.Current); obj.Schedule = ScheduleConvertor.ScheduleRowToObject(taskSchedule); obj.Task = TaskConvertor.TaskRowToObject(taskSchedule); return obj; } obj = null; } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } return obj; }
public static TaskScheduleObject TaskScheduleRowToObject(DataRow taskSchedule) { TaskScheduleObject obj = new TaskScheduleObject(); try { if (taskSchedule != null) { obj.TschedID = RowFunctions.GetValueFromRowToGuid(taskSchedule, TaskScheduleObject.TSCHED_ID, true, DataRowVersion.Current); obj.Schedule = ScheduleConvertor.ScheduleRowToObject(taskSchedule); obj.Task = TaskConvertor.TaskRowToObject(taskSchedule); return(obj); } obj = null; } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } return(obj); }
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 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; } }
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; } }