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.WebSite.Library

Partial Class Controls_Address
    Inherits System.Web.UI.UserControl

  Private _dataSource As IAddress

  Public ReadOnly Property DataSource() As IAddress
    Get
      Return _dataSource
    End Get
    'Set(ByVal value As IAddress)
    '  _dataSource = value
    'End Set
  End Property

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then
      _dataSource = AccountManager.Instance.GetAccount.Address
    End If
  End Sub


  Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
    If Not _dataSource Is Nothing Then
      With _dataSource
        lblStreet.Text = .Street1
        If Not (.Street2 Is Nothing OrElse .Street2.Equals(String.Empty)) Then
          lblApt.Text = .Street2
        Else
          lblApt.Visible = False
        End If
        lblCity.Text = .City
        lblState.Text = .State
        lblZip.Text = .Zip
      End With
    End If
  End Sub
End Class
