From 4825e8aac844ec0f0e1a3eabb77c410eaa0ac609 Mon Sep 17 00:00:00 2001 From: Ruslan Keba Date: Wed, 30 Oct 2013 13:26:01 +0200 Subject: [PATCH] Helicon Zoo Controller: GetServiceIdByProviderForServer fixed --- .../Data/DataProvider.cs | 11 ++++++----- .../HeliconZoo/HeliconZooController.cs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 643e0827..9b13ea19 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -3932,15 +3932,16 @@ namespace WebsitePanel.EnterpriseServer return packageId; } - public static int GetServiceIdByProviderForServer(int providerId, int serverId) + public static int GetServiceIdByProviderForServer(int providerId, int packageId) { IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.Text, @"SELECT TOP 1 - ServiceID - FROM Services - WHERE ProviderID = @ProviderID AND ServerID = @ServerID", + PackageServices.ServiceID + FROM PackageServices + LEFT JOIN Services ON Services.ServiceID = PackageServices.ServiceID + WHERE PackageServices.PackageID = @PackageID AND Services.ProviderID = @ProviderID", new SqlParameter("@ProviderID", providerId), - new SqlParameter("@ServerID", serverId)); + new SqlParameter("@PackageID", packageId)); if (reader.Read()) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HeliconZoo/HeliconZooController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HeliconZoo/HeliconZooController.cs index b63e0526..a5055e37 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HeliconZoo/HeliconZooController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HeliconZoo/HeliconZooController.cs @@ -236,7 +236,7 @@ namespace WebsitePanel.EnterpriseServer } // get Helicon Zoo service for site - int serviceId = DataProvider.GetServiceIdByProviderForServer(heliconZooProviderId, serverId); + int serviceId = DataProvider.GetServiceIdByProviderForServer(heliconZooProviderId, packageId); return serviceId; }