Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            DataTable dtAll   = us.BindMenuByJosn(); //查询全部菜单
            string    strjson = string.Empty;

            if (context.Request.QueryString["Type"] == "View" &&
                !string.IsNullOrEmpty(context.Request.QueryString["GA02001"]))                                               //判断是否是查看
            {
                DataTable dtPart = new BLL.UserBLL().SelectSystemMenuBySystemRoleId(context.Request.QueryString["GA02001"]); //根绝角色id查询菜单
                strjson = ToViewJson(dtAll, dtPart);
            }
            else if (context.Request.QueryString["Type"] == "Edit" &&
                     !string.IsNullOrEmpty(context.Request.QueryString["GA02001"]))                                          //判断是否是编辑
            {
                DataTable dtPart = new BLL.UserBLL().SelectSystemMenuBySystemRoleId(context.Request.QueryString["GA02001"]); //根绝角色id查询菜单
                strjson = ToEditJson(dtAll, dtPart);
            }
            else
            {
                strjson = ToInitJson(dtAll);
            }
            context.Response.Write(strjson);
        }