public ActionResult _Menu() { string urlParams = WPS.decryptURL.decryptURLstring(Request.QueryString["q"].ToString()); string[] arrQryStr = urlParams.Split('?'); int User = Convert.ToInt16(arrQryStr[0].Split('=')[1].ToString()); int OrgId = arrQryStr[1].Split('=')[1].ToString() == "" ? 0 : Convert.ToInt16(arrQryStr[1].Split('=')[1].ToString()); int CompanyId = arrQryStr[2].Split('=')[1].ToString() == "" ? 0 : Convert.ToInt16(arrQryStr[2].Split('=')[1].ToString()); int[] UserAccessTypeIds = new int[1]; UserAccessTypeIds[0] = dbUser.GetUserById(User).UserTypeId.Value; //dbUser.getUserAccessByUserID(User).Select(x => x.UserTypeId).ToList();// var UserAccess = dbUser.getAccessByUserTypeByAssignedUserTypes(UserAccessTypeIds.ToArray()); // db.HRMS_Access_ST.Where(x => UserAccessTypeIds.Contains(x.HRMS_UserType_ST.UserTypeId)).Select(x => x.aspnet_Roles.RoleName).ToList(); var roles = UserAccess.Select(x => x.RoleId.ToString()).ToList(); var roleName = dbUser.getRolesbyRoleId(roles.ToArray()).Select(x => x.RoleName).ToList(); var Menu = dbUser.getMenuList(); Menu = Menu.Where(x => roleName.Contains(x.RoleName)).ToList(); //Menu = Menu.ToList(); return(View(Menu)); }
public ActionResult MenuIndex() { var reqMenuList = dbUser.getMenuList(); return(View(reqMenuList)); }