Пример #1
0
        /// <summary>
        /// 获取所有设备信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetAllDeviceInfos(string limit, string page, string schDeviceId, string schStatusFlag)
        {
            int pageSize  = int.Parse(limit ?? "10");
            int pageIndex = int.Parse(page ?? "1");

            //过滤的设备名 过滤备注schDeviceId schStatusFlag
            var queryParam = new DeviceQueryParam()
            {
                PageSize      = pageSize,
                PageIndex     = pageIndex,
                SchDeviceId   = schDeviceId,
                SchStatusFlag = schStatusFlag,
                Total         = 0
            };
            var pageData = DeviceInfoService.LoagDevicePageData(queryParam).ToList();
            var data     = new { code = 0, msg = "", count = queryParam.Total, data = pageData.ToList() };

            if (!string.IsNullOrEmpty(schDeviceId) || !string.IsNullOrEmpty(schStatusFlag))
            {
                //写操作日志
                OperationLogService.Add("查找设备", "设备管理", LoginInfo, schDeviceId, schStatusFlag);
            }
            return(Json(data, JsonRequestBehavior.AllowGet));
        }