Esempio n. 1
0
        public static UnknownObjectCollection DataTableToCollection(DataTable unknowns)
        {
            UnknownObjectCollection objectsTotal;
            UnknownObjectCollection objects = new UnknownObjectCollection();

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = unknowns.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(UnknownRowToObject(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);
        }
Esempio n. 2
0
 public static UnknownObjectCollection DataTableToCollection(DataTable unknowns)
 {
     UnknownObjectCollection objectsTotal;
     UnknownObjectCollection objects = new UnknownObjectCollection();
     try
     {
         IEnumerator enumerator = null;
         try
         {
             enumerator = unknowns.Rows.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 DataRow current = (DataRow)enumerator.Current;
                 objects.Add(UnknownRowToObject(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;
 }
Esempio n. 3
0
 public UnknownObjectCollection GetAll()
 {
     UnknownObjectCollection unknowns = new UnknownObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendOrderBy(UnknownObject.EMAIL, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST);
         unknowns = UnknownConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return unknowns;
 }