Exemplo n.º 1
0
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <returns></returns>
        public ActionResult TypeConfiguration()
        {
            int roleId = helpcommon.ParmPerportys.GetNumParms(userInfo.User.personaId);
            int menuId = helpcommon.ParmPerportys.GetNumParms(Request.QueryString["menuId"]);

            ViewData["myMenuId"] = menuId;
            PublicHelpController ph = new PublicHelpController();

            if (userInfo.User.userName == "sa")
            {
                funName f = new funName();
                System.Reflection.MemberInfo[] properties = f.GetType().GetMembers();
                foreach (System.Reflection.MemberInfo item in properties)
                {
                    string value = item.Name;
                    ViewData[value] = 1;
                }
            }
            SvaeMenuId = menuId;
            if (!ph.isFunPermisson(roleId, menuId, funName.selectName))
            {
                return(View("../NoPermisson/Index"));
            }
            ViewData["RoleId"] = userInfo.User.personaId.ToString();
            return(View());
        }
        public ActionResult BrandOpenProduct()
        {
            ProductStockBLL psb    = new ProductStockBLL();
            int             roleId = helpcommon.ParmPerportys.GetNumParms(userInfo.User.personaId);
            int             menuId = helpcommon.ParmPerportys.GetNumParms(Request.QueryString["menuId"]);

            ViewData["myMenuId"] = menuId;
            PublicHelpController ph = new PublicHelpController();

            if (userInfo.User.userName == "sa")
            {
                funName f = new funName();
                System.Reflection.MemberInfo[] properties = f.GetType().GetMembers();
                foreach (System.Reflection.MemberInfo item in properties)
                {
                    string value = item.Name;
                    ViewData[value] = 1;
                }
            }
            BrandOpenProductSaveMenuId = menuId;
            if (!ph.isFunPermisson(roleId, menuId, funName.selectName))
            {
                return(View("../NoPermisson/Index"));
            }
            ProductHelper php = new ProductHelper();

            ViewData["Vencode"] = php.GetVencodeDDlist();
            return(View());
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取字段列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult allotFiledPermisson(int id, int roleId, int menuId, int funId)
        {
            ViewData["id"]     = id;
            ViewData["roleId"] = roleId;
            ViewData["menuId"] = menuId;
            ViewData["funId"]  = funId;

            PublicHelpController ph = new PublicHelpController();

            if (userInfo.User.userName == "sa")
            {
                funName f = new funName();
                System.Reflection.MemberInfo[] properties = f.GetType().GetMembers();
                foreach (System.Reflection.MemberInfo item in properties)
                {
                    string value = item.Name;
                    ViewData[value] = 1;
                }
            }
            else
            {
                #region 分配权限
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.fieldFPQX))
                {
                    ViewData["fieldFPQX"] = 0;//无分配权限
                }
                else
                {
                    ViewData["fieldFPQX"] = 1;//有分配权限
                }
                #endregion

                #region 查询
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.fieldCKQX))
                {
                    List <model.persona> myList = new List <model.persona>();
                    return(View("../NoPermisson/Index"));
                }
                #endregion
            }
            string filed = getFiledId(roleId, menuId, funId);
            ViewData["filedIds"] = filed;


            bll.tableFiledPerssionbll tableFiledPerssionBll = new bll.tableFiledPerssionbll();
            IDataParameter[]          ipara = new IDataParameter[] {
                new SqlParameter("tableLevel", SqlDbType.NVarChar, 20)
            };
            ipara[0].Value = id;

            List <model.tableFiledPerssion> list = tableFiledPerssionBll.getTable(ipara, "filedSelect");

            return(View(list));
        }
        /// <summary>
        /// 判断权限
        /// </summary>
        /// <returns></returns>
        public ActionResult getUsers()
        {
            try
            {
                int roleId = helpcommon.ParmPerportys.GetNumParms(userInfo.User.personaId);
                int menuId = Request.QueryString["menuId"] != null?helpcommon.ParmPerportys.GetNumParms(Request.QueryString["menuId"]) : 0;

                int id = helpcommon.ParmPerportys.GetNumParms(Request.Url.LocalPath.Replace("/Users/getUsers/", "").ToString());
                PublicHelpController ph = new PublicHelpController();

                #region
                if (userInfo.User.userName == "sa")
                {
                    funName f = new funName();
                    System.Reflection.MemberInfo[] properties = f.GetType().GetMembers();
                    foreach (System.Reflection.MemberInfo item in properties)
                    {
                        string value = item.Name;
                        ViewData[value] = 1;
                    }
                }
                else
                {
                    #region 查询
                    if (!ph.isFunPermisson(roleId, menuId, funName.selectName))
                    {
                        return(View("../NoPermisson/Index"));
                    }
                    #endregion
                }

                #endregion
                ViewData["id"]       = id;
                ViewData["myMenuId"] = menuId;

                return(View());
            }
            catch
            {
                return(View("../ErrorMsg/Index"));
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取角色列表
        /// </summary>
        /// <returns></returns>
        public ActionResult getRole()
        {
            #region
            int menuId = helpcommon.ParmPerportys.GetNumParms(Request.QueryString["menuId"]);
            PublicHelpController ph = new PublicHelpController();
            ViewData["menuId"] = menuId;

            if (userInfo.User.userName == "sa")
            {
                funName f = new funName();
                System.Reflection.MemberInfo[] properties = f.GetType().GetMembers();
                foreach (System.Reflection.MemberInfo item in properties)
                {
                    string value = item.Name;
                    ViewData[value] = 1;
                }
            }
            else
            {
                #region 添加(1有权限,0无权限)
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.addName))
                {
                    ViewData["addName"] = 0;//无添加权限
                }
                else
                {
                    ViewData["addName"] = 1;//有添加权限
                }
                #endregion

                #region 编辑(1有权限,0无权限)
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.updateName))
                {
                    ViewData["updateName"] = 0;//无编辑权限
                }
                else
                {
                    ViewData["updateName"] = 1;//有编辑权限
                }
                #endregion

                #region 菜单分配权限(1有权限,0无权限)
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.menuList))
                {
                    ViewData["menuList"] = 0;//无菜单分配权限
                }
                else
                {
                    ViewData["menuList"] = 1;//有菜单分配权限
                }
                #endregion

                #region 用户管理(1有权限,0无权限)
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.userList))
                {
                    ViewData["userList"] = 0;//无用户管理权限
                }
                else
                {
                    ViewData["userList"] = 1;//有用户管理权限
                }
                #endregion

                #region 查询
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.selectName))
                {
                    List <model.persona> myList = new List <model.persona>();
                    return(View("../NoPermisson/Index"));
                }
                #endregion
            }
            #endregion


            bll.rolebll      roleBll = new bll.rolebll();
            IDataParameter[] ipara   = new IDataParameter[] {
                //new SqlParameter("menuName",SqlDbType.NVarChar,20)
            };
            //ipara[0].Value = "张三";
            List <model.persona> list = roleBll.getRole(ipara, "roleSelect");

            return(View(list));
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取菜单列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult allotMenuPermisson(int id)
        {
            ViewData["roleId"] = id;
            int menuId = helpcommon.ParmPerportys.GetNumParms(Request.QueryString["menuId"]);

            ViewData["menuId"] = menuId;
            PublicHelpController ph = new PublicHelpController();

            if (userInfo.User.userName == "sa")
            {
                funName f = new funName();
                System.Reflection.MemberInfo[] properties = f.GetType().GetMembers();
                foreach (System.Reflection.MemberInfo item in properties)
                {
                    string value = item.Name;
                    ViewData[value] = 1;
                }
            }
            else
            {
                #region 功能列表
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.funList))
                {
                    ViewData["funList"] = 0;//无功能列表权限
                }
                else
                {
                    ViewData["funList"] = 1;//有功能列表权限
                }
                #endregion

                #region 分配权限
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.menuFPQX))
                {
                    ViewData["menuFPQX"] = 0;//无分配权限
                }
                else
                {
                    ViewData["menuFPQX"] = 1;//有分配权限
                }
                #endregion

                #region 查询
                if (!ph.isFunPermisson(int.Parse(userInfo.User.personaId.ToString()), menuId, funName.menuCKQX))
                {
                    List <model.persona> myList = new List <model.persona>();
                    return(View("../NoPermisson/Index"));
                }
                #endregion
            }
            //string  menuIdC = getMenuId(helpcommon.ParmPerportys.GetNumParms(userInfo.User.personaId));
            string menuIdC = getMenuId(helpcommon.ParmPerportys.GetNumParms(id));
            ViewData["menuIdC"] = menuIdC;


            bll.menubll      menuBll = new bll.menubll();
            IDataParameter[] ipara   = new IDataParameter[] {
                //new SqlParameter("menuName",SqlDbType.NVarChar,20)
            };
            //ipara[0].Value = "张三";
            List <model.menu> list = menuBll.getMenu(ipara, "menuSelectAllC");

            return(View(list));
        }