예제 #1
0
        public static CustomList <Gen_Month> GetAllGen_Month()
        {
            ConnectionManager      conManager          = new ConnectionManager(ConnectionName.HR);
            CustomList <Gen_Month> Gen_MonthCollection = new CustomList <Gen_Month>();
            IDataReader            reader = null;
            const String           sql    = "Select *from Gen_Month";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Gen_Month newGen_Month = new Gen_Month();
                    newGen_Month.SetData(reader);
                    Gen_MonthCollection.Add(newGen_Month);
                }
                Gen_MonthCollection.InsertSpName = "spInsertGen_Month";
                Gen_MonthCollection.UpdateSpName = "spUpdateGen_Month";
                Gen_MonthCollection.DeleteSpName = "spDeleteGen_Month";
                return(Gen_MonthCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
예제 #2
0
 public static CustomList<Gen_Month> GetAllGen_Month()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<Gen_Month> Gen_MonthCollection = new CustomList<Gen_Month>();
     IDataReader reader = null;
     const String sql = "Select *from Gen_Month";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Gen_Month newGen_Month = new Gen_Month();
             newGen_Month.SetData(reader);
             Gen_MonthCollection.Add(newGen_Month);
         }
         Gen_MonthCollection.InsertSpName = "spInsertGen_Month";
         Gen_MonthCollection.UpdateSpName = "spUpdateGen_Month";
         Gen_MonthCollection.DeleteSpName = "spDeleteGen_Month";
         return Gen_MonthCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }