Пример #1
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);
        }
Пример #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);
     }
 }
 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);
     }
 }