namespace GB5Shared.Query.DrillDown { // Minimal, GB5Shared-native version of GB5Framework's // MenuQB.GET_MENU_FOR_REPORT_CONSIOLIDATED_DRILLDOWN_ARRAY — GB5Shared has no project reference // to GB5Framework (and must not gain one just for this), so this re-implements only the columns // an export-time link resolver actually needs, rather than reusing FrameworkBLL.IMenuBLL. // Role-filtered by RoleId directly from LoginDTO (the original query does the same check via an // extra MUSER join to translate UserId -> RoleId; skipped here since LoginDTO already has RoleId). public static class DrillDownExportQB { public const string GET_DRILLDOWN_TARGETS_FOR_MENU = @" SELECT a.TOMENUID AS ToMenuId, e.MENUDISPLAYNAME AS ToMenuDisplayName, e.MENUTYPE AS ToMenuType, e.MODULEID AS ToModuleId, md.SOURCEFIELD AS SourceField, md.ATTRIBUTEID AS AttributeId FROM MDRILLDOWN a JOIN MDRILLDOWNDETAIL md ON md.DRILLDOWNID = a.DRILLDOWNID JOIN MMENU e ON e.MENUID = a.TOMENUID JOIN MROLEVSMENU g ON g.MENUID = a.FROMMENUID WHERE a.FROMMENUID = @MenuId AND g.ROLEID = @RoleId AND g.ALLOW LIKE '%0%' AND md.SOURCEFIELD IS NOT NULL AND LTRIM(RTRIM(md.SOURCEFIELD)) <> ''"; } }