public static MaterialTypeObjectCollection DataTableToCollection(DataTable MaterialTypes) { MaterialTypeObjectCollection objectsTotal; MaterialTypeObjectCollection objects = new MaterialTypeObjectCollection(); try { IEnumerator enumerator = null; try { enumerator = MaterialTypes.Rows.GetEnumerator(); while (enumerator.MoveNext()) { DataRow current = (DataRow)enumerator.Current; objects.Add(MaterialTypeRowToObject(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 MaterialTypeObjectCollection GetAll() { MaterialTypeObjectCollection materialTypes = new MaterialTypeObjectCollection(); QueryBuilder builder; try { builder = new QueryBuilder(); builder.Append(this.BaseQuery(false, 0)); builder.AppendOrderBy(MaterialTypeObject.TYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST); materialTypes = MaterialTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]); } catch (System.Exception exception1) { throw new Exception(MethodBase.GetCurrentMethod().Name, exception1); } return materialTypes; }
public MaterialTypeObjectCollection GetAll() { MaterialTypeObjectCollection materialTypes = new MaterialTypeObjectCollection(); QueryBuilder builder; try { builder = new QueryBuilder(); builder.Append(this.BaseQuery(false, 0)); builder.AppendOrderBy(MaterialTypeObject.TYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST); materialTypes = MaterialTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]); } catch (System.Exception exception1) { throw new Exception(MethodBase.GetCurrentMethod().Name, exception1); } return(materialTypes); }
void IEditableObject.EndEdit() { try { if (_inTxn) { _loadedCategory = Category; //Child members _loadedTypes = Types; _loadedRevisions = Revisions; _inTxn = true; } } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public MaterialTypeObjectCollection GetTypesByCategorie(MaterialCategoryObject category) { MaterialTypeObjectCollection materialTypes = new MaterialTypeObjectCollection(); QueryBuilder builder; try { builder = new QueryBuilder(); builder.Append(this.BaseQuery(false, 0)); builder.AppendWhereString(MaterialTypeObject.MATCAT_ID, category.MatcatID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST); builder.Append("AND " + MaterialTypeObject.MATCAT_ID + " is not null "); builder.AppendOrderBy(MaterialTypeObject.TYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST); materialTypes = MaterialTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]); } catch (System.Exception exception1) { throw new Exception(MethodBase.GetCurrentMethod().Name, exception1); } return materialTypes; }
public MaterialTypeObjectCollection GetTypesByCategorie(MaterialCategoryObject category) { MaterialTypeObjectCollection materialTypes = new MaterialTypeObjectCollection(); QueryBuilder builder; try { builder = new QueryBuilder(); builder.Append(this.BaseQuery(false, 0)); builder.AppendWhereString(MaterialTypeObject.MATCAT_ID, category.MatcatID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST); builder.Append("AND " + MaterialTypeObject.MATCAT_ID + " is not null "); builder.AppendOrderBy(MaterialTypeObject.TYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST); materialTypes = MaterialTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]); } catch (System.Exception exception1) { throw new Exception(MethodBase.GetCurrentMethod().Name, exception1); } return(materialTypes); }