using MESClassLibrary.BLL.User;
using MESClassLibrary.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MESWebSite.Service
{
///
/// SystemManager 的摘要说明
/// lx 2017-06-27
///
public class SystemManager : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
try
{
string ActionCode = context.Request["action"].ToString().Trim();
switch (ActionCode)
{
//查询主菜单
case "GETMENU":
GetMenuJson(context);
break;
}
}
catch (Exception ex)
{
context.WriteJsonResult(null, false, ex.Message);
}
}
///
/// 查询菜单
///
///
public void GetMenuJson(HttpContext context)
{
string userID = "";
userID = context.Request.Params["userID"].ToString().Trim();
List navList = new Sys_NavMenuService().BuilderLeftMenu(userID);
string json = JsonConvert.SerializeObject(navList);
string result = "{\"success\":" + true.ToString().ToLower() + ",\"message\":\"\",\"data\":" + json + "}";
context.Response.Write(result);
//string x = JsonConvert.SerializeObject(navList);
//context.WriteJsonResult(null);
}
public bool IsReusable
{
get
{
return false;
}
}
}
}