Imports Microsoft.VisualBasic
Imports System.Collections
Public Class CartItems
  Inherits Hashtable
  Public Function GetItemBySiteCode(ByVal sSiteCode As String) As CartItem
    '..Provide method to get CartItem by SiteCode.   zye.
    Dim pCartItem As CartItem
    Dim pCartItemR As CartItem = Nothing
    Try
      sSiteCode = sSiteCode.Trim.ToUpper
      For Each pCartItem In Me.Values
        If UCase(pCartItem.SiteCode) = sSiteCode Then
          pCartItemR = pCartItem
          Exit For
        End If
      Next
    Catch ex As Exception
      pCartItemR = Nothing
    End Try
    Return pCartItemR
  End Function
  Public Function GetItemBySiteName(ByVal sSiteName As String) As CartItem
    '..Provide method to get CartItem by SiteName.   zye.
    Dim pCartItem As CartItem
    Dim pCartItemR As CartItem = Nothing
    Try
      sSiteName = sSiteName.Trim.ToUpper
      For Each pCartItem In Me.Values
        If UCase(pCartItem.SiteName) = sSiteName Then
          pCartItemR = pCartItem
          Exit For
        End If
      Next
    Catch ex As Exception
      pCartItemR = Nothing
    End Try
    Return pCartItemR
  End Function
  Public Function GetItemsByNetwork(ByVal sNetworkName As String) As ArrayList
    Dim pCartItem As CartItem
    Dim cCartItemR As ArrayList = New ArrayList
    Try
      sNetworkName = sNetworkName.Trim.ToUpper
      For Each pCartItem In Me.Values
        If UCase(pCartItem.Network) = sNetworkName Then
          cCartItemR.Add(pCartItem)
        End If
      Next
    Catch ex As Exception
      cCartItemR = Nothing
    End Try
    Return cCartItemR
  End Function

End Class
