예제 #1
0
 public void Remove(TaskScheduleObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
예제 #2
0
 public int Add(TaskScheduleObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
예제 #3
0
 // 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);
     }
 }
예제 #4
0
 // 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);
     }
 }
예제 #5
0
 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);
     }
 }
예제 #6
0
        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);
            }
        }
예제 #7
0
 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();
     }
 }
예제 #8
0
 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;
 }
예제 #9
0
        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);
        }
예제 #10
0
 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);
     }
 }
예제 #11
0
 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;
     }
 }
예제 #12
0
 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;
     }
 }