Exemplo n.º 1
0
        public ActionResult DesktopSet()
        {
            if (CurrentUser.UserName == WeConfig.robot)
            {
                ViewBag.MenuRights = BaseMain.GetEntitysAll();
            }
            else
            {
                ViewBag.MenuRights = B_UserDesktopAuth.GetUserDesktopAuth(CurrentUser.RoleID, CurrentUser.UserName);
            }

            List <B_UserDesktopAuth> roRightsList = B_UserDesktopAuth.GetEntitysMainRoleID(CurrentUser.RoleID, CurrentUser.UserName);
            HashSet <int>            setRights    = new HashSet <int>();

            foreach (B_UserDesktopAuth roRights in roRightsList)
            {
                setRights.Add(roRights.MainID);
            }

            ViewBag.HashRights     = setRights;
            ViewData["UserName"]   = CurrentUser.UserName;
            ViewData["C_UserName"] = WeConfig.robot;

            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            //B_UserRoles BU = B_UserRoles.GetByUserName(CurrentUser.UserName);
            //if (CurrentUser.UserName != WeConfig.robot)
            //{
            //    ViewData["BR"] = B_Role.GetEntityByID(BU.RoleID);
            //}

            List <BaseMain> List = B_UserDesktopAuth.GetEntitysMainUserNames(CurrentUser.UserName);
            string          bm   = "";

            for (int i = 0; i < List.Count; i++)
            {
                bm = bm + List[i].MainID + ",";
            }

            List <BaseMain> Listbase = BaseMain.GetEntitysAll();
            string          BB       = "";

            for (int i = 0; i < Listbase.Count; i++)
            {
                BB = BB + Listbase[i].MainID + ",";
            }

            ViewData["BM"]   = bm;
            ViewData["Z_BM"] = BB;

            ViewData["UserName"]   = CurrentUser.UserName;
            ViewData["T_UserName"] = WeConfig.robot;
            ViewData["dj"]         = CurrentUser.ID;
            MainShow main = Scale.GetScaleCount();

            return(View(main));
        }
Exemplo n.º 3
0
        public ActionResult B_RoleMin(int id)
        {
            B_Role dbBORoles = B_Role.GetEntityByID(id);

            if (dbBORoles == null)
            {
                return(View(ErrorPage.ViewName, new ErrorPage {
                    Message = "分配角色权限失败,角色不存在或已删除!"
                }));
            }

            List <B_UserDesktopAuth> roRightsList = B_UserDesktopAuth.GetEntitysMainRoleID(id, CurrentUser.UserName);
            HashSet <int>            setRights    = new HashSet <int>();

            foreach (B_UserDesktopAuth roRights in roRightsList)
            {
                setRights.Add(roRights.MainID);
            }

            ViewBag.MenuRights = B_UserDesktopAuth.GetRolesDesktopAuth(id);

            ViewBag.HashRights     = setRights;
            ViewBag.dbBORoles      = dbBORoles;
            ViewData["UserName"]   = CurrentUser.UserName;
            ViewData["C_UserName"] = WeConfig.robot;
            return(View());
        }
Exemplo n.º 4
0
 public ActionResult Close(string TextID)
 {
     if (CurrentUser.UserName != WeConfig.robot)
     {
         BaseMain BM = B_UserDesktopAuth.GetEntitysByStringMainID(TextID);
         if (B_UserDesktopAuth.RemoveUserDesktopAuth(BM.ID, CurrentUser.UserName))
         {
             return(Content("ok"));
         }
         else
         {
             return(Content("隐藏失败!"));
         }
     }
     return(Content("隐藏失败!"));
 }