private void Refresh(bool rmodule, bool rmenu, bool rmenudtl, bool rrole, bool ruser) { if (rmodule) { ModuleList.Clear(); ModuleList.AddRange(PubMaster.Mod.RoleSql.QueryWcsModuleList()); } if (rmenu) { MenuList.Clear(); MenuList.AddRange(PubMaster.Mod.RoleSql.QueryWcsMenuList()); } if (rmenudtl) { MenuDtlList.Clear(); MenuDtlList.AddRange(PubMaster.Mod.RoleSql.QueryWcsMenuDtlList()); } if (rrole) { RoleList.Clear(); RoleList.AddRange(PubMaster.Mod.RoleSql.QueryWcsRoleList()); } if (ruser) { UserList.Clear(); UserList.AddRange(PubMaster.Mod.RoleSql.QueryWcsUserList()); } }
private void InitModules() { ModuleList.Clear(); AddedModuleList.Clear(); if (SelectedApplication != null) { List <DynEntity> allModules = ApplicationDesignService.GetAllApplictionModuleCollection(); List <DynEntity> currentApplicationModules = ApplicationDesignService.GetAplicationModulesByAplicationID(SelectedApplication.ApplicationID); foreach (var module in allModules) { bool isHave = false; foreach (var addedModule in currentApplicationModules) { if (Convert.Equals(addedModule["ModuleID"], module["ModuleID"])) { AddedModuleList.Add(new ApplicationModule() { ModuleName = module["ModuleName"] as string, ModuleID = (int)module["ModuleID"] }); isHave = true; break; } } if (!isHave) { ModuleList.Add(new ApplicationModule() { ModuleName = module["ModuleName"] as string, ModuleID = (int)module["ModuleID"] }); } } } }
/// <summary> /// Disposes of the ModuleHandler /// </summary> public void Dispose() { _dataModule = null; catalog.Dispose(); catalog = null; ModuleList.Clear(); ModuleList = null; }