Ejemplo n.º 1
0
        /// <summary>
        /// 获取日志类型
        /// </summary>
        /// <param name="systemID">子系统编号</param>
        /// <returns>日志类型集合,保含ID、Name</returns>
        public DataSet GetLogTypeBySystemID(int systemID)
        {
            string commandText = string.Format("SELECT ID AS ID ,NAME AS NAME FROM LOG_TYPE WHERE SYSTEMID={0} ORDER BY SORTID",
                                               systemID);

            return(OracleAppender.ExecuteQuery(connectionString, commandText));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取指定日期、指定类型的子系统日志
        ///
        /// 分页数据
        /// </summary>
        /// <param name="systemID">子系统ID</param>
        /// <param name="logType">日志类型</param>
        /// <param name="beginDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>日志记录集合</returns>
        public DataSet GetLog(int systemID, int logType, DateTime beginDate, DateTime endDate)
        {
            string commandText = string.Format("SELECT ID as ID ,EmpCode as Empcode ,OutID as OutID,Name as Name,Message as Message,CreateDate as CreateDate" +
                                               " FROM LOG_OPERATION " +
                                               " WHERE CREATEDATE BETWEEN TO_DATE('{0}','yyyy-MM-dd HH24:mi:ss') AND TO_DATE('{1}','yyyy-MM-dd HH24:mi:ss') " +
                                               " AND SYSTEMID={2} AND LOGTYPE={3} " +
                                               " Order by CreateDate",
                                               beginDate.ToString("yyyy-MM-dd HH:mm:ss"), endDate.ToString("yyyy-MM-dd HH:mm:ss"), systemID, logType);

            return(OracleAppender.ExecuteQuery(connectionString, commandText));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取指定日期、指定类型的子系统日志
        ///
        /// 分页数据
        /// </summary>
        /// <param name="systemID">子系统ID</param>
        /// <param name="logType">日志类型</param>
        /// <param name="beginDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <param name="pageSize">每页容量</param>
        /// <param name="pageNo">页号</param>
        /// <returns>日志记录集合</returns>
        public DataSet GetLog(int systemID, int logType, DateTime beginDate, DateTime endDate, int pageSize, int pageNo)
        {
            int maxRowNum = pageNo * pageSize;
            int minRowNum = maxRowNum - pageSize + 1;

            string commandText = string.Format("SELECT rn,ID as ID ,EmpCode as Empcode ,OutID as OutID,Name as Name,Message as Message,CreateDate as CreateDate" +
                                               " FROM ( select A.* ,rownum as rn from LOG_OPERATION A " +
                                               " WHERE CREATEDATE BETWEEN TO_DATE('{0}','yyyy-MM-dd HH24:mi:ss') AND TO_DATE('{1}','yyyy-MM-dd HH24:mi:ss') " +
                                               " AND SYSTEMID={2} AND LOGTYPE={3} " +
                                               " Order by CreateDate)" +
                                               " Where rn <={4} and rn >={5}",
                                               beginDate.ToString("yyyy-MM-dd HH:mm:ss"), endDate.ToString("yyyy-MM-dd HH:mm:ss"), systemID, logType, maxRowNum, minRowNum);

            return(OracleAppender.ExecuteQuery(connectionString, commandText));
        }