Helicon Zoo Controller: GetServiceIdByProviderForServer fixed

This commit is contained in:
Ruslan Keba 2013-10-30 13:26:01 +02:00
parent 2a221f793d
commit 4825e8aac8
2 changed files with 7 additions and 6 deletions

View file

@ -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())
{