示例#1
0
        public JsonResult Query(string filter)
        {
            var result = new JsonResultModel()
            {
            };

            try
            {
                var filters = JsonConvert.DeserializeObject <QueryPageFilter>(filter);
                var objs    = ServiceAppContext.Instance.DataBaseClassHelper.GetQueryResultN(filters);

                result.SetData(objs).SetTotal(objs.Length);
            }
            catch (Exception ex)
            {
                if (ex is ApiException)
                {
                    ApiException e = ex as ApiException;
                    result.SetCode(e.Code).SetMsg(e.Message);
                }
                else
                {
                    result.SetCode(ResultCode.CUSTOMEXCEPTION).SetMsg(ex.Message);
                }
            }
            JsonResult re = new JsonResult(result);

            return(re);
        }