public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            str = new StringBuilder();
            var model = (BaseModel)filterContext.Controller.ViewData.Model;

            if (model != null)
            {
                BALCommon CSvc = new BALCommon(ConStr);
                #region Get All Permitted Menu List
                SessionInfo _SessionInfo     = CSvc.GetSessionDetails(WebSecurity.CurrentUserName, DateTime.Now);
                int         _OrgnisationID   = Convert.ToInt32(_SessionInfo.SchoolID);
                int         _Financialyearid = Convert.ToInt32(_SessionInfo.FinancialYearID);


                var ALLMENUPERMISSION = CSvc.GetAllMenuListByUserId(WebSecurity.CurrentUserId, _OrgnisationID);
                var USERINFO          = CSvc.GetUserInfoByuserId(WebSecurity.CurrentUserId, _OrgnisationID);
                #endregion Get All Permitted Menu List
                menulist = ALLMENUPERMISSION;
                string     absolutePath = HttpContext.Current.Request.Url.AbsolutePath;
                MenuMaster reqMenu      = (from s in menulist
                                           where s.URL.ToLower() == absolutePath.ToLower()
                                           select s).FirstOrDefault();
                model.PermissionNameList = new List <string>();
                model.PermissionNameList.Add("Default");// its only for null checking
                if (reqMenu != null && reqMenu.PermissionNameList != null)
                {
                    model.PermissionNameList = reqMenu.PermissionNameList;
                }
                model.BaseSessionInfo = _SessionInfo;
                model.BaseUserInfo    = USERINFO;
                model.usermenu        = GetUserMenuList(menulist);
            }
        }
Esempio n. 2
0
        public List <MenuMaster> GetAllMenuListByUserId(int userId)
        {
            BALCommon bal = new BALCommon(ConStr);

            return(bal.GetAllMenuListByUserId(userId));
        }