using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace FangYar.WebUI.ashx { /// /// ZYFireResource 的摘要说明 /// public class FireResource : IHttpHandler { #region 变量 FangYar.BLL.FIRE.FIRERESOURCE bll = new BLL.FIRE.FIRERESOURCE(); #endregion public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string action = context.Request.Params["Action"]; string returnstr = ""; switch (action) { case "GetWaterResource": returnstr = GetWaterResource(context); break; } context.Response.Write(returnstr); } //获取消防资源 private string GetWaterResource(HttpContext context) { string strReturn = string.Empty; string OrgId = context.Request.Params["OrgId"]; List lisResources = new List(); lisResources = bll.GetModelList(" 1=1 and org_id in (select o.org_id from fire_org o,(select get_Org_child_list('" + OrgId + "') cids ) s where find_in_set(org_id,cids) )"); if (lisResources != null && lisResources.Count > 0) { strReturn += FangYar.Common.JsonHelper.ToJson(lisResources); } return strReturn; } public bool IsReusable { get { return false; } } } }