Beispiel #1
0
        public static TaskPeopleObject TaskPeopleRowToObject(DataRow taskPeople)
        {
            TaskPeopleObject obj = new TaskPeopleObject();

            try
            {
                if (taskPeople != null)
                {
                    obj.TpeopID  = RowFunctions.GetValueFromRowToGuid(taskPeople, TaskPeopleObject.TPEOP_ID, true, DataRowVersion.Current);
                    obj.Employee = EmployeeConvertor.EmployeeRowToObject(taskPeople, EmployeeObject.TABLE);
                    obj.Supplier = SupplierConvertor.SupplierRowToObject(taskPeople);
                    obj.Customer = CustomerConvertor.CustomerRowToObject(taskPeople);
                    obj.Unknown  = UnknownConvertor.UnknownRowToObject(taskPeople);
                    obj.Assignee = RowFunctions.GetValueFromRowToBoolean(taskPeople, TaskPeopleObject.ASSIGNEE, true, DataRowVersion.Current);
                    obj.Reporter = RowFunctions.GetValueFromRowToBoolean(taskPeople, TaskPeopleObject.REPORTER, true, DataRowVersion.Current);
                    obj.Task     = TaskConvertor.TaskRowToObject(taskPeople);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
 public static TaskPeopleObject TaskPeopleRowToObject(DataRow taskPeople)
 {
     TaskPeopleObject obj = new TaskPeopleObject();
     try
     {
         if (taskPeople != null)
         {
             obj.TpeopID = RowFunctions.GetValueFromRowToGuid(taskPeople, TaskPeopleObject.TPEOP_ID, true, DataRowVersion.Current);
             obj.Employee = EmployeeConvertor.EmployeeRowToObject(taskPeople, EmployeeObject.TABLE);
             obj.Supplier = SupplierConvertor.SupplierRowToObject(taskPeople);
             obj.Customer =  CustomerConvertor.CustomerRowToObject(taskPeople);
             obj.Unknown = UnknownConvertor.UnknownRowToObject(taskPeople);
             obj.Assignee = RowFunctions.GetValueFromRowToBoolean(taskPeople, TaskPeopleObject.ASSIGNEE, true, DataRowVersion.Current);
             obj.Reporter = RowFunctions.GetValueFromRowToBoolean(taskPeople, TaskPeopleObject.REPORTER, true, DataRowVersion.Current);
             obj.Task = TaskConvertor.TaskRowToObject(taskPeople);
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
 public void Remove(TaskPeopleObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(TaskPeopleObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Called by TaskPeopleObject when it changes
 internal void TaskPeopleObjectChanged(TaskPeopleObject taskPeople)
 {
     try
     {
         int index = List.IndexOf(taskPeople);
         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
     {
         TaskPeopleObject taskPeople = new TaskPeopleObject();
         List.Add(taskPeople);
         return(taskPeople);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         TaskPeopleObject taskPeople = (TaskPeopleObject)value;
         taskPeople.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)
                {
                    TaskPeopleObject oldTaskPeople = (TaskPeopleObject)oldValue;
                    TaskPeopleObject newTaskPeople = (TaskPeopleObject)newValue;
                    oldTaskPeople.Parent = null;
                    newTaskPeople.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Beispiel #9
0
 private TaskPeopleObject ProcessUnknown(UnknownObject unknown)
 {
     try
     {
         TaskPeopleObject taskPeople = new TaskPeopleObject();
         taskPeople.Assignee = true;
         taskPeople.Reporter = false;
         taskPeople.Unknown = unknown;
         taskPeople.State = PROF_IT.Common.Enumerations.ObjectState.Created;
         return taskPeople;
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Beispiel #10
0
 public void Save(TaskPeopleObject taskPeople)
 {
     try
     {
         CheckTransaction();
         new TaskPeopleDataService(Transaction).Save(taskPeople);
         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();
     }
 }
 // Called by TaskPeopleObject when it changes
 internal void TaskPeopleObjectChanged(TaskPeopleObject taskPeople)
 {
     try
     {
         int index = List.IndexOf(taskPeople);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(TaskPeopleObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         TaskPeopleObject taskPeople = new TaskPeopleObject();
         List.Add(taskPeople);
         return taskPeople;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(TaskPeopleObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Save(TaskPeopleObject taskPeople)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "TaskPeople_SAVE",
             CreateParameter("@tpeopID", SqlDbType.UniqueIdentifier, taskPeople.TpeopID, ParameterDirection.InputOutput),
             CreateParameter("@taskID", SqlDbType.UniqueIdentifier, taskPeople.Task.TaskID),
             CreateParameter("@empID", SqlDbType.UniqueIdentifier, taskPeople.Employee == null ? Guid.Empty : taskPeople.Employee.EmpID),
             CreateParameter("@supID",SqlDbType.UniqueIdentifier, taskPeople.Supplier == null ? Guid.Empty : taskPeople.Supplier.SupID),
             CreateParameter("@cusID", SqlDbType.UniqueIdentifier, taskPeople.Customer == null ? Guid.Empty : taskPeople.Customer.CusID),
             CreateParameter("@unkID", SqlDbType.UniqueIdentifier, taskPeople.Unknown == null ? Guid.Empty : taskPeople.Unknown.UnkID),
             CreateParameter("@Assignee", SqlDbType.Bit, taskPeople.Assignee),
             CreateParameter("@Reporter", SqlDbType.Bit, taskPeople.Reporter)
             );
         taskPeople.TpeopID = (Guid)cmd.Parameters["@tpeopID"].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(TaskPeopleObject taskPeople)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "TaskPeople_DELETE",
             CreateParameter("@tpeopID", SqlDbType.UniqueIdentifier, taskPeople.TpeopID, 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;
     }
 }