Пример #1
0
        // GET: /EmployeeSalary/
        public ActionResult Index()
        {
            var url = Request.RawUrl;

            permission = (RoleSubModuleItem)cacheProvider.Get(cacheKey);
            if (permission == null)
            {
                permission = roleSubModuleItemService.GetRoleSubModuleItemBySubModuleIdandRole(url, Helpers.UserSession.GetUserFromSession().RoleId);
            }

            if (permission != null)
            {
                if (permission.ReadOperation == true)
                {
                    cacheProvider.Set(cacheKey, permission, 240);
                    if (UserSession.IsSchoolUser())
                    {
                        ViewBag.SchoolId = UserSession.GetCurrentUserSchool();
                        return(View("EmployeeSalary"));
                    }
                    else
                    {
                        return(View("EmployeeSalary2"));
                    }
                }
                else
                {
                    return(View("~/Views/Shared/NoPermission.cshtml"));
                }
            }
            return(View("~/Views/Shared/NoPermission.cshtml"));
        }
Пример #2
0
        // GET: /DayType/
        public ActionResult Index()
        {
            const string url = "/DayType/Index";

            permission = (RoleSubModuleItem)cacheProvider.Get(cacheKey) ??
                         roleSubModuleItemService.GetRoleSubModuleItemBySubModuleIdandRole(url, Helpers.UserSession.GetUserFromSession().RoleId);

            if (permission != null)
            {
                if (permission.ReadOperation == true)
                {
                    cacheProvider.Set(cacheKey, permission, 240);
                    return(View("DayType"));
                }
                else
                {
                    return(View("~/Views/Shared/NoPermission.cshtml"));
                }
            }

            return(View("~/Views/Shared/NoPermission.cshtml"));
        }
Пример #3
0
        // GET: /Institute/
        public ActionResult Index()
        {
            var url = Request.RawUrl;

            permission = (RoleSubModuleItem)cacheProvider.Get(cacheKey);
            if (permission == null)
            {
                permission = roleSubModuleItemService.GetRoleSubModuleItemBySubModuleIdandRole(url, Helpers.UserSession.GetUserFromSession().RoleId);
            }

            if (permission != null)
            {
                if (permission.ReadOperation == true)
                {
                    cacheProvider.Set(cacheKey, permission, 240);
                    return(View("Institute"));
                }
                else
                {
                    return(View("~/Views/Shared/NoPermission.cshtml"));
                }
            }
            return(View("~/Views/Shared/NoPermission.cshtml"));
        }