public static CustomList <Gen_District> GetAllGen_District() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Gen_District> Gen_DistrictCollection = new CustomList <Gen_District>(); IDataReader reader = null; const String sql = "select * from Gen_District"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Gen_District newGen_District = new Gen_District(); newGen_District.SetData(reader); Gen_DistrictCollection.Add(newGen_District); } Gen_DistrictCollection.InsertSpName = "spInsertGen_District"; Gen_DistrictCollection.UpdateSpName = "spUpdateGen_District"; Gen_DistrictCollection.DeleteSpName = "spDeleteGen_District"; return(Gen_DistrictCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<Gen_District> GetAllGen_District() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Gen_District> Gen_DistrictCollection = new CustomList<Gen_District>(); IDataReader reader = null; const String sql = "select * from Gen_District"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Gen_District newGen_District = new Gen_District(); newGen_District.SetData(reader); Gen_DistrictCollection.Add(newGen_District); } Gen_DistrictCollection.InsertSpName = "spInsertGen_District"; Gen_DistrictCollection.UpdateSpName = "spUpdateGen_District"; Gen_DistrictCollection.DeleteSpName = "spDeleteGen_District"; return Gen_DistrictCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }