public static TaskPeopleObjectCollection DataTableToCollection(DataTable taskPeoples)
 {
     TaskPeopleObjectCollection objectsTotal;
     TaskPeopleObjectCollection objects = new TaskPeopleObjectCollection();
     try
     {
         IEnumerator enumerator = null;
         try
         {
             enumerator = taskPeoples.Rows.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 DataRow current = (DataRow)enumerator.Current;
                 objects.Add(TaskPeopleRowToObject(current));
             }
         }
         finally
         {
             if (enumerator is IDisposable)
             {
                 (enumerator as IDisposable).Dispose();
             }
         }
         objectsTotal = objects;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return objectsTotal;
 }
Example #2
0
        public static TaskPeopleObjectCollection DataTableToCollection(DataTable taskPeoples)
        {
            TaskPeopleObjectCollection objectsTotal;
            TaskPeopleObjectCollection objects = new TaskPeopleObjectCollection();

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = taskPeoples.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(TaskPeopleRowToObject(current));
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                objectsTotal = objects;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(objectsTotal);
        }
 public TaskPeopleObjectCollection GetActive()
 {
     try
     {
         TaskPeopleObjectCollection taskPeoples = new TaskPeopleObjectCollection();
         foreach (TaskPeopleObject taskPeople in this)
         {
             if (taskPeople.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
             {
                 taskPeoples.Add(taskPeople);
             }
         }
         return(taskPeoples);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Example #4
0
        public void Save(TaskPeopleObjectCollection taskPeoples)
        {
            try
            {
                foreach (TaskPeopleObject taskPeople in taskPeoples)
                {
                    if (taskPeople.State == PROF_IT.Common.Enumerations.ObjectState.Deleted)
                        Remove(taskPeople);
                    if (taskPeople.State == PROF_IT.Common.Enumerations.ObjectState.Modified |
                            taskPeople.State == PROF_IT.Common.Enumerations.ObjectState.Created)
                        Save(taskPeople);
                }

            }
            catch (Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Example #5
0
 public void RemoveAll(TaskPeopleObjectCollection taskPeoples)
 {
     try
     {
         foreach (TaskPeopleObject taskPeople in taskPeoples)
         {
             Remove(taskPeople);
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public TaskPeopleObjectCollection GetActive()
 {
     try
     {
         TaskPeopleObjectCollection taskPeoples = new TaskPeopleObjectCollection();
         foreach (TaskPeopleObject taskPeople in this)
         {
             if (taskPeople.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
                 taskPeoples.Add(taskPeople);
         }
         return taskPeoples;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public TaskPeopleObjectCollection GetReporterByTaskID(Guid taskID)
 {
     TaskPeopleObjectCollection taskPeoples = new TaskPeopleObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(TaskPeopleObject.TASK_ID, taskID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.AppendWhereBoolean(TaskPeopleObject.REPORTER, true, QueryBuilder.ParameterLocation.LAST);
         taskPeoples = TaskPeopleConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return taskPeoples;
 }
 public TaskPeopleObjectCollection GetByEmployee(EmployeeObject employee)
 {
     TaskPeopleObjectCollection taskPeoples = new TaskPeopleObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(TaskPeopleObject.EMP_ID, employee.EmpID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.Append("AND " + TaskPeopleObject.EMP_ID + " is not null ");
         builder.Append("AND " + TaskObject.TASK_ID + " is not null ");
         builder.AppendWhereBoolean(TaskPeopleObject.ASSIGNEE, true, QueryBuilder.ParameterLocation.LAST);
         taskPeoples = TaskPeopleConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return taskPeoples;
 }
 public TaskPeopleObjectCollection GetAll()
 {
     TaskPeopleObjectCollection parameters = new TaskPeopleObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false,0));
         parameters = TaskPeopleConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return parameters;
 }