From 399b24c7ce8f56ad65efdb3a7721b49c34205add Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Wed, 19 Nov 2014 15:30:39 +0300 Subject: [PATCH] 1)remove a RDS server form org - add check if server is in collection 2)RDS add server in colection - can add only servers witch are not in other collection. --- .../RemoteDesktopServicesController.cs | 2 +- .../WebsitePanel_SharedResources.ascx.resx | 3 +++ .../WebsitePanel/RDS/AssignedRDSServers.ascx.cs | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index f2a3ca42..9371ca1e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -422,7 +422,7 @@ namespace WebsitePanel.EnterpriseServer private static RdsServersPaged GetOrganizationRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { - DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows, ignoreRdsCollectionId: true); + DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows); RdsServersPaged result = new RdsServersPaged(); result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index f7a9f87f..7508ff20 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5593,4 +5593,7 @@ Error creating rds collection. You need to add at least 1 rds server to collection + + Error deleting rds server from organization: server is used in rds collection + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs index af6144d6..906f8182 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/AssignedRDSServers.ascx.cs @@ -32,6 +32,7 @@ using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.RemoteDesktopServices; using WebsitePanel.WebPortal; namespace WebsitePanel.Portal.RDS @@ -67,6 +68,13 @@ namespace WebsitePanel.Portal.RDS try { + RdsServer rdsServer = ES.Services.RDS.GetRdsServer(rdsServerId); + if (rdsServer.RdsCollectionId != null) + { + messageBox.ShowErrorMessage("RDS_UNASSIGN_SERVER_FROM_ORG_SERVER_IS_IN_COLLECTION"); + return; + } + ResultObject result = ES.Services.RDS.RemoveRdsServerFromOrganization(rdsServerId); if (!result.IsSuccess) {