private List <ControlPanelLocalizedMenuEntity> GetLocalizedMenuItems(string[] appIds, string languageCode) { ControlPanelLocalizedMenuQueryEntity queryEntity = new ControlPanelLocalizedMenuQueryEntity() { LanguageCode = languageCode, ApplicationIds = appIds, StatusCode = ((MenuStatus?)MenuStatus.Active).ToCharValue() }; List <ControlPanelLocalizedMenuEntity> menuItems = new ControlPanelMenuBiz().GetLocalizedMenuItems(queryEntity); return(menuItems); }
public List <ControlPanelLocalizedMenuEntity> GetLocalizedMenuItems(ControlPanelLocalizedMenuQueryEntity queryEntity) { CPDataContext ctx = new CPDataContext(OperationType.Query); var query = from menu in ctx.FN_ControlPanelMenuWithLocalizedRes(queryEntity.LanguageCode ?? String.Empty) where (queryEntity.ApplicationIds.Length > 0 ? queryEntity.ApplicationIds.Contains(menu.ApplicationId2) : true) && (queryEntity.StatusCode != null ? (menu.StatusCode == queryEntity.StatusCode) : true) orderby menu.SortIndex descending, menu.MenuId ascending select menu; List <ControlPanelLocalizedMenuEntity> result = query.ToList(); return(result); }