예제 #1
0
        public static PopupUserObjectCollection DataTableToCollection(DataTable taskPeoples)
        {
            PopupUserObjectCollection objectsTotal;
            PopupUserObjectCollection objects = new PopupUserObjectCollection();

            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 PopupUserObjectCollection DataTableToCollection(DataTable taskPeoples)
 {
     PopupUserObjectCollection objectsTotal;
     PopupUserObjectCollection objects = new PopupUserObjectCollection();
     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;
 }
예제 #3
0
 public PopupUserObjectCollection GetAll()
 {
     PopupUserObjectCollection popupUsers = new PopupUserObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false,0));
         popupUsers = PopupUserConverter.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return popupUsers;
 }
 public PopupUserObjectCollection GetActive()
 {
     try
     {
         PopupUserObjectCollection popupUsers = new PopupUserObjectCollection();
         foreach (PopupUserObject popupUser in this)
         {
             if (popupUser.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
             {
                 popupUsers.Add(popupUser);
             }
         }
         return(popupUsers);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public PopupUserObjectCollection GetActive()
 {
     try
     {
         PopupUserObjectCollection popupUsers = new PopupUserObjectCollection();
         foreach (PopupUserObject popupUser in this)
         {
             if (popupUser.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
                 popupUsers.Add(popupUser);
         }
         return popupUsers;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
예제 #6
0
 public void Save(PopupUserObjectCollection popupUsers)
 {
     try
     {
         foreach (PopupUserObject popupUser in popupUsers)
         {
             if (popupUser.State == PROF_IT.Common.Enumerations.ObjectState.Deleted)
                 Remove(popupUser);
             if (popupUser.State == PROF_IT.Common.Enumerations.ObjectState.Modified |
                     popupUser.State == PROF_IT.Common.Enumerations.ObjectState.Created)
                 Save(popupUser);
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }