public static CustomList <Gen_FY> GetAllGen_FY(String OrgKey) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Gen_FY> Gen_FYCollection = new CustomList <Gen_FY>(); IDataReader reader = null; String sql = string.Format("Select * from Gen_FY Where OrgKey={0}", OrgKey.ToInt()); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Gen_FY newGen_FY = new Gen_FY(); newGen_FY.SetData(reader); Gen_FYCollection.Add(newGen_FY); } Gen_FYCollection.InsertSpName = "spInsertGen_FY"; Gen_FYCollection.UpdateSpName = "spUpdateGen_FY"; Gen_FYCollection.DeleteSpName = "spDeleteGen_FY"; return(Gen_FYCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList<Gen_FY> GetAllGen_FY(String OrgKey) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList<Gen_FY> Gen_FYCollection = new CustomList<Gen_FY>(); IDataReader reader = null; String sql = string.Format("Select * from Gen_FY Where OrgKey={0}", OrgKey.ToInt()); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Gen_FY newGen_FY = new Gen_FY(); newGen_FY.SetData(reader); Gen_FYCollection.Add(newGen_FY); } Gen_FYCollection.InsertSpName = "spInsertGen_FY"; Gen_FYCollection.UpdateSpName = "spUpdateGen_FY"; Gen_FYCollection.DeleteSpName = "spDeleteGen_FY"; return Gen_FYCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }