public static CustomList <ItemStructure> GetAllItemStructure(Int32 itemGroupID) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <ItemStructure> ItemStructureCollection = new CustomList <ItemStructure>(); IDataReader reader = null; String sql = "select *from ItemStructure Where GroupItemID=" + itemGroupID; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { ItemStructure newItemStructure = new ItemStructure(); newItemStructure.SetData(reader); ItemStructureCollection.Add(newItemStructure); } return(ItemStructureCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<ItemStructure> GetAllItemStructure(Int32 itemGroupID) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<ItemStructure> ItemStructureCollection = new CustomList<ItemStructure>(); IDataReader reader = null; String sql = "select *from ItemStructure Where GroupItemID=" + itemGroupID; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { ItemStructure newItemStructure = new ItemStructure(); newItemStructure.SetData(reader); ItemStructureCollection.Add(newItemStructure); } return ItemStructureCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }