コード例 #1
0
        public static ScheduleObjectCollection DataTableToCollection(DataTable schedules)
        {
            ScheduleObjectCollection objectsTotal;
            ScheduleObjectCollection objects = new ScheduleObjectCollection();

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = schedules.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(ScheduleRowToObject(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 ScheduleObjectCollection DataTableToCollection(DataTable schedules)
 {
     ScheduleObjectCollection objectsTotal;
     ScheduleObjectCollection objects = new ScheduleObjectCollection();
     try
     {
         IEnumerator enumerator = null;
         try
         {
             enumerator = schedules.Rows.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 DataRow current = (DataRow)enumerator.Current;
                 objects.Add(ScheduleRowToObject(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 ScheduleObjectCollection GetAll()
 {
     ScheduleObjectCollection parameters = new ScheduleObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false,0));
         parameters = ScheduleConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return parameters;
 }