public ModulePackageDetailDto(int portalId, PackageInfo package, DesktopModuleInfo desktopModule) : base(portalId, package)
        {
            DesktopModuleId    = desktopModule.DesktopModuleID;
            ModuleName         = desktopModule.ModuleName;
            FolderName         = desktopModule.FolderName;
            BusinessController = desktopModule.BusinessControllerClass;
            Category           = desktopModule.Category;
            Dependencies       = desktopModule.Dependencies;
            HostPermissions    = desktopModule.Permissions;
            Portable           = desktopModule.IsPortable;
            Searchable         = desktopModule.IsSearchable;
            Upgradeable        = desktopModule.IsUpgradeable;
            PremiumModule      = desktopModule.IsPremium;
            Shareable          = desktopModule.Shareable;

            if (!desktopModule.IsAdmin)
            {
                var portalDesktopModules =
                    DesktopModuleController.GetPortalDesktopModulesByDesktopModuleID(desktopModule.DesktopModuleID);
                foreach (var portalDesktopModuleInfo in portalDesktopModules)
                {
                    var value = portalDesktopModuleInfo.Value;
                    AssignedPortals.Add(new ListItemDto {
                        Id = value.PortalID, Name = value.PortalName
                    });
                }

                var assignedIds = AssignedPortals.Select(p => p.Id).ToArray();
                var allPortals  = PortalController.Instance.GetPortals().OfType <PortalInfo>().Where(p => !assignedIds.Contains(p.PortalID));

                foreach (var portalInfo in allPortals)
                {
                    UnassignedPortals.Add(new ListItemDto {
                        Id = portalInfo.PortalID, Name = portalInfo.PortalName
                    });
                }
            }

            foreach (var moduleDefinition in desktopModule.ModuleDefinitions.Values)
            {
                ModuleDefinitions.Add(new ModuleDefinitionDto(moduleDefinition));
            }
        }
예제 #2
0
        private void BindPortalDesktopModules()
        {
            if (!IsWizard && !DesktopModule.IsAdmin)
            {
                var arrPortals = PortalController.Instance.GetPortals();
                Dictionary <int, PortalDesktopModuleInfo> dicPortalDesktopModules = DesktopModuleController.GetPortalDesktopModulesByDesktopModuleID(DesktopModule.DesktopModuleID);
                foreach (PortalDesktopModuleInfo objPortalDesktopModule in dicPortalDesktopModules.Values)
                {
                    foreach (PortalInfo objPortal in arrPortals)
                    {
                        if (objPortal.PortalID == objPortalDesktopModule.PortalID)
                        {
                            arrPortals.Remove(objPortal);
                            break;
                        }
                    }
                }

                ctlPortals.AvailableDataSource = arrPortals;
                ctlPortals.SelectedDataSource  = dicPortalDesktopModules.Values;
            }
        }