Esempio n. 1
0
        public HttpResponseMessage GetCategoryList()
        {
            //JsonData jd = new JsonData(bll.GetModelList(""));

            string tojson = JsonMapper.ToJson(bll.GetModelList(""));

            return(new HttpResponseMessage {
                Content = new StringContent(tojson)
            });
        }
Esempio n. 2
0
        public void ProcessRequest(HttpContext context)
        {
            Leadin.BLL.Category bll = new BLL.Category();
            context.Response.ContentType = "text/plain";

            List <Model.Category> modelList = bll.GetModelList("");


            var result = modelList.Select(m => new
            {
                id     = m.Id,
                pId    = m.ParentId,
                name   = m.Title,
                open   = false,
                target = "DeployBase",
                url    = "/oasystem/oacategory/detail.aspx?dptid=" + m.Id.ToString(CultureInfo.InvariantCulture)
            }).ToList();

            context.Response.Write(JsonMapper.ToJson(result));
        }