public static MaintenanceVehicleObjectCollection DataTableToCollection(DataTable MaintenanceVehicles)
 {
     MaintenanceVehicleObjectCollection objectsTotal;
     MaintenanceVehicleObjectCollection objects = new MaintenanceVehicleObjectCollection();
     try
     {
         IEnumerator enumerator = null;
         try
         {
             enumerator = MaintenanceVehicles.Rows.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 DataRow current = (DataRow)enumerator.Current;
                 objects.Add(MaintenanceVehicleRowToObject(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;
 }
Beispiel #2
0
        public static MaintenanceVehicleObjectCollection DataTableToCollection(DataTable MaintenanceVehicles)
        {
            MaintenanceVehicleObjectCollection objectsTotal;
            MaintenanceVehicleObjectCollection objects = new MaintenanceVehicleObjectCollection();

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = MaintenanceVehicles.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(MaintenanceVehicleRowToObject(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);
        }