﻿
Partial Class order_centre_getting_started

    Inherits System.Web.UI.Page
    Private _webWS As New WebWS

    Public ReadOnly Property BaseImageURL() As String
        Get
            If Not Session("BaseImageURL") Is Nothing Then
                Return Session("BaseImageURL")
            Else
                Return "themes/orange/"
            End If
        End Get
    End Property

    Public ReadOnly Property CmsAdapter() As CmsAdapter
        Get
            Return New CmsAdapter
        End Get
    End Property

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        'Response.Write("")
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' TODO: Fix potential bug, if StoreId session is null.
        Dim _storeId As String = Session("StoreId")

        'If Request.Url.Host.ToString().Split(".")(1).ToLower() = "kwikkopy" Then
        '    ViaWebH1.Style.Add("color", "#f20b26")
        '    ViaInstallH1.Style.Add("color", "#f20b26")
        'End If


        'If CmsAdapter.GetAllPagesByStoreId(_storeId).Count > 0 Then
        '    Dim _pageId As Integer = CmsAdapter.GetAllPagesByStoreId(_storeId).Item(0).PageId
        '    Response.Redirect("~/order_centre/page_loader.aspx?pageId=" & _pageId)
        'End If

        'Dim _userName As String = System.Web.HttpContext.Current.User.Identity.Name.ToString()

        'Dim _dataSet As New System.Data.DataSet
        '_dataSet = _webWS.GetPrintDriverInterfaceByStoreId(_storeId)
        'If _dataSet.Tables(0).Rows.Count > 0 Then
        'CompanyNameLabel.Text = _dataSet.Tables(0).Rows(0).Item("CompanyName")
        'CompanyAddressLabel.Text = _dataSet.Tables(0).Rows(0).Item("CompanyAddress")
        'CompanyPhoneLabel.Text = _dataSet.Tables(0).Rows(0).Item("CompanyPhone")
        'CompanyEmailLabel.Text = _dataSet.Tables(0).Rows(0).Item("CompanyEmail")
        'End If
        'WinPrintDriverButton.PostBackUrl = "http://" & Request.Url.Host.ToString() & "/downloadPD.aspx?s=" & _storeId & "&p=w"
        'MacPrintDriverButton.PostBackUrl = "http://" & Request.Url.Host.ToString() & "/downloadPD.aspx?s=" & _storeId & "&p=m"

        WinPrintDriverHyperLink.NavigateUrl = "http://" & Request.Url.Host.ToString() & "/downloadPD.aspx?s=" & _storeId & "&p=w"
        MacPrintDriverHyperLink.NavigateUrl = "http://" & Request.Url.Host.ToString() & "/downloadPD.aspx?s=" & _storeId & "&p=m"

        'Dim _profiles As ProfileInfoCollection = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All)

        'For Each pi As ProfileInfo In _profiles
        '    Dim _userProfile As ProfileCommon = Profile.GetProfile(pi.UserName)
        '    If _userProfile.StoreId = Convert.ToInt32(_storeId) Then
        '        Session("UserId") = Membership.GetUser(pi.UserName).ProviderUserKey.ToString()
        '    End If
        'Next

        Dim _ds As System.Data.DataSet = _webWS.GetActivationDataSetByStoreId(_storeId)
        Session("UserId") = _ds.Tables(0).Rows(0)("UserId")

        Session("RefererURL") = ""
        Try
            Dim _referer As System.Uri = Request.UrlReferrer
            Session("RefererURL") = _referer.ToString()
        Catch ex As Exception
        End Try


	If (_storeId.Equals("2066")) Then
		DesktopDownloadHTML.Visible = False
		GuestLoginHTML.Visible = False
	End If

    End Sub

End Class
