Exemplo n.º 1
0
        /// <summary>
        /// Gets the event page.
        /// </summary>
        /// <param name="applicationId">The application id.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="rowCount">The row count.</param>
        /// <param name="appLocationFilter">The app location filter.</param>
        /// <param name="eventTypeFilter">The event type filter.</param>
        /// <param name="userId">The user id.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns></returns>
        public static LogDatasets.EventLogDataTable GetEventPage(int applicationId, int pageSize, int pageIndex, out int?rowCount, int appLocationFilter, int eventTypeFilter
                                                                 , int userId, DateTime startDate, DateTime endDate)
        {
            rowCount = 0;
            DataAccessManager dam = new DataAccessManager(ConnectionString);

            dam.AddInputParameter("@ApplicationId", applicationId);
            dam.AddInputParameter("@PageIndex", pageIndex);
            dam.AddInputParameter("@PageSize", pageSize);
            dam.AddInputParameter("@AppLocationFilter", appLocationFilter);
            dam.AddInputParameter("@EventTypeFilter", eventTypeFilter);

            dam.AddInputParameter("@AuthenticatedUserIdFilter", userId.ToString());
            dam.AddInputParameter("@StartDate", startDate);
            dam.AddInputParameter("@EndDate", endDate);

            dam.AddOutPutParameter("@RowCount", SqlDbType.Int);

            Dictionary <string, object> outputParameters = new Dictionary <string, object>();

            LogDatasets.EventLogDataTable dt = dam.ExecuteTableQuery <LogDatasets.EventLogDataTable>(GetFormattedStoredProcedureName(SP_EVENTLOG_GETPAGE_WITHFILTERS), out outputParameters);
            rowCount = (int)outputParameters["@RowCount"];

            return(dt);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the exception page.
        /// </summary>
        /// <param name="applicationId">The application id.</param>
        /// <param name="pageSize">The amount of record rows to retrieve.</param>
        /// <param name="pageIndex">The index of the page to retrieve.</param>
        /// <param name="rowCount">The total amount of rows of the exception table.</param>
        /// <param name="appLocationFilter">The ApplicationLocation to filter. Set this value to -1 if you don't want to filter by application locations.</param>
        /// <param name="handlingStatus">The handling status of this exception. Set this value to -1 if you don't want to filter by handling status.</param>
        /// <param name="orderBy">The order by.</param>
        /// <returns></returns>
        public static LogDatasets.ExceptionLogDataTable GetExceptionPage(int applicationId, int pageSize, int pageIndex, out int?rowCount, int appLocationFilter, int handlingStatus
                                                                         , ExceptionsOrderBy orderBy)
        {
            rowCount = 0;
            DataAccessManager dam = new DataAccessManager(ConnectionString);

            dam.AddInputParameter("@ApplicationId", applicationId);
            dam.AddInputParameter("@PageIndex", pageIndex);
            dam.AddInputParameter("@PageSize", pageSize);
            dam.AddInputParameter("@AppLocationFilter", appLocationFilter);
            dam.AddInputParameter("@HandlingStatus", handlingStatus);
            dam.AddOutPutParameter("@RowCount", SqlDbType.Int);
            dam.AddInputParameter("@OrderBy", (int)orderBy);

            Dictionary <string, object> outputParameters = new Dictionary <string, object>();

            LogDatasets.ExceptionLogDataTable dt = dam.ExecuteTableQuery <LogDatasets.ExceptionLogDataTable>(GetFormattedStoredProcedureName(SP_EXCEPTIONS_GETPAGE), out outputParameters);
            rowCount = (int)outputParameters["@RowCount"];

            return(dt);
        }