public static CustomList <CmnStatusList> GetAllCmnStatusList() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <CmnStatusList> CmnStatusListCollection = new CustomList <CmnStatusList>(); IDataReader reader = null; const String sql = "select *from CmnStatusList"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { CmnStatusList newCmnStatusList = new CmnStatusList(); newCmnStatusList.SetData(reader); CmnStatusListCollection.Add(newCmnStatusList); } return(CmnStatusListCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<CmnStatusList> GetAllCmnStatusList() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<CmnStatusList> CmnStatusListCollection = new CustomList<CmnStatusList>(); IDataReader reader = null; const String sql = "select *from CmnStatusList"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { CmnStatusList newCmnStatusList = new CmnStatusList(); newCmnStatusList.SetData(reader); CmnStatusListCollection.Add(newCmnStatusList); } return CmnStatusListCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }