Exemple #1
0
        public JsonResult Category(FormCollection formCollection)
        {
            Page <Dictionary> page = new Page <Dictionary>();

            page.Params = new Dictionary <string, string>();
            if (!string.IsNullOrEmpty(formCollection["module"]))
            {
                page.Params.Add("module", formCollection["module"]);
            }
            if (!string.IsNullOrEmpty(formCollection["field"]))
            {
                page.Params.Add("field", formCollection["field"]);
            }

            if (!string.IsNullOrEmpty(formCollection["query"]))
            {
                page.Params.Add("query", formCollection["query"]);
            }

            int count  = 0;
            var result = dao.Category(page, ref count);

            page.Root          = result;
            page.TotalProperty = count;
            return(new ServiceStackJsonResult
            {
                Data = page
            });
        }