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

            try
            {
                IEnumerator enumerator = null;
                try
                {
                    enumerator = MaterialSubTypes.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        objects.Add(MaterialSubTypeRowToObject(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);
        }
 public MaterialSubTypeObjectCollection GetAll()
 {
     MaterialSubTypeObjectCollection materialSubTypes = new MaterialSubTypeObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendOrderBy(MaterialSubTypeObject.SUBTYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST);
         materialSubTypes = MaterialSubTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return materialSubTypes;
 }
 public MaterialSubTypeObjectCollection GetSubTypeByType(MaterialTypeObject type)
 {
     MaterialSubTypeObjectCollection materialSubTypes = new MaterialSubTypeObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(MaterialSubTypeObject.MATTYP_ID, type.MatTypID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.Append("AND " + MaterialSubTypeObject.MATTYP_ID + " is not null ");
         builder.AppendOrderBy(MaterialSubTypeObject.SUBTYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST);
         materialSubTypes = MaterialSubTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return materialSubTypes;
 }
Esempio n. 5
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedMaterialCategory = MaterialCategory;
             _loadedType = Type;
             //Child members
             _loadedSubTypes = SubTypes;
             _loadedRevisions = Revisions;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }