public IEnumerable <Menu> GetMenuItems([FromBody] MenuQuery menuq) { List <Menu> xMenuList = new List <Menu>(); xMenuList = xMenuRepo.GetMenuItems(menuq.app_id, menuq.user_type); return(xMenuList); }
public object GetPageList(MenuQuery query) { var filterFlag = new { hasName = query.Name.IsNullOrWhiteSpace() }; var menus = MenuDao.Query(); var list = from m in menus where filterFlag.hasName && m.Name.Contains(query.Name) join m1 in menus on m.ParentId equals m1.ID into temp from t in temp.DefaultIfEmpty() select new { ID = m.ID, Name = m.Name, Url = m.Url, ParentId = m.ParentId, ParentName = t.Name, SortNo = m.SortNo, Icon = m.Icon, Description = m.Description, EnabledState = m.EnabledState, CreatedOn = m.CreatedOn }; return(list); }
public List <MenuEntity> GetMenuList(MenuQuery query) { List <MenuEntity> list = new List <MenuEntity>(); StringBuilder sqlCommandText = new StringBuilder(); sqlCommandText.Append("SELECT MenuID,JournalID,PMenuID,MenuName,MenuUrl,IconUrl,SortID,MenuType,GroupID,Status,IsContentMenu,AddDate FROM dbo.Menu WITH(NOLOCK)"); string whereSQL = MenuQueryToSQLWhere(query); string orderBy = MenuQueryToSQLOrder(query); if (!string.IsNullOrEmpty(whereSQL)) { sqlCommandText.Append(" WHERE " + whereSQL); } if (!string.IsNullOrEmpty(orderBy)) { sqlCommandText.Append(" ORDER BY " + orderBy); } DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString()); using (IDataReader dr = db.ExecuteReader(cmd)) { list = MakeMenuList(dr); } return(list); }
public IHttpActionResult Get(int id) { ThrowIfUserHasNoRole(readRole); using (MenuQuery menuQuery = new MenuQuery(Db)) { var data = menuQuery.GetByPrimaryKey(id); SaveLog("Menu", "Get", JsonConvert.SerializeObject(new { primaryKey = id })); return(Ok(new SuccessResponse(data))); } }
/// <summary> /// 保存用户设置的权限 /// </summary> private void Save() { long UserID = NDConvert.ToInt64(drpPersonList.SelectedValue); new RightQuery().DeleteUserRight(UserID); UserEntity Pentity = new UserEntity(UserID); new MenuFunctionRightQuery().DeleteUserMenuFunctionRight(UserID); Node node = null; RightEntity entity = null; MenuFunctionRightEntity mfEntity = null; for (int i = 0; i < tvRight.CheckedNodes.Count; i++) { node = (Node)tvRight.CheckedNodes[i]; switch (node.Level) { case 0: case 1: entity = new RightEntity(); entity.UserID = UserID; entity.MenuID = NDConvert.ToInt64(node.DataKey.ToString()); new RightRule().Add(entity); break; case 2: if (MenuQuery.IsHaveChileMenu(NDConvert.ToInt64(node.Parent.DataKey.ToString()))) //判断是否有子菜单,如有有子菜单说明本层是菜单,如果没有则是菜单功能项 { entity = new RightEntity(); entity.UserID = UserID; entity.MenuID = NDConvert.ToInt64(node.DataKey.ToString()); new RightRule().Add(entity); } else { mfEntity = new MenuFunctionRightEntity(); mfEntity.FID = NDConvert.ToInt64(node.DataKey.ToString()); mfEntity.UserID = UserID; mfEntity.MenuID = NDConvert.ToInt64(node.Parent.DataKey.ToString()); new MenuFunctionRightRule().Add(mfEntity); } break; case 3: mfEntity = new MenuFunctionRightEntity(); mfEntity.FID = NDConvert.ToInt64(node.DataKey.ToString()); mfEntity.UserID = UserID; mfEntity.MenuID = NDConvert.ToInt64(node.Parent.DataKey.ToString()); new MenuFunctionRightRule().Add(mfEntity); break; } } }
/// <summary> /// 将查询实体转换为Where语句 /// <param name="query">查询实体</param> /// <returns>获取Where语句,不包含Where</returns> /// </summary> public string MenuQueryToSQLWhere(MenuQuery query) { StringBuilder sbWhere = new StringBuilder(" JournalID = " + query.JournalID); if (query.GroupID > 0) { sbWhere.Append(" AND GroupID = ").Append(query.GroupID); } if (query.Status != null) { sbWhere.Append(" AND [Status] = ").Append(query.Status.Value); } return(sbWhere.ToString()); }
public JsonResult GetMenusList(MenuQuery query) { var list = MenuService.Query().OrderByDescending(m => m.CreatedOn); var tableData = new DataTablesResult { draw = query.draw, recordsTotal = list.Count(), recordsFiltered = list.Count(), data = list.QueryForStart(query.start, query.length) }; return(Json(tableData, JsonRequestBehavior.AllowGet)); }
public IHttpActionResult Search([FromUri] MenuSearchFilter filter) { ThrowIfUserHasNoRole(readRole); if (filter == null) { throw new KairosException("Missing search filter parameter"); } using (var menuQuery = new MenuQuery(Db)) { var data = menuQuery.Search(filter); return(Ok(new SuccessResponse(data))); } }
/// <summary> /// 绑定树状结构 /// </summary> private void BindTreeView() { tvMenu.ClearAll(); DataTable dt = null; Infragistics.WebUI.UltraWebNavigator.Node tn1; Infragistics.WebUI.UltraWebNavigator.Node tn2; Infragistics.WebUI.UltraWebNavigator.Node tn3; //一层 dt = new MenuQuery().GetMenuTop(); tn1 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn1.Text = "系统菜单"; tn1.DataKey = "0"; tn1.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.False; for (int i = 0; i < dt.Rows.Count; i++) { tn2 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn2.Text = dt.Rows[i]["MenuName"].ToString(); tn2.DataKey = dt.Rows[i]["MenuID"].ToString(); tn2.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; if (dt.Rows[i]["IsDisplay"].ToString() == "0") { tn2.Style.Font.Bold = true; } //tn2.TargetUrl = "javascript:window.parent.frames['Code'].location.href = 'Code.aspx?ID=" + tn2.DataKey.ToString() + "';"; tn1.Nodes.Add(tn2); //二层 DataTable dtChild = new MenuQuery().GetMenuChild(NDConvert.ToInt64(dt.Rows[i]["MenuID"].ToString())); for (int j = 0; j < dtChild.Rows.Count; j++) { tn3 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn3.Text = dtChild.Rows[j]["MenuName"].ToString(); tn3.DataKey = dtChild.Rows[j]["MenuID"].ToString(); tn3.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; if (dtChild.Rows[j]["IsDisplay"].ToString() == "False") { tn3.Style.ForeColor = System.Drawing.Color.Blue; } tn3.TargetUrl = "javascript:window.parent.frames['MenuFunction'].location.href = 'MenuFunction.aspx?ID=" + tn3.DataKey.ToString() + "';"; tn2.Nodes.Add(tn3); } } tvMenu.Nodes.Add(tn1); tvMenu.ExpandAll(); }
/// <summary> /// 查看 /// </summary> /// <param name="MenuID"></param> /// <returns></returns> public ActionResult View(long?MenuID) { MenuEntity menuEntity = new MenuEntity(); if (MenuID != null) { MenuQuery query = new MenuQuery(); query.JournalID = JournalID; query.MenuID = MenuID.Value; ISiteSystemFacadeService siteSystemService = ServiceContainer.Instance.Container.Resolve <ISiteSystemFacadeService>(); menuEntity = siteSystemService.GetMenu(query); } return(View(menuEntity)); }
/// <summary> /// 查询条件分页查询出来菜单列表 /// </summary> /// <param name="GuIds"></param> /// <returns></returns> public (List <MenuViewMoel>, int) GetQueryMenuByPage(MenuQuery menuQuery) { var query = ExpressionBuilder.True <SysMenu>(); query = query.And(menu => menu.IsDrop == false); if (!menuQuery.Name.IsNullOrEmpty()) { query = query.And(m => m.Name.Contains(menuQuery.Name.Trim())); } if (!menuQuery.UrlAddress.IsNullOrEmpty()) { query = query.And(m => m.UrlAddress.Contains(menuQuery.UrlAddress.Trim())); } if (!menuQuery.APIAddress.IsNullOrEmpty()) { query = query.And(m => m.APIAddress.Contains(menuQuery.APIAddress.Trim())); } var list = (from a in _menuRepositoty.GetAll(query) join b in _menuRepositoty.GetAll(x => x.IsDrop == false) on a.ParentId equals b.Id into le from aa in le.DefaultIfEmpty() select new MenuViewMoel { Id = a.Id, Name = a.Name, ParentId = a.ParentId, ParentName = aa.Name, Memo = a.Memo, APIAddress = a.APIAddress, UrlAddress = a.UrlAddress, Sort = a.Sort, Icon = a.Icon, CreatedDate = a.CreatedDate, ParentIdArr = a.ParentIdArr, }); //添加排序 OrderCondition <MenuViewMoel>[] orderConditions = new OrderCondition <MenuViewMoel>[] { new OrderCondition <MenuViewMoel>(x => x.CreatedDate, SortDirectionEnum.Descending), new OrderCondition <MenuViewMoel>(x => x.UrlAddress, SortDirectionEnum.Ascending) }; Parameters parameters = new Parameters(); parameters.PageIndex = menuQuery.PageIndex; parameters.PageSize = menuQuery.PageSize; parameters.OrderConditions = orderConditions; return(list.PageBy(parameters).ToList(), list.Count()); //_menuRepositoty.PageBy<SysMenu>(menuQuery.PageIndex, menuQuery.PageSize, query).ToList(); }
public Pager <MenuEntity> GetMenuPageList(MenuQuery query) { int recordCount = 0; string whereSQL = MenuQueryToSQLWhere(query); string orderBy = MenuQueryToSQLOrder(query); DataSet ds = db.GetPagingData("Menu", "MenuID,JournalID,PMenuID,MenuName,MenuUrl,IconUrl,SortID,MenuType,GroupID,Status,IsContentMenu,AddDate", orderBy, whereSQL, query.CurrentPage, query.PageSize, out recordCount); Pager <MenuEntity> pager = new Pager <MenuEntity>(); if (ds != null && ds.Tables.Count > 0) { pager.ItemList = MakeMenuList(ds.Tables[0]); } pager.CurrentPage = query.CurrentPage; pager.PageSize = query.PageSize; pager.TotalRecords = recordCount; return(pager); }
public MessageModel <PageModel <MenuViewMoel> > GetMenuByPage([FromQuery] MenuQuery menuQuery) { var list = _menuServer.GetQueryMenuByPage(menuQuery); //var query = (from a in list join b in lists on a. // ) return(new MessageModel <PageModel <MenuViewMoel> >() { success = true, msg = "数据获取成功", response = new PageModel <MenuViewMoel>() { TotalCount = list.Item2, data = list.Item1, } }); }
/// <summary> /// 新增 /// </summary> private void Save() { MenuEntity entity = new MenuEntity(); entity.ImageURL = txtImageURL.Text; if (rdoIsDisplay.SelectedValue == "0") { entity.IsDisplay = false; } else { entity.IsDisplay = true; } entity.IsLink = false; entity.MenuName = txtMenuName.Text.Trim(); entity.NavigateURL = txtNavigateURL.Text; entity.ParentMenuID = this.MenuID; entity.Type = NDConvert.ToInt32(drpType.SelectedValue); entity.IsDeleted = false; entity.SortOrder = MenuQuery.MaxSortIndex(this.MenuID); new MenuRule().Add(entity); }
public IViewComponentResult Invoke() { IEnumerable <(int, string)> status; if (User.Identity.IsAuthenticated) { status = _orderQuery.GetUserOrdersStatusBy(User.Identity.Name); } else { status = new List <(int, string)>(); } var result = new MenuQuery() { ArticleCategoryQuery = _articleCategoryQuery.GetArticleCategoriesForMenu(), CategoryQuery = _categoryQuery.GetAllProductCategoriesForMenu(), UserOrdersStatus = status }; return(View(result)); }
/// <summary> /// 查询条件分页查询出来菜单列表 /// </summary> /// <param name="GuIds"></param> /// <returns></returns> public List <MenuViewMoel> GetQueryMenuByPage(MenuQuery menuQuery, out int Total) { var query = ExpressionBuilder.True <SysMenu>(); query = query.And(menu => menu.IsDrop == false); if (!menuQuery.Name.IsNullOrEmpty()) { query = query.And(m => m.Name.Contains(menuQuery.Name.Trim())); } if (!menuQuery.UrlAddress.IsNullOrEmpty()) { query = query.And(m => m.UrlAddress.Contains(menuQuery.UrlAddress.Trim())); } if (!menuQuery.APIAddress.IsNullOrEmpty()) { query = query.And(m => m.APIAddress.Contains(menuQuery.APIAddress.Trim())); } Total = _menuRepositoty.Count(query); var list = (from a in _menuRepositoty.PageBy(menuQuery.PageIndex, menuQuery.PageSize, query) join b in _menuRepositoty.GetAll(x => x.IsDrop == false) on a.ParentId equals b.Id into le from aa in le.DefaultIfEmpty() select new MenuViewMoel { Id = a.Id, Name = a.Name, ParentId = a.ParentId, ParentName = aa.Name, Memo = a.Memo, APIAddress = a.APIAddress, UrlAddress = a.UrlAddress, Sort = a.Sort, Icon = a.Icon, CreatedDate = a.CreatedDate, ParentIdArr = a.ParentIdArr, }).ToList(); return(list); //_menuRepositoty.PageBy<SysMenu>(menuQuery.PageIndex, menuQuery.PageSize, query).ToList(); }
/// <summary> /// 修改状态 /// </summary> /// <param name="menuEntity"></param> /// <returns></returns> public bool UpdateStaus(MenuQuery menuQuery) { bool flag = false; StringBuilder whereCommandText = new StringBuilder(); if (menuQuery.MenuIDList.Count == 0) { whereCommandText.Append(" MenuID=@MenuID AND JournalID=@JournalID "); } else { whereCommandText.AppendFormat(" MenuID IN ({0}) AND JournalID=@JournalID ", string.Join(",", menuQuery.MenuIDList)); } StringBuilder sqlCommandText = new StringBuilder(); sqlCommandText.Append("Status=@Status"); DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.Menu SET {0} WHERE {1}", sqlCommandText.ToString(), whereCommandText.ToString())); if (menuQuery.MenuIDList.Count == 0) { db.AddInParameter(cmd, "@MenuID", DbType.Int64, menuQuery.MenuID); } db.AddInParameter(cmd, "@JournalID", DbType.Int64, menuQuery.JournalID); db.AddInParameter(cmd, "@Status", DbType.Byte, menuQuery.Status); try { db.ExecuteNonQuery(cmd); flag = true; } catch (SqlException sqlEx) { throw sqlEx; } return(flag); }
public IActionResult Index(MenuQuery model) { var response = new ResponseResult <PaggingResult <MenuResult> >(); List <SysMenu> allDataList = null; using (_dbContext) { allDataList = _dbContext.SysMenu.ToList(); } var datas = from item in allDataList.Where(a => a.ParentId == 0).OrderBy(a => a.OrderNum) select new MenuResult { Id = item.Id, MenuName = item.MenuName, ParentId = item.ParentId, OrderNum = item.OrderNum, Url = item.Url, MenuType = item.MenuType, Visible = item.Visible, Perms = item.Perms, Icon = item.Icon, IsFrame = (byte)(item.MenuType == 1 ? 2 : 0), Component = string.Empty, CreateBy = item.CreateBy, CreatedAt = item.CreatedAt?.ToUtcDateTimeString(), UpdateBy = item.UpdateBy, UpdatedAt = item.UpdatedAt?.ToUtcDateTimeString(), Remark = item.Remark, ChildrenList = GetChildMenus(item.Id, allDataList), RouteCache = (byte)(item.MenuType == 1 ? 2 : 0), RouteComponent = string.Empty, RouteName = string.Empty, RoutePath = string.Empty, }; return(Ok(response.Success("数据获取成功", new PaggingResult <MenuResult>(new Pagging(model.Page, model.PageSize, allDataList.Count), datas)))); }
public SearchResultSet SearchMenus(MenuQuery menuQuery) { throw new NotImplementedException(); }
/// <summary> /// 更新菜单状态 /// </summary> /// <param name="menuEntity"></param> /// <returns></returns> public bool UpdateStaus(MenuQuery menuQuery) { return(MenuBusProvider.UpdateStaus(menuQuery)); }
/// <summary> /// 更新菜单状态 /// </summary> /// <param name="menuQuery"></param> /// <returns></returns> public bool UpdateStaus(MenuQuery menuQuery) { return(MenuDataAccess.Instance.UpdateStaus(menuQuery)); }
public async Task <PagedResult <MenuDto> > Menus(MenuQuery query) { return(await query.DoQuery(_db)); }
public MenuListDataProvider(GlobalSolusindoDb db, tblM_User user, MenuQuery menuQuery) : base(db, user) { this.menuQuery = menuQuery; }
/// <summary> /// 将查询实体转换为Order语句 /// <param name="query">查询实体</param> /// <returns>获取Order语句,不包含Order</returns> /// </summary> public string MenuQueryToSQLOrder(MenuQuery query) { return(" SortID ASC, MenuID ASC"); }
/// <summary> /// 加载最顶级菜单 /// </summary> /// <param name="dtMenu"></param> private void LoadLeftMenu() { try { CommonEnum.MenuType MenuType = CommonEnum.MenuType.Inner; switch (SessionState.OUType) { case (int)CommonEnum.OUType.Inner: case (int)CommonEnum.OUType.Outer: MenuType = CommonEnum.MenuType.Inner; break; } HtmlTable tb = new HtmlTable(); tb.CellPadding = 0; tb.CellSpacing = 0; HtmlTableRow tr1 = null; HtmlTableRow tr2 = null; HtmlTableCell tcMenuTitle1 = null; HtmlTableCell tcMenuTitle2 = null; HtmlTableCell tcMenuList = null; DataTable Dt = null; DataTable DtLayer1 = null; string Url = ""; string MenuName = ""; int Count = 0; //判断加载菜单的个数 long menuID = 0; long UserID = SessionState.UserID; //一级菜单 Dt = new MenuQuery().GetMenuAll(0, MenuType); for (int i = 0; i < Dt.Rows.Count; i++) { menuID = NDConvert.ToInt64(Dt.Rows[i]["MenuID"].ToString()); if ((RightQuery.GetUserRightQuery(UserID, menuID) || SessionState.IsAdmin) || MenuType == CommonEnum.MenuType.Outer) { tr1 = new HtmlTableRow(); tr2 = new HtmlTableRow(); tcMenuTitle1 = new HtmlTableCell(); tcMenuTitle1.Height = "24px"; tcMenuTitle1.Width = "167px"; tcMenuTitle1.Style["background"] = "url(../../images/bg_menu2_bg.jpg)"; tcMenuTitle1.Style["cursor"] = "hard"; tcMenuTitle1.InnerHtml = " " + Dt.Rows[i]["MenuName"].ToString(); tcMenuTitle1.Attributes["class"] = "Font4"; tcMenuTitle2 = new HtmlTableCell(); tcMenuTitle2.ID = "tdTitle" + i; tcMenuTitle2.Height = "24px"; tcMenuTitle2.Width = "13px"; tcMenuTitle2.Attributes["background"] = "../../images/bg_menu2_down.gif"; //二级菜单 DtLayer1 = new MenuQuery().GetMenuAll(menuID, MenuType); tcMenuList = new HtmlTableCell(); tcMenuList.ColSpan = 2; tcMenuList.ID = "MenuList" + Count; tcMenuList.Style["display"] = "none"; tr1.Attributes["onclick"] = "ControlLeftMenuItem('" + tcMenuTitle2.ID + "','" + tcMenuList.ID + "')"; tr1.Style["cursor"] = "hand"; Count++; if (DtLayer1.Rows.Count > 0) { HtmlTable tb1 = new HtmlTable(); tb1.CellPadding = 0; tb1.CellSpacing = 0; tb1.Style["margin-left"] = "12px"; HtmlTableRow tr11 = null; HtmlTableRow tr12 = null; HtmlTableCell td11 = null; HtmlTableCell td11img = null; for (int j = 0; j < DtLayer1.Rows.Count; j++) { menuID = NDConvert.ToInt64(DtLayer1.Rows[j]["MenuID"].ToString()); if ((RightQuery.GetUserRightQuery(UserID, menuID) || SessionState.IsAdmin) || MenuType == CommonEnum.MenuType.Outer) { Url = DtLayer1.Rows[j]["NavigateURL"].ToString(); MenuName = DtLayer1.Rows[j]["MenuName"].ToString().Trim(); tr11 = new HtmlTableRow(); tr12 = new HtmlTableRow(); td11img = new HtmlTableCell(); td11img.Width = "25px"; td11img.Align = "right"; td11img.VAlign = "top"; td11img.InnerHtml = "<img src = '" + DtLayer1.Rows[j]["ImageURL"].ToString().Trim() + "' />"; td11 = new HtmlTableCell(); td11.ID = "menuItem" + i.ToString() + j.ToString(); td11.Width = "140px"; td11.Height = "20px"; td11.Attributes["onclick"] = "mainFrameUrl('" + Url + "');SelectedItemColor(this);"; td11.Attributes["onmousemove"] = "linkMouseOver(this)"; td11.Attributes["onmouseout"] = "linkMouseOut(this)"; td11.Style["font-size"] = "12px"; td11.Style["cursor"] = "hand"; td11.InnerHtml = "<div class='hideText' style='height:22px; width:140px; margin-left:5px;'>" + MenuName + "</div>"; tcMenuTitle2.Attributes["background"] = "../../images/bg_menu2_up.gif"; if (Count == 1) { tcMenuList.Style["display"] = "block"; } else { tcMenuList.Style["display"] = "none"; } //组合二级菜单 tr11.Cells.Add(td11img); tr11.Cells.Add(td11); tb1.Rows.Add(tr11); tb1.Rows.Add(tr12); tb1.Rows.Add(Line()); tcMenuList.Controls.Add(tb1); } } if (tb1.Rows.Count > 0) { tb1.Rows.Insert(0, Line()); } } //组合一级菜单 tr1.Cells.Add(tcMenuTitle1); tr1.Cells.Add(tcMenuTitle2); tr2.Cells.Add(tcMenuList); tb.Rows.Add(tr1); tb.Rows.Add(tr2); } } this.Controls.Add(tb); } catch (Exception ex) { PageHelper.ShowExceptionMessage(ex.Message); } }
/// <summary> /// 获取所有符合查询条件的数据 /// </summary> /// <param name="menuQuery">MenuQuery查询实体对象</param> /// <returns>List<MenuEntity></returns> public List <MenuEntity> GetMenuList(MenuQuery menuQuery) { return(MenuBusProvider.GetMenuList(menuQuery)); }
/// <summary> /// 人员下拉框 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void drpPersonList_SelectedIndexChanged(object sender, EventArgs e) { //将所有选中的节点清空 Node node = null; ArrayList arrNode = tvRight.CheckedNodes; for (int n = 0; n < arrNode.Count; n++) { node = (Node)arrNode[n]; node.Checked = false; } //选中用户有权限的菜单节点 if (drpPersonList.SelectedIndex != 0) { long UserID = NDConvert.ToInt64(drpPersonList.SelectedValue); DataTable dt = new RightQuery().GetUserRight(UserID); //获得用户所有有权限的菜单 for (int i = 0; i < dt.Rows.Count; i++) { long MenuID = NDConvert.ToInt64(dt.Rows[i]["MenuID"].ToString()); for (int j = 0; j < tvRight.Nodes.Count; j++) { if (MenuID == NDConvert.ToInt64(tvRight.Nodes[j].DataKey)) { tvRight.Nodes[j].Checked = true; } for (int k = 0; k < tvRight.Nodes[j].Nodes.Count; k++) { if (MenuID == NDConvert.ToInt64(tvRight.Nodes[j].Nodes[k].DataKey)) { tvRight.Nodes[j].Nodes[k].Checked = true; } if (MenuQuery.IsHaveChileMenu(NDConvert.ToInt64(tvRight.Nodes[j].Nodes[k].DataKey.ToString()))) //判断是否有子菜单,如有有子菜单说明本层是菜单,如果没有则是菜单功能项 { for (int m = 0; m < tvRight.Nodes[j].Nodes[k].Nodes.Count; m++) { if (MenuID == NDConvert.ToInt64(tvRight.Nodes[j].Nodes[k].Nodes[m].DataKey)) { tvRight.Nodes[j].Nodes[k].Nodes[m].Checked = true; } Nodes nodes = tvRight.Nodes[j].Nodes[k].Nodes[m].Nodes; for (int n = 0; n < nodes.Count; n++) { if (MenuFunctionRightQuery.CheckMenuFunctionRight(UserID, MenuID, NDConvert.ToInt64(nodes[n].DataKey))) { nodes[n].Checked = true; } } } } else { Nodes nodes = tvRight.Nodes[j].Nodes[k].Nodes; for (int n = 0; n < nodes.Count; n++) { if (MenuFunctionRightQuery.CheckMenuFunctionRight(UserID, MenuID, NDConvert.ToInt64(nodes[n].DataKey))) { nodes[n].Checked = true; } } } } } } } }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="menuQuery">MenuQuery查询实体对象</param> /// <returns>Pager<MenuEntity></returns> public Pager <MenuEntity> GetMenuPageList(MenuQuery menuQuery) { return(MenuDataAccess.Instance.GetMenuPageList(menuQuery)); }
/// <summary> /// 分页获取符合查询条件的数据 /// </summary> /// <param name="menuQuery">MenuQuery查询实体对象</param> /// <returns>Pager<MenuEntity></returns> public Pager <MenuEntity> GetMenuPageList(MenuQuery menuQuery) { return(MenuBusProvider.GetMenuPageList(menuQuery)); }
public MenuEntryDataProvider(GlobalSolusindoDb db, tblM_User user, AccessControl accessControl, MenuQuery menuQuery) : base(db, user) { this.accessControl = accessControl; this.menuQuery = menuQuery; }
/// <summary> /// 邦定列表 /// </summary> private void BindTreeView() { //if (drpOUList.SelectedIndex == 0) //{ // return; //} DataTable dt1 = null; DataTable dt2 = null; DataTable dt3 = null; DataTable dt4 = null; Infragistics.WebUI.UltraWebNavigator.Node tn1; Infragistics.WebUI.UltraWebNavigator.Node tn2; Infragistics.WebUI.UltraWebNavigator.Node tn3; Infragistics.WebUI.UltraWebNavigator.Node tn4; tvRight.ClearAll(); //dt1 = new MenuQuery().GetMenuAll2(0); dt1 = new MenuQuery().GetMenuAll(0, CommonEnum.MenuType.Inner); for (int i = 0; i < dt1.Rows.Count; i++) { tn1 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn1.Text = dt1.Rows[i]["MenuName"].ToString(); tn1.DataKey = dt1.Rows[i]["MenuID"].ToString(); tn1.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; //dt2 = new MenuQuery().GetMenuAll2(NDConvert.ToInt64(tn1.DataKey.ToString())); dt2 = new MenuQuery().GetMenuAll(NDConvert.ToInt64(tn1.DataKey.ToString()), CommonEnum.MenuType.Inner); for (int j = 0; j < dt2.Rows.Count; j++) { tn2 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn2.Text = dt2.Rows[j]["MenuName"].ToString(); tn2.DataKey = dt2.Rows[j]["MenuID"].ToString(); tn2.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; tn1.Nodes.Add(tn2); //dt3 = new MenuQuery().GetMenuAll2(NDConvert.ToInt64(tn2.DataKey.ToString())); dt3 = new MenuQuery().GetMenuAll(NDConvert.ToInt64(tn2.DataKey.ToString()), CommonEnum.MenuType.Inner); if (dt3.Rows.Count > 0) { for (int k = 0; k < dt3.Rows.Count; k++) { tn3 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn3.Text = dt3.Rows[k]["MenuName"].ToString(); tn3.DataKey = dt3.Rows[k]["MenuID"].ToString(); tn3.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; tn2.Nodes.Add(tn3); dt4 = new MenuFunctionQuery().GetMenuFunction(NDConvert.ToInt64(tn3.DataKey.ToString())); for (int m = 0; m < dt4.Rows.Count; m++) { tn4 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn4.Text = dt4.Rows[m]["FName"].ToString(); tn4.DataKey = dt4.Rows[m]["FID"].ToString(); tn4.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; tn3.Nodes.Add(tn4); } } } else { dt4 = new MenuFunctionQuery().GetMenuFunction(NDConvert.ToInt64(tn2.DataKey.ToString())); for (int m = 0; m < dt4.Rows.Count; m++) { tn4 = new Infragistics.WebUI.UltraWebNavigator.Node(); tn4.Text = dt4.Rows[m]["FName"].ToString(); tn4.DataKey = dt4.Rows[m]["FID"].ToString(); tn4.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; tn2.Nodes.Add(tn4); } } } tvRight.Nodes.Add(tn1); } tvRight.ExpandAll(); }