Ejemplo n.º 1
0
        public static MemoObjectCollection DataTableToCollection(DataTable Memos)
        {
            MemoObjectCollection objectsTotal;
            MemoObjectCollection objects = new MemoObjectCollection();

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = Memos.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(MemoRowToObject(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);
        }
Ejemplo n.º 2
0
 public static MemoObjectCollection DataTableToCollection(DataTable Memos)
 {
     MemoObjectCollection objectsTotal;
     MemoObjectCollection objects = new MemoObjectCollection();
     try
     {
         IEnumerator enumerator = null;
         try
         {
             enumerator = Memos.Rows.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 DataRow current = (DataRow)enumerator.Current;
                 objects.Add(MemoRowToObject(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;
 }
Ejemplo n.º 3
0
 public MemoObjectCollection GetAll()
 {
     MemoObjectCollection memos = new MemoObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendOrderBy(MemoObject.DATETIME, QueryBuilder.OrderByType.DESC, QueryBuilder.ParameterLocation.FIRST_LAST);
         memos = MemoConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return memos;
 }
Ejemplo n.º 4
0
 public MemoObjectCollection GetMemosByMaintenanceID(MaterialObject material)
 {
     MemoObjectCollection memos = new MemoObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(MemoObject.MAT_ID, material.MatID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.Append("AND " + MemoObject.MAT_ID + " is not null ");
         memos = MemoConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return memos;
 }
Ejemplo n.º 5
0
 public MemoObjectCollection GetActive()
 {
     try
     {
         MemoObjectCollection memos = new MemoObjectCollection();
         foreach (MemoObject memo in this)
         {
             if (memo.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
             {
                 memos.Add(memo);
             }
         }
         return(memos);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 6
0
 public MemoObjectCollection GetActive()
 {
     try
     {
         MemoObjectCollection memos = new MemoObjectCollection();
         foreach (MemoObject memo in this)
         {
             if (memo.State != PROF_IT.Common.Enumerations.ObjectState.Deleted)
                 memos.Add(memo);
         }
         return memos;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }