예제 #1
0
        /// <summary>
        /// 添加菜单
        /// </summary>
        /// <param name="httpContext"></param>
        public void AddMenu(HttpContext httpContext)
        {
            var customMenu = new Model.CustomMenu();
            var customMenuDal = new CustomMenuDal();
            var hashTable = new Hashtable();
            var pid = httpContext.Request.Params["pid"];
            var type = httpContext.Request.Params["type"];
            var name = httpContext.Request.Params["name"];
            var nkey = httpContext.Request.Params["nkey"];
            var nurl = httpContext.Request.Params["nurl"];

            customMenu.Id = nkey;
            customMenu.Name = name;
            customMenu.Nkey = nkey;
            customMenu.Pid = pid;
            customMenu.Type = type;
            customMenu.Url = nurl;

            customMenuDal.Add(customMenu);

            hashTable["isSuccess"] = true;
            hashTable["jsMethod"] = "ajax_AddMenu";
            var json = _jss.Serialize(hashTable);
            httpContext.Response.Write(json);
        }
예제 #2
0
 /// <summary>
 /// 根据id删除菜单
 /// </summary>
 /// <param name="httpContext"></param>
 public void DelMenu(HttpContext httpContext)
 {
     var customMenu = new Model.CustomMenu();
     var customMenuDal = new CustomMenuDal();
     var hashTable = new Hashtable();
     var id = httpContext.Request.Params["id"];
     customMenu.Id = id;
     customMenuDal.Del(customMenu);
     hashTable["isSuccess"] = true;
     hashTable["jsMethod"] = "ajax_DelMenu";
     var json = _jss.Serialize(hashTable);
     httpContext.Response.Write(json);
 }