Exemplo n.º 1
0
        public static CustomList <StockView> StockView1()
        {
            ConnectionManager      conManager          = new ConnectionManager(ConnectionName.HR);
            CustomList <StockView> StockViewCollection = new CustomList <StockView>();
            IDataReader            reader = null;
            String sql = "EXEC spGetStockView";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    StockView newStockView = new StockView();
                    newStockView.SetData(reader);
                    StockViewCollection.Add(newStockView);
                }
                return(StockViewCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
 public static CustomList<StockView> StockView1()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<StockView> StockViewCollection = new CustomList<StockView>();
     IDataReader reader = null;
     String sql = "EXEC spGetStockView";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             StockView newStockView = new StockView();
             newStockView.SetData(reader);
             StockViewCollection.Add(newStockView);
         }
         return StockViewCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }