
Partial Class Visitors_Downloads
    Inherits CharterCMSPage


  Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    Me.cntDownload.ContentKey = "Download:" & GetDownLoadName(Page.Request.Params("downloadname")).ToString
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SetPageTitle("Downloads")
    End Sub

  Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
    lblTitle.Text = GetTitle(Page.Request.Params("downloadname"))
  End Sub

  Private Function GetDownLoadName(ByVal name As String) As DownloadName
    Select Case name.ToLower
      Case "livecontrols"
        Return DownloadName.LiveControls
      Case "automatedcontrols"
        Return DownloadName.AutomatedControls
      Case Else '"pipelineprofessor"
        Return DownloadName.PipelineProfessor
    End Select
  End Function

  Private Function GetTitle(ByVal name As DownloadName) As String
    Select Case name
      Case DownloadName.AutomatedControls
        Return "Automated Solution Controls"
      Case DownloadName.LiveControls
        Return "Direct to Live Controls (Remote Assistance)"
      Case Else
        Return "Charter Pipeline Professor"
    End Select
  End Function

  Private Function GetTitle(ByVal name As String) As String
    Select Case name.ToLower
      Case "livecontrols"
        Return "Direct to Live Controls (Remote Assistance)"
      Case "automatedcontrols"
        Return "Automated Solution Controls"
      Case "pipelineprofessor"
        Return "Charter Pipeline Professor"
      Case Else
        Return "Download"
    End Select
  End Function

  Protected Sub btnDownload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDownload.Click
		Response.Redirect(ExternalLinks.Google)
  End Sub
End Class
