Пример #1
0
        public override void AppSelfMessageNotic(object sender, SelfMessageEventArgs e)
        {
            switch (e.MsgType)
            {
            case AppSelfMsgType.DataSearchPlay:
                Conditions con = new Conditions();
                con = JsonUnityConvert.DeserializeObject <Conditions>(e.Message.ToString());
                foreach (Item item in con.ToList())
                {
                    if (item.Key.Equals("DeviceID"))
                    {
                        SearchManager.GetInstance().MediaLogsSerach.DeviceID = item.Value;
                    }
                }
                ShowSelfViewNotice();
                manage.ShowDataSearchPlay();

                SearchManager.GetInstance().MediaLogsSerach.CollectEndTime = DateTime.Now.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
                SearchManager.GetInstance().MediaLogsSerach.CollectStartTime = DateTime.Now.Date.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
                SearchManager.GetInstance().MediaLogsSerach.SearchTime = DateTime.Now.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
                SearchManager.GetInstance().MediaLogsSerach.FileName = "";
                SearchManager.GetInstance().MediaLogsSerach.OrgID = AppConfigInfos.LimitsUserInfos.OrgIDCodeStr;
                SearchManager.GetInstance().MediaLogsSerach.PageIndex = 1;
                SearchManager.GetInstance().MediaLogsSerach.UserImp = "0";
                SearchManager.GetInstance().MediaLogsSerach.FileType = "0";
                SearchManager.GetInstance().MediaLogsSerach.IsAdvanced = true;
                ModelResponsible.Instance.ClearMediaList();
                SearchManager.GetInstance().SearchMediaLogCount(SearchManager.GetInstance().MediaLogsSerach);
                SearchManager.GetInstance().SearchMediaLogDetail(SearchManager.GetInstance().MediaLogsSerach);
                LogHelper.Instance.WirteLog("CollectMain:Playback  Search", LogLevel.LogDebug);
                break;

            default:
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// Http请求结果数据转换成 HttpResultInfo 对象(JSON第一层包装)
        /// </summary>
        /// <param name="httpResult"></param>
        /// <returns></returns>
        public static HttpResultInfo HttpJsonToResult(this HttpResult httpResult)
        {
            HttpResultInfo result = new HttpResultInfo();

            try
            {
                if (httpResult.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    result = JsonUnityConvert.DeserializeObject <HttpResultInfo>(httpResult.Html);
                }
                else
                {
                    result.Msg  = httpResult.StatusDescription;
                    result.Data = httpResult.Html;
                }
            }
            catch (Exception ex)
            {
                result.Msg  = ex.ToString();
                result.Data = "数据解析出错";
            }

            return(result);
        }