/// <summary>
        /// 获取预警状态
        /// </summary>
        /// <returns></returns>
        public ActionResult GetMyEarlyWarningState(string param)
        {
            DateTime?SDT       = null;
            DateTime?EDT       = null;
            string   UserId    = OperatorProvider.Provider.CurrentUser.UserId;
            string   ProjectId = OperatorProvider.Provider.CurrentUser.ProjectId;

            if (string.IsNullOrEmpty(param))
            {
                SDT = null;
                EDT = null;
            }
            else
            {
                JObject jo = (JObject)JsonConvert.DeserializeObject(param);
                if (jo["SDT"].ToString() != "{}" && jo["SDT"].ToString() != "")
                {
                    SDT = Convert.ToDateTime(jo["SDT"]);
                }
                if (jo["EDT"].ToString() != "{}" && jo["EDT"].ToString() != "")
                {
                    EDT = Convert.ToDateTime(jo["EDT"]).AddDays(1);
                }
            }
            var data = _earlyWarning.GetMyEarlyWarningState(UserId, ProjectId, SDT, EDT);

            return(Content(data.ToJson()));
        }
Esempio n. 2
0
        /// <summary>
        /// 我的预警状态
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="SDT"></param>
        /// <param name="EDT"></param>
        /// <returns></returns>
        public HttpResponseMessage GetAppMyEarlyWarningState(string UserId, string ProjectId = "", DateTime?SDT = null, DateTime?EDT = null)
        {
            var data = _earlyWarning.GetMyEarlyWarningState(UserId, ProjectId, SDT, EDT);

            return(AjaxResult.Success(data).ToJsonApi());
        }