public void EditMenus(HttpContext context) { context.Response.ContentType = "application/json"; string s = "{\"status\":\"1\"}"; MenuInfo menu = new MenuInfo { Content = context.Request["Content"], Name = context.Request["Name"], Type = context.Request["Type"] }; if (!string.IsNullOrEmpty(context.Request["ParentMenuId"])) { menu.ParentMenuId = int.Parse(context.Request["ParentMenuId"]); } else { menu.ParentMenuId = 0; } int result = 0; if (!int.TryParse(context.Request["MenuId"], out result)) { s = "{\"status\":\"1\"}"; } else { menu.MenuId = result; if (WeiboHelper.UpdateMenu(menu)) { s = "{\"status\":\"0\"}"; } context.Response.Write(s); } }
public void EditMenus(System.Web.HttpContext context) { context.Response.ContentType = "application/json"; string s = "{\"status\":\"1\"}"; MenuInfo menuInfo = new MenuInfo(); menuInfo.Content = context.Request["Content"]; menuInfo.Name = context.Request["Name"]; menuInfo.Type = context.Request["Type"]; if (!string.IsNullOrEmpty(context.Request["ParentMenuId"])) { menuInfo.ParentMenuId = int.Parse(context.Request["ParentMenuId"]); } else { menuInfo.ParentMenuId = 0; } int menuId = 0; if (!int.TryParse(context.Request["MenuId"], out menuId)) { return; } menuInfo.MenuId = menuId; if (WeiboHelper.UpdateMenu(menuInfo)) { s = "{\"status\":\"0\"}"; } context.Response.Write(s); }