public static CustomList <ContactTypeChild> GetAllContactTypeChild() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <ContactTypeChild> ContactTypeChildCollection = new CustomList <ContactTypeChild>(); IDataReader reader = null; const String sql = "select *from ContactTypeChild"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { ContactTypeChild newContactTypeChild = new ContactTypeChild(); newContactTypeChild.SetData(reader); ContactTypeChildCollection.Add(newContactTypeChild); } ContactTypeChildCollection.InsertSpName = "spInsertContactTypeChild"; ContactTypeChildCollection.UpdateSpName = "spUpdateContactTypeChild"; ContactTypeChildCollection.DeleteSpName = "spDeleteContactTypeChild"; return(ContactTypeChildCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<ContactTypeChild> GetAllContactTypeChild() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<ContactTypeChild> ContactTypeChildCollection = new CustomList<ContactTypeChild>(); IDataReader reader = null; const String sql = "select *from ContactTypeChild"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { ContactTypeChild newContactTypeChild = new ContactTypeChild(); newContactTypeChild.SetData(reader); ContactTypeChildCollection.Add(newContactTypeChild); } ContactTypeChildCollection.InsertSpName = "spInsertContactTypeChild"; ContactTypeChildCollection.UpdateSpName = "spUpdateContactTypeChild"; ContactTypeChildCollection.DeleteSpName = "spDeleteContactTypeChild"; return ContactTypeChildCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }