public void delmenu(System.Web.HttpContext context) { context.Response.ContentType = "application/json"; string s = "{\"status\":\"1\"}"; int num = 0; if (!int.TryParse(context.Request["MenuId"], out num)) { return; } System.Collections.Generic.IList <MenuInfo> menusByParentId = WeiboHelper.GetMenusByParentId(num); if (menusByParentId.Count > 0) { s = "{\"status\":\"2\"}"; } else if (WeiboHelper.DeleteMenu(num)) { s = "{\"status\":\"0\"}"; } context.Response.Write(s); }
public void delmenu(HttpContext context) { context.Response.ContentType = "application/json"; string s = "{\"status\":\"1\"}"; int result = 0; if (!int.TryParse(context.Request["MenuId"], out result)) { s = "{\"status\":\"1\"}"; } else { if (WeiboHelper.GetMenusByParentId(result).Count > 0) { s = "{\"status\":\"2\"}"; } else if (WeiboHelper.DeleteMenu(result)) { s = "{\"status\":\"0\"}"; } context.Response.Write(s); } }