Imports CharterDotCom.CommonEntities.Library
Imports CharterDotCom.CommonEntities.Library.Enumerations
Imports CharterDotCom.CommonEntities.Library.EntityMemberServices
Imports CharterDotCom.CommonEntities.Library.EntitySupport
Imports CharterDotCom.CommonEntities.Library.EntitySearch
Imports CharterDotCom.CommonEntities.Library.EntityWebConfig
Imports CharterDotCom.CommonEntities.Library.Common
Imports CharterDotCom.WebSite.Library

Partial Class Controls_Timeout
    Inherits System.Web.UI.UserControl

    Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnLogin.Click
        '#########################################################################################
        'MODIFICATION   SIVA DOLA   3-4-2008
        'THIS CONDITION WAS ADDED TO SUPPORT THE SHOW CHARTER BUSINESS LOGIN PAGE FOR CB CUSTOMERS
        '#########################################################################################
        CheckDomain()

    End Sub
    '#####################################################################
    '5/20/2008  SIVA DOLA
    'Login page is displayed based on the domain(either charter or CB) 

    '#####################################################################
    Private Sub CheckDomain()
        Dim sURL As String
        sURL = Request.Url.ToString().ToLower()
        If sURL.Trim() <> "" Then

            Select Case True

                Case sURL.Contains("://business.charter.com"), sURL.Contains("://www.business.charter.com")
                    'CB PROD
                    Response.Redirect("https://www.business.charter.com/order/CBLogin.aspx")

                Case sURL.Contains("://business.cc2uatx")
                    'CB TEST
                    Response.Redirect("https://business.cc2uatx.chartercom.com/order/CBLogin.aspx")

                Case sURL.Contains("://kstlmweb65:81")
                    'CB DEV
                    Response.Redirect("https://kstlmweb65:81/order/CBLogin.aspx")

                Case sURL.Contains("://localhost/business")
                    'CB LOCALHOST
                    Response.Redirect("http://localhost/business/Order/CBLogin.aspx")

                Case sURL.Contains("://www.myaccount.charter.com"), sURL.Contains("://myaccount.charter.com"), sURL.Contains("://charter.com"), sURL.Contains("://www.charter.com")
                    'CHARTER.COM PROD
                    '---------------------------------------------------------------------
                    ' Issue 10900:  Account for myaccount.charter.com.  JLN, 10/01/2010.
                    '---------------------------------------------------------------------
                    Response.Redirect("https://www.myaccount.charter.com/order/login.aspx")

                Case sURL.Contains("://www.uat.myaccount.charter.com"), sURL.Contains("://uat.myaccount.charter.com"), sURL.Contains("://cc2uatx"), sURL.Contains("://cc2uatw")
                    'CHARTER.COM TEST
                    '---------------------------------------------------------------------
                    ' Issue 10900:  Account for myaccount.charter.com.  JLN, 10/01/2010.
                    '---------------------------------------------------------------------
                    Response.Redirect("https://www.uat.myaccount.charter.com/order/login.aspx")

                Case sURL.Contains("://kstlmweb65/")
                    'CHARTER.COM DEV
                    Response.Redirect("https://kstlmweb65/order/login.aspx")

                Case sURL.Contains("://kstlmweb65:82/")
                    'CHARTER.COM DEV NEW
                    Response.Redirect("http://kstlmweb65:82/order/login.aspx")

                Case sURL.Contains("://kstlmweb65:90/")
                    'CHARTER.COM ECARE
                    Response.Redirect("http://kstlmweb65:90/order/login.aspx")

                Case sURL.Contains("://localhost/ui/")
                    'CHARTER.COM LOCALHOST
                    Response.Redirect("http://localhost/UI/Order/Login.aspx")

                Case Else
                    'just show the same page

            End Select

        End If
    End Sub

End Class
