| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <%@ WebHandler Language="C#" Class="getOrganization" %>
- using System;
- using System.Web;
- using System.Web.SessionState;
- using System.Data;
- using System.Text;
- using System.Collections;
- using System.Collections.Generic;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using Curtain.DataAccess;
- using DK.XuWei.WebMes;
- public class getOrganization : IHttpHandler, IReadOnlySessionState
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/plain";
- using(IDataAccess conn = DataAccess.Create())
- {
- DataTable dt = conn.ExecuteDatatable(@"
- SELECT
- ORGANIZATIONID AS id,
- ORGANIZATIONCODE AS code,
- ORGANIZATIONNAME AS text,
- '' AS url
- FROM
- TP_MST_ORGANIZATION
- WHERE
- VALUEFLAG = '1'
- ORDER BY
- ORGANIZATIONCODE
- ");
- string rootId = dt.Rows[0]["id"].ToString();
- string rootCode = dt.Rows[0]["code"].ToString();
- string rootText = dt.Rows[0]["text"].ToString();
- string children = Easyui.TableToEasyUITree(dt, rootCode, 3);
- string jsonStr = "[{\"id\":\"" + rootId + "\",\"text\":\"" + rootText + "\"" + children + "}]";
- context.Response.Write(jsonStr);
- }
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
|