Imports System.Collections.Generic
Imports System.Configuration
Imports CharterDotCom.CommonEntities.Library
Imports CharterDotCom.CommonEntities.Library.Enumerations
Imports CharterDotCom.CommonEntities.Library.EntityMemberServices
'Imports CharterDotCom.CommonEntities.Library.EntityEBSServices
Imports CharterDotCom.CommonEntities.Library.EntitySupport
Imports CharterDotCom.CommonEntities.Library.EntitySearch
Imports CharterDotCom.CommonEntities.Library.EntityWebConfig
'Imports CharterDotCom.CommonEntities.Library.EntityG2BServices
Imports CharterDotCom.CommonEntities.Library.Common
Imports CharterDotCom.WebSite.Library

Partial Class Controls_FrequentQuestions
	Inherits System.Web.UI.UserControl

  'Public Property Placement() As String
  '	Get
  '		If ViewState(Me.ID & "_Placement") Is Nothing Then
  '			Return String.Empty
  '		Else
  '			Return ViewState(Me.ID & "_Placement").ToString()
  '		End If
  '	End Get

  '	Set(ByVal value As String)
  '		ViewState(Me.ID & "_Placement") = value
  '	End Set
  'End Property
  Dim _folder As IDocumentFolder

  Public Property Folder() As IDocumentFolder
    Get
      Return _folder
    End Get
    Set(ByVal value As IDocumentFolder)
      _folder = value
    End Set
  End Property

  Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
    ' Dim _folderID As Integer

		Dim _documents As Dictionary(Of String, BLHTMLDocument)
		Dim url As String = Request.Url.ToString()

    'Select Case Placement
    '  Case MenuItem.CableTV.ToString()
    '    _folderID = CType(ConfigurationManager.AppSettings(AppSettingKey.SupprtFAQCableTV), Integer)
    '  Case MenuItem.Internet.ToString()
    '    _folderID = CType(ConfigurationManager.AppSettings(AppSettingKey.SupprtFAQInternet), Integer)
    '  Case MenuItem.Telephone.ToString()
    '    _folderID = CType(ConfigurationManager.AppSettings(AppSettingKey.SupprtFAQTelephone), Integer)
    '  Case MenuItem.MyAccount.ToString()
    '    _folderID = CType(ConfigurationManager.AppSettings(AppSettingKey.SupprtFAQAccount), Integer)
    '  Case Else
    '    _folderID = CType(ConfigurationManager.AppSettings(AppSettingKey.SupprtFAQHomePage), Integer)
    'End Select

    '_folder = SiteManager.Instance.GetFolderDocuments(_folderID)

		If url.Contains("ContactUs.aspx") Then
			lblFrequentQuestion.Text = "Solve Problems Now"
		Else
			lblFrequentQuestion.Text = "Frequent Questions"
		End If

    If _folder Is Nothing Then
      rprFAQ.Visible = False
    Else
      _documents = _folder.ChildDocuments

      If _documents Is Nothing Then
        rprFAQ.Visible = False
      Else
        rprFAQ.DataSource = _documents
        rprFAQ.DataBind()
        rprFAQ.Visible = True
      End If
    End If
  End Sub

  'Dim _content As Content
  'Dim questions As Dictionary(Of String, String)

  'If Not IsPostBack Then
  '	_content = New Content()
  '	questions = _content.GetFrequentQuestions(Placement)
  '	rprFAQ.DataSource = questions
  '	rprFAQ.DataBind()
  'End If
End Class
