Exemplo n.º 1
0
        public async Task <ActionResult> EditMeunOper(int menuOperId)
        {
            Sys_MenuOper model = new Sys_MenuOper();

            if (menuOperId > 0)
            {
                model = await menuOperRepo.GetModelAsync(menuOperId);

                var menu = await menuRepo.GetMenuAsync(model.MenuId);//根据menuID找到对应的菜单

                model.MenuParentID = menu.ParentId;
            }


            return(View(model));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> EditMenu(int mid)
        {
            using (Sys_MenuRepository rep = new Sys_MenuRepository())
            {
                var menu = new Sys_Menu();
                if (mid > 0)
                {
                    menu = await rep.GetMenuAsync(mid);
                }
                var list = await rep.GetListByParentIdAsync(0);

                var parentMenuList = new List <SelectListItem>()
                {
                    new SelectListItem()
                    {
                        Value = "0", Text = "无", Selected = true
                    }
                };
                var selectList = new SelectList(list, "MenuId", "MenuName");
                parentMenuList.AddRange(selectList);
                ViewBag.parentMenuList = parentMenuList;
                return(View(menu));
            }
        }