public static CustomList <Bank_Branch> GetAllBank_Branch() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Bank_Branch> Bank_BranchCollection = new CustomList <Bank_Branch>(); IDataReader reader = null; String sql = "spGetBankBranch"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Bank_Branch newBank_Branch = new Bank_Branch(); newBank_Branch.SetDataBankBranch(reader); Bank_BranchCollection.Add(newBank_Branch); } return(Bank_BranchCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<Bank_Branch> GetAllBank_Branch() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Bank_Branch> Bank_BranchCollection = new CustomList<Bank_Branch>(); IDataReader reader = null; String sql = "spGetBankBranch"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Bank_Branch newBank_Branch = new Bank_Branch(); newBank_Branch.SetDataBankBranch(reader); Bank_BranchCollection.Add(newBank_Branch); } return Bank_BranchCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }