예제 #1
0
        public static CustomList <Gen_Country> GetAllGen_Country()
        {
            ConnectionManager        conManager            = new ConnectionManager(ConnectionName.HR);
            CustomList <Gen_Country> Gen_CountryCollection = new CustomList <Gen_Country>();
            IDataReader  reader = null;
            const String sql    = "select * from Gen_Country";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Gen_Country newGen_Country = new Gen_Country();
                    newGen_Country.SetData(reader);
                    Gen_CountryCollection.Add(newGen_Country);
                }
                Gen_CountryCollection.InsertSpName = "spInsertGen_Country";
                Gen_CountryCollection.UpdateSpName = "spUpdateGen_Country";
                Gen_CountryCollection.DeleteSpName = "spDeleteGen_Country";
                return(Gen_CountryCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
예제 #2
0
 public static CustomList<Gen_Country> GetAllGen_Country()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<Gen_Country> Gen_CountryCollection = new CustomList<Gen_Country>();
     IDataReader reader = null;
     const String sql = "select * from Gen_Country";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Gen_Country newGen_Country = new Gen_Country();
             newGen_Country.SetData(reader);
             Gen_CountryCollection.Add(newGen_Country);
         }
         Gen_CountryCollection.InsertSpName = "spInsertGen_Country";
         Gen_CountryCollection.UpdateSpName = "spUpdateGen_Country";
         Gen_CountryCollection.DeleteSpName = "spDeleteGen_Country";
         return Gen_CountryCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }