예제 #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());
        }
예제 #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));
        }