コード例 #1
0
 public virtual IncomingMessageContentSentCollection GetIncomingMessageContentSentList(IncomingMessageContentSentColumns orderBy, string orderDirection)
 {            
     int totalRecords = 0;
     return GetIncomingMessageContentSentList(orderBy, orderDirection, 0, 0, out totalRecords);
 }
コード例 #2
0
 public static IncomingMessageContentSentCollection GetIncomingMessageContentSentList(IncomingMessageContentSentColumns orderBy, string orderDirection)
 {            
     try
     {
         IncomingMessageContentSentDAO incomingMessageContentSentDAO = new IncomingMessageContentSentDAO();
         return incomingMessageContentSentDAO.GetIncomingMessageContentSentList(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.BusinessGetIncomingMessageContentSentListException, ex);
     }
 }        
コード例 #3
0
 public virtual IncomingMessageContentSentCollection GetIncomingMessageContentSentList(IncomingMessageContentSentColumns orderBy, string orderDirection, int page, int pageSize, out int totalRecords)
 {            
     try
     {
         Database database = DatabaseFactory.CreateDatabase("CustommerServiceConnection");
         DbCommand dbCommand = database.GetStoredProcCommand("spIncomingMessageContentSentGetList");
         
         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);
         
         IncomingMessageContentSentCollection incomingMessageContentSentCollection = new IncomingMessageContentSentCollection();
         using (IDataReader reader = database.ExecuteReader(dbCommand))
         {
             while (reader.Read())
             {
                 IncomingMessageContentSent incomingMessageContentSent = CreateIncomingMessageContentSentFromReader(reader);
                 incomingMessageContentSentCollection.Add(incomingMessageContentSent);
             }
             reader.Close();
         }
         totalRecords = (int)database.GetParameterValue(dbCommand, "@TotalRecords");
         return incomingMessageContentSentCollection;
     }
     catch (Exception ex)
     {
         // log this exception
         log4net.Util.LogLog.Error(ex.Message, ex);
         // wrap it and rethrow
         throw new ApplicationException(SR.DataAccessGetIncomingMessageContentSentListException, ex);
     }
 }