Exemplo n.º 1
0
        /// <summary>
        /// 获取日志信息
        /// </summary>
        /// <param name="logId">日志ID</param>
        /// <returns>日志对象</returns>
        public LogInfo GetLog(LoggingSessionInfo loggingSession, string logId)
        {
            string uri = string.Format(ConfigurationManager.AppSettings["dex_url"].Trim() +
                                       "/logservice/getlog?user_id={0}&user_pwd={1}&log_id={2}",
                                       loggingSession.UserID, new UserService().GetUserPassword(loggingSession.UserID),
                                       logId);
            string method   = "GET";
            string data     = DexUtils.GetRemoteData(uri, method, string.Empty);
            var    contract = JsonConvert.Import <DexLogContract>(data);

            return(contract.Log);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取日志列表数量
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <returns></returns>
        public int GetLogsCount(LoggingSessionInfo loggingSession, Hashtable condition)
        {
            string uri = string.Format(ConfigurationManager.AppSettings["dex_url"].Trim() +
                                       "/logservice/getlogscount?user_id={0}&user_pwd={1}",
                                       loggingSession.UserID, new UserService().GetUserPassword(loggingSession.UserID));
            string method = "POST";

            Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(condition, writer);
            string content  = writer.ToString();
            string data     = DexUtils.GetRemoteData(uri, method, content);
            var    contract = JsonConvert.Import <DexCountContract>(data);

            return(contract.count);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取日志列表
        /// </summary>
        /// <param name="condition">查询条件</param>
        /// <param name="maxRowCount">返回最大行数</param>
        /// <param name="startRowIndex">起始行索引</param>
        /// <returns></returns>
        public IList <LogInfo> GetLogs(LoggingSessionInfo loggingSession,
                                       Hashtable condition, int maxRowCount, int startRowIndex)
        {
            string uri = string.Format(ConfigurationManager.AppSettings["dex_url"].Trim() +
                                       "/logservice/getlogs?user_id={0}&user_pwd={1}&start_row={2}&rows_count={3}",
                                       loggingSession.UserID, new UserService().GetUserPassword(loggingSession.UserID),
                                       startRowIndex, maxRowCount);
            string method = "POST";

            Jayrock.Json.JsonTextWriter writer = new Jayrock.Json.JsonTextWriter();
            Jayrock.Json.Conversion.JsonConvert.Export(condition, writer);
            string content  = writer.ToString();
            string data     = DexUtils.GetRemoteData(uri, method, content);
            var    contract = JsonConvert.Import <DexLogsContract>(data);

            return(contract.Logs);
        }