Пример #1
0
 public static stock_NewCollection Getstock_NewList(stock_NewColumns orderBy, string orderDirection)
 {            
     try
     {
         stock_NewDAO stock_NewDAO = new stock_NewDAO();
         return stock_NewDAO.Getstock_NewList(orderBy, orderDirection);
     }
     catch (ApplicationException)
     {
         throw;
     }
     catch (Exception ex)
     {
         // log this exception
         log4net.Util.LogLog.Error(ex.Message, ex);
         // wrap it and rethrow
         throw new ApplicationException(SR.BusinessGetstock_NewListException, ex);
     }
 }        
Пример #2
0
 public virtual stock_NewCollection Getstock_NewList(stock_NewColumns orderBy, string orderDirection)
 {            
     int totalRecords = 0;
     return Getstock_NewList(orderBy, orderDirection, 0, 0, out totalRecords);
 }
Пример #3
0
 public static stock_NewCollection Getstock_NewList(string StockCode, string customerID, stock_NewColumns orderBy, string orderDirection, int page, int pageSize, out int totalRecords)
 {
     try
     {
         stock_NewDAO stock_NewDAO = new stock_NewDAO();
         return stock_NewDAO.Getstock_NewList(StockCode, customerID, orderBy, orderDirection, page, pageSize, out totalRecords);
     }
     catch (ApplicationException)
     {
         throw;
     }
     catch (Exception ex)
     {
         // log this exception
         log4net.Util.LogLog.Error(ex.Message, ex);
         // wrap it and rethrow
         throw new ApplicationException(SR.BusinessGetstock_NewListException, ex);
     }
 }
Пример #4
0
 public virtual stock_NewCollection Getstock_NewList(stock_NewColumns orderBy, string orderDirection, int page, int pageSize, out int totalRecords)
 {            
     try
     {
         //Database database = DatabaseFactory.CreateDatabase();
         Database database = DatabaseFactory.CreateDatabase("DestinationConnection");
         DbCommand dbCommand = database.GetStoredProcCommand("spstock_NewsGetList");
         
         database.AddInParameter(dbCommand, "@OrderBy", DbType.AnsiString, orderBy.ToString());
         database.AddInParameter(dbCommand, "@OrderDirection", DbType.AnsiString, orderDirection.ToString());
         database.AddInParameter(dbCommand, "@Page", DbType.Int32, page);
         database.AddInParameter(dbCommand, "@PageSize", DbType.Int32, pageSize);
         database.AddOutParameter(dbCommand, "@TotalRecords", DbType.Int32, 4);
         
         stock_NewCollection stock_NewCollection = new stock_NewCollection();
         using (IDataReader reader = database.ExecuteReader(dbCommand))
         {
             while (reader.Read())
             {
                 stock_New stock_New = Createstock_NewFromReader(reader);
                 stock_NewCollection.Add(stock_New);
             }
             reader.Close();
         }
         totalRecords = (int)database.GetParameterValue(dbCommand, "@TotalRecords");
         return stock_NewCollection;
     }
     catch (Exception ex)
     {
         // log this exception
         log4net.Util.LogLog.Error(ex.Message, ex);
         // wrap it and rethrow
         throw new ApplicationException(SR.DataAccessGetstock_NewListException, ex);
     }
 }