private int GetTopMenuRefID(string asUrl) { Biz_lib_MenuControl biz = new Biz_lib_MenuControl(); int iTopMenuID = 0; DataSet dsAuthMenu = biz.GetAuthMenuInclude_N(gUserInfo.Emp_Ref_ID.ToString()); DataRow[] draRow; draRow = dsAuthMenu.Tables[0].Select( "(MENU_FULL_PATH = '" + asUrl.ToUpper() + "') OR ( MENU_DIR + MENU_PAGE_NAME = '" + asUrl.ToUpper() + "' AND MENU_TYPE = 'N')" ); //쿼리스트링을 포함한 경로가 메뉴에 없을경우 페이지명으로만 다시 검색 if (draRow.Length == 0 && Request.Url.Query.Length > 0) { draRow = dsAuthMenu.Tables[0].Select( "( MENU_DIR + MENU_PAGE_NAME = '" + Request.Url.AbsolutePath.Replace(Request.Url.Query, "") + "' )" ); } foreach (DataRow dbRow in draRow) { SearchTopMenuID(dsAuthMenu, dbRow, out iTopMenuID); } return(iTopMenuID); }
/// <summary> /// GetTopMenuRefID /// : 현재페이지를 기초로 TOP_MENU_REF_ID를 리턴한다. /// : 재귀호출로 처리 /// </summary> /// <param name="asUrl"></param> /// <returns></returns> private int GetTopMenuRefID(string asUrl) { Biz_lib_MenuControl biz = new Biz_lib_MenuControl(); int iTopMenuID = 0; DataSet dsAuthMenu = biz.GetAuthMenuInclude_N(gUserInfo.Emp_Ref_ID.ToString()); DataRow[] draRow; draRow = dsAuthMenu.Tables[0].Select( "(MENU_FULL_PATH = '" + asUrl.ToUpper() + "') OR ( MENU_DIR + MENU_PAGE_NAME = '" + asUrl.ToUpper() + "' AND MENU_TYPE = 'N')" ); foreach (DataRow dbRow in draRow) { SearchTopMenuID(dsAuthMenu, dbRow, out iTopMenuID); } return(iTopMenuID); }
/// <summary> /// GetTopMenuRefID /// : 현재페이지를 기초로 TOP_MENU_REF_ID를 리턴한다. /// : 재귀호출로 처리 /// </summary> /// <param name="asUrl"></param> /// <returns></returns> private int GetTopMenuRefID(string asUrl) { Biz_lib_MenuControl biz = new Biz_lib_MenuControl(); int iTopMenuID = 0; DataSet dsAuthMenu = biz.GetAuthMenuInclude_N(gUserInfo.Emp_Ref_ID.ToString()); DataRow[] draRow; draRow = dsAuthMenu.Tables[0].Select( "( MENU_FULL_PATH = '" + asUrl.ToUpper() + "' ) OR ( MENU_DIR + MENU_PAGE_NAME = '" + asUrl.ToUpper() + "' AND MENU_TYPE = 'N' )" ); if (draRow.Length == 0) { draRow = dsAuthMenu.Tables[0].Select( "( MENU_DIR + MENU_PAGE_NAME = '" + Request.Url.AbsoluteUri.ToUpper() + "' )" ); } foreach (DataRow dbRow in draRow) { SearchTopMenuID(dsAuthMenu, dbRow, out iTopMenuID); } // 만약 해당메뉴가 없다면 DB에서 바로 불러옴 // usr10001.aspx 인 경우에 해당 dsAuthMenu에 없음 if (iTopMenuID == 0) { Biz_MenuInfo biz_menuinfo = new Biz_MenuInfo(); iTopMenuID = biz_menuinfo.GetUpMenuIDByMenuFullPath(asUrl); } return(iTopMenuID); }