Пример #1
0
        public static UserSecurityObjectCollection DataTableToCollection(DataTable users)
        {
            UserSecurityObjectCollection objectsTotal;
            UserSecurityObjectCollection objects = new UserSecurityObjectCollection();

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = users.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(UserSecurityRowToObject(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 UserSecurityObjectCollection DataTableToCollection(DataTable users)
 {
     UserSecurityObjectCollection objectsTotal;
     UserSecurityObjectCollection objects = new UserSecurityObjectCollection();
     try
     {
         IEnumerator enumerator = null;
         try
         {
             enumerator = users.Rows.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 DataRow current = (DataRow)enumerator.Current;
                 objects.Add(UserSecurityRowToObject(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;
 }