Imports Microsoft.VisualBasic
Imports System.Text
Imports System.Collections.Specialized
Imports System.Web
Imports System.Collections.Generic
Imports System.Net

Namespace Utilities
    Public Class ExternalIDs

        Public Shared Function Suppress(ByVal externalID As String) As Boolean

            ' External IDs prefixed with a 1 are bundles
            ' External IDs prefixed with a 2 are stand-alone service plans (single plays)

            If System.Web.HttpContext.Current.Application("SUPPRESS_EXTERNAL_IDS") Is Nothing Then
                Return False
            End If

            Dim IDCollection() As String
            Dim fullIDList As String = System.Web.HttpContext.Current.Application("SUPPRESS_EXTERNAL_IDS")
            IDCollection = fullIDList.Split(",")

            For i As Integer = 0 To IDCollection.GetUpperBound(0)
                If IDCollection(i).ToString = externalID Then
                    Return True
                End If
            Next

            Return False

        End Function

        Public Shared Function OneFreeVideoTierCustomization(ByVal customizationID As String) As Boolean

            ' return false for A La Carte pricing
            ' return true for One Free Tier Included pricing

            If System.Web.HttpContext.Current.Application("ONE_FREE_VIDEO_TIER_CUSTOMIZATIONS") Is Nothing Then
                Return False
            End If

            Dim IDCollection() As String
            Dim fullIDList As String = System.Web.HttpContext.Current.Application("ONE_FREE_VIDEO_TIER_CUSTOMIZATIONS")
            IDCollection = fullIDList.Split(",")

            For i As Integer = 0 To IDCollection.GetUpperBound(0)
                If IDCollection(i).ToString = customizationID Then
                    Return True
                End If
            Next

            Return False


        End Function

    End Class
End Namespace
