public static CustomList <UnitSetup> GetAllUnitSetup() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <UnitSetup> UnitSetupCollection = new CustomList <UnitSetup>(); IDataReader reader = null; const String sql = "select *from UnitSetup"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { UnitSetup newUnitSetup = new UnitSetup(); newUnitSetup.SetData(reader); UnitSetupCollection.Add(newUnitSetup); } UnitSetupCollection.InsertSpName = "spInsertUnitSetup"; UnitSetupCollection.UpdateSpName = "spUpdateUnitSetup"; UnitSetupCollection.DeleteSpName = "spDeleteUnitSetup"; return(UnitSetupCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<UnitSetup> GetAllUnitSetup() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<UnitSetup> UnitSetupCollection = new CustomList<UnitSetup>(); IDataReader reader = null; const String sql = "select *from UnitSetup"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { UnitSetup newUnitSetup = new UnitSetup(); newUnitSetup.SetData(reader); UnitSetupCollection.Add(newUnitSetup); } UnitSetupCollection.InsertSpName = "spInsertUnitSetup"; UnitSetupCollection.UpdateSpName = "spUpdateUnitSetup"; UnitSetupCollection.DeleteSpName = "spDeleteUnitSetup"; return UnitSetupCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }