示例#1
0
        public ActionResult Index()
        {
            var account    = UserProfileController.LoginUser(User.Identity.GetUserId());
            var permission = UserProfileController.GetUserPermission(account);
            var viewModel  = new DashboardViewModel
            {
                Account    = account,
                Permission = permission
            };

            return(View(viewModel));
        }
示例#2
0
        // GET: Settings
        public ActionResult Index()
        {
            var datas   = _context.MasterDatas.ToList();
            var details = _context.MasterDetails.ToList();

            var currentAccount = UserProfileController.LoginUser(User.Identity.GetUserId());
            var pernission     = UserProfileController.GetUserPermission(currentAccount);

            var viewModel = new SettingsViewModel
            {
                MasterDatas   = datas,
                MasterDetails = details,
                Account       = currentAccount,
                Permission    = pernission
            };

            return(View("Index2", viewModel));
        }
        // GET: Permission
        public ActionResult Index()
        {
            var roles         = _context.Roles.ToList();
            var permissions   = _context.Permissions.ToList();
            var masterDetails = _context.MasterDetails.ToList();

            var account    = UserProfileController.LoginUser(User.Identity.GetUserId());
            var permission = UserProfileController.GetUserPermission(account);

            var viewModel = new UserPermissionViewModel
            {
                Permissions   = permissions,
                Roles         = roles,
                MasterDetails = masterDetails,
                Account       = account,
                Permission    = permission
            };

            return(View(viewModel));
        }
示例#4
0
        public ActionResult AuditTrail()
        {
            var audits  = _context.AuditTrails.ToList();
            var profile = _context.Users.Include(p => p.UserProfile).ToList();
            var modules = _context.MasterDetails.Include(m => m.MasterData).Where(m => m.MasterData.Name == "Modules").ToList();

            var currentUser           = UserProfileController.LoginUser(User.Identity.GetUserId());
            var currentUserPermission = UserProfileController.GetUserPermission(currentUser);

            var reportView = new ReportViewModel
            {
                AuditTrails  = audits,
                UserProfiles = profile,
                Account      = currentUser,
                Permission   = currentUserPermission,
                Modules      = modules
            };

            return(View(reportView));
        }