private MenuInfo GetParentMenu(int ParentID) { MenuInfo parent = new MenuInfo(); if (ParentID <= 0) { parent = rootMenu; } else { string strError = string.Empty; parent = new MenuInfo() { ID = ParentID }; if (!Basic_Func.GetMenuByID(ref parent, ref strError)) { Common.Common_Func.ErrorMessage(strError, "读取上级菜单失败"); return(null); } } return(parent); }
private void GetParentMenu() { bsMenu.EndEdit(); if (_menu.ParentID <= 0) { _parent = rootMenu; } else { string strErr = string.Empty; _parent = new MenuInfo() { ID = _menu.ParentID }; if (!Basic_Func.GetMenuByID(ref _parent, ref strErr)) { Common.Common_Func.ErrorMessage(strErr, "读取上级菜单失败"); } } _menu.ParentID = _parent.ID; _menu.NodeUrl = _parent.NodeUrl; _menu.NodeSort = _parent.SonQty + 1; _menu.NodeLevel = _parent.NodeLevel + 1; }