Ejemplo n.º 1
0
        public void GetUserMenu()
        {
            ISysMenuBLL        target = new SysMenuBLLImpl();
            ISysUserBLL        helper = new SysUserBLLImpl();
            Response <SysMenu> result = target.GetMenuByUserPower(helper.GetPowerByID(1).list);

            Assert.IsNotNull(result.list, "get menu error");
            Assert.AreEqual(33, result.list.Count);
        }
Ejemplo n.º 2
0
        private void SetInSession(SysUser user)
        {
            ISysMenuBLL         menuBLL = new SysMenuBLLImpl();
            ISysUserBLL         userBLL = new SysUserBLLImpl();
            Response <SysPower> res     = userBLL.GetPowerByID(user.Id);

            if (!res.isSuccess)
            {
                return;
            }
            Response <SysMenu> resMenu = menuBLL.GetMenuByUserPower(res.list);

            if (!resMenu.isSuccess)
            {
                return;
            }
            Session["currentMenu"] = resMenu.list;
            Session["UserName"]    = user.TrueName + "(" + user.IdCard + ")";
        }