public static void CreateMenuNode(int pi, MenuFull_RootButton button) { MenuFull_ButtonGroup menu = GetButtonGroup(); if (pi == -1) { if (menu.button.Count == 3) { throw new Exception("菜单(一级)超出最大数量3个!"); } menu.button.Add(button); } else { var list = menu.button[pi].sub_button; if (list == null) { list = new List<MenuFull_RootButton>(); } if (menu.button.Count == 5) { throw new Exception("菜单(二级)超出最大数量5个!"); } list.Add(button); menu.button[pi].sub_button = list; } ReflushSetting(menu); }
internal static void SaveMenuNode(int pi, int si, MenuFull_RootButton button) { MenuFull_ButtonGroup menu = GetButtonGroup(); if (si == -1) { menu.button[pi] = button; } else { menu.button[pi].sub_button[si] = button; } ReflushSetting(menu); }
public string CreateMenu_post(HttpContext context) { int pi = int.Parse(context.Request["pi"]); MenuFull_RootButton button = new MenuFull_RootButton(); button.name = context.Request["name"]; button.type = context.Request["type"]; button.key = context.Request["key"]; button.url = context.Request["url"]; WeixinHelper.CreateMenuNode(pi, button); return "{result:true,message:'修改成功'}"; }