Пример #1
0
        /// <summary>
        /// 科室下所有设备信息(包括收入、支出)
        /// </summary>
        /// <param name="id">科室编号</param>
        /// <param name="date">日期</param>
        /// <param name="userID">用户ID</param>
        /// <param name="sessionID">当前请求所在设备储存的SessionID</param>
        /// <returns>科室下所有设备信息</returns>
        public JsonResult EquipmentsDetailsByDepartment(int userID, string sessionID, int id, string date = "")
        {
            ServiceResultModel <List <EquipmentInfo> > result = new ServiceResultModel <List <EquipmentInfo> >();

            try
            {
                if (!CheckSessionID(userID, sessionID, result))
                {
                    return(MyJson(result, JsonRequestBehavior.AllowGet));
                }
                result.Data = api.EquipmentsDetailsByDepartment(id, date);
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(MyJson(result, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        /// <summary>
        /// 科室下所有设备信息(包括收入、支出)
        /// </summary>
        /// <param name="id">科室编号</param>
        /// <param name="date">日期</param>
        /// <returns>科室下所有设备信息</returns>
        public JsonResult EquipmentsDetailsByDepartment(int id, string date = "")
        {
            ServiceResultModel <List <EquipmentInfo> > result = new ServiceResultModel <List <EquipmentInfo> >();

            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.EquipmentsDetailsByDepartment(id, date);
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(JsonNetResult(result, JsonRequestBehavior.AllowGet));
        }