public SysNavigationCollection FetchAll() { SysNavigationCollection coll = new SysNavigationCollection(); Query qry = new Query(SysNavigation.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public static SysNavigation FindNavByUrl(SysNavigationCollection navs, string pUrl) { SysNavigation pNav = null; if (navs == null || navs.Count == 0) goto lable_end; int subSysID = 0; foreach (SysNavigation nav in navs) { subSysID = Convert.ToInt32(nav.SubSysId); if (Utilities.Compare(nav.NavUrl, pUrl)) { pNav = nav; goto lable_end; } } lable_end: return pNav; }
public SysNavigationCollection FetchByQuery(Query qry) { SysNavigationCollection coll = new SysNavigationCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public SysNavigationCollection FetchByID(object Id) { SysNavigationCollection coll = new SysNavigationCollection().Where("ID", Id).Load(); return coll; }
private static void RemoveExistDefine(SysNavigationCollection navs, List<NavigationDefineAttribute> navDefines) { foreach (SysNavigation nav in navs) { NavigationDefineAttribute att = navDefines.Find((NavigationDefineAttribute match) => { return nav.NavUrl.Contains(match.NavUrl); }); if (att != null) navDefines.Remove(att); } }
private static void RefreshNavCore(ref List<NavigationDefineAttribute> navDefines, ref SysNavigationCollection navs, NavigationDefineAttribute navDefine, SysNavigation nav) { string navUrl = navDefine == null ? string.Empty : navDefine.NavUrl; List<NavigationDefineAttribute> partNavDefines = FindNavDefinesByUrl(ref navDefines, navUrl); if (partNavDefines.Count == 0 && navDefine == null && nav == null) { partNavDefines = navDefines; } foreach (NavigationDefineAttribute partNav in partNavDefines) { //not exist item and new item to navs SysNavigation cNav = FindNavByUrl(navs, partNav.NavUrl); if (cNav == null) { SysNavigation pNav = FindNavByUrl(navs, partNav.P_NavUrl); cNav = AddNewNavigation(partNav, pNav == null ? nav : pNav); AutoRoleAssignement(cNav); //? navs.Add(cNav); } RefreshNavCore(ref navDefines, ref navs, partNav, cNav); } }