Beispiel #1
0
        /// <summary>
        /// 设备信息总览
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="sessionID">当前请求所在设备储存的SessionID</param>
        /// <returns>设备数量、设备金额、折旧率、当年服务人次</returns>
        public JsonResult QueryOverview(int userID, string sessionID)
        {
            ServiceResultModel <Dictionary <string, object> > result = new ServiceResultModel <Dictionary <string, object> >();

            try
            {
                if (!CheckSessionID(userID, sessionID, result))
                {
                    return(MyJson(result, JsonRequestBehavior.AllowGet));
                }
                result.Data = api.EquipmentQueryOverview();
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(MyJson(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        /// <summary>
        /// 设备信息总览
        /// </summary>
        /// <returns>设备数量、设备金额、折旧率、当年服务人次</returns>
        public JsonResult QueryOverview()
        {
            ServiceResultModel <Dictionary <string, object> > result = new ServiceResultModel <Dictionary <string, object> >();

            if (WebConfig.CHECK_SESSION_ON_DASHBORAD_API == true && CheckSession() == false)
            {
                return(Json(ResultModelBase.CreateTimeoutModel(), JsonRequestBehavior.AllowGet));
            }
            if (WebConfig.CHECK_SESSION_ON_DASHBORAD_API == true && CheckSessionID() == false)
            {
                return(Json(ResultModelBase.CreateLogoutModel(), JsonRequestBehavior.AllowGet));
            }
            try
            {
                result.Data = api.EquipmentQueryOverview();
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(JsonNetResult(result, JsonRequestBehavior.AllowGet));
        }