gyhlw_dotnet/网站项目/VRS/Handler/ZHC/Menu_Tree_Get.ashx.cs

45 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace VRS.Handler.ZHC
{
/// <summary>
/// 获取菜单树
/// 参数 menu_id 值等于all :菜单树根结点字典
/// 无参数:获取所有菜单数据
/// </summary>
public class Menu_Tree_Get : BasePage, IHttpHandler
{
DataService.BLL.zhc_menu_tree bll_menu_tree = new DataService.BLL.zhc_menu_tree();
DataService.BLL.admin_log log = new DataService.BLL.admin_log();
public override void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string menu_id = context.Request.Params["menu_id"];
if (!string.IsNullOrEmpty(menu_id) && menu_id.ToUpper() == "ALL")
{
var top_list = bll_menu_tree.GetList("id,parentId,name", " parentId='' or parentId is null ").Tables[0];
context.Response.Write(GetJsonWithCode(APICode.Success, top_list));
context.Response.End();
}
var result_List = bll_menu_tree.GetModelList("");
context.Response.Write(GetJsonWithCode(APICode.Success, result_List));
context.Response.End();
}
public new bool IsReusable
{
get
{
return false;
}
}
}
}