Пример #1
0
        public IActionResult GetPageListByCondition(string orgname, int page, int limit)
        {
            var resultCountModel = new RespResultCountViewModel();
            int totalcount       = 0;

            try
            {
                var resultData = _organizeService.GetPageListByCondition(orgname, page, limit, ref totalcount);
                if (resultData.Count != 0)
                {
                    resultCountModel.code  = 0;
                    resultCountModel.msg   = "查询成功";
                    resultCountModel.data  = resultData;
                    resultCountModel.count = totalcount;
                }
                else
                {
                    resultCountModel.code = -1;
                    resultCountModel.msg  = "没有检索到数据";
                }
                return(Ok(resultCountModel));
            }
            catch (Exception ex)
            {
                resultCountModel.code = -1;
                resultCountModel.msg  = "操作失败:" + ex.ToString();
                return(Ok(resultCountModel));
            }
        }