Imports BVSoftware.BVC.Core Public Class configuration_contact Inherits BaseAdminPage Protected WithEvents valSummary As System.Web.UI.WebControls.ValidationSummary Protected WithEvents btnCancel As System.Web.UI.WebControls.ImageButton Protected WithEvents ContactEmail As System.Web.UI.WebControls.TextBox Protected WithEvents SiteName As System.Web.UI.WebControls.TextBox Protected WithEvents Copyright As System.Web.UI.WebControls.TextBox Protected WithEvents MetaDescriptionControl As BVSoftware.WebControls.MetaTag Protected WithEvents MetaKeywordsControl As BVSoftware.WebControls.MetaTag Protected WithEvents AddressControl1 As AddressControl Protected WithEvents OtherContactInfo As System.Web.UI.WebControls.TextBox Protected WithEvents msg As BVSoftware.WebControls.WebPageMessage Protected WithEvents btnSave As System.Web.UI.WebControls.ImageButton #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs) Handles MyBase.Load BVC2004Store.CheckThisPage(Security.RolePermission.LoginToAdmin) BVC2004Store.CheckThisPage(Security.RolePermission.AccessContentArea) AddressControl1.ShowCompanyName = True AddressControl1.ShowFaxNumber = True AddressControl1.ShowMiddleInitial = False AddressControl1.ShowPhoneNumber = True AddressControl1.ShowWebSiteURL = True AddressControl1.RequireCompany = False AddressControl1.RequireFax = False AddressControl1.RequireFirstName = False AddressControl1.RequireLastName = False AddressControl1.RequirePhone = False AddressControl1.RequireWebSiteURL = False With AddressControl1() .RequireAddress = False .RequireCity = False .RequirePostalCode = False .RequireRegion = False End With If Not Page.IsPostBack Then MetaKeywordsControl.Content = WebAppSettings.MetaKeywords MetaDescriptionControl.Content = WebAppSettings.MetaDescription Try Me.SiteName.Text = WebAppSettings.SiteName Me.Copyright.Text = WebAppSettings.Copyright Me.ContactEmail.Text = WebAppSettings.ContactEmail Dim contactAddress As Contacts.Address = WebAppSettings.ContactAddress AddressControl1.LoadFromAddress(contactAddress) LoadOtherContactInfo() Catch Ex As Exception msg.ShowException(Ex) End Try End If End Sub Sub btnCancel_OnClick(ByVal Sender As Object, ByVal E As ImageClickEventArgs) Page.SmartNavigation = False Response.Redirect("content_contact.aspx") End Sub Sub btnSave_OnClick(ByVal Sender As Object, ByVal E As ImageClickEventArgs) msg.Clear() If Page.IsValid() Then If AddressControl1.Validate = True Then Try WebAppSettings.SiteName = SiteName.Text WebAppSettings.Copyright = Copyright.Text WebAppSettings.ContactEmail = ContactEmail.Text Dim a As Contacts.Address = AddressControl1.GetAsAddress If Not a Is Nothing Then WebAppSettings.ContactAddress = a End If ContentServices.Policies.Update(ViewState("OtherContactInfoPolicyID"), "", OtherContactInfo.Text) msg.ShowOK("Changes Saved") Catch Ex As Exception msg.ShowException(Ex) End Try End If End If End Sub Private Sub LoadOtherContactInfo() Dim PolData As New DataTable PolData = ContentServices.Policies.GetByType(Content.PolicyTypes.ContactUs) If PolData.Rows.Count > 0 Then ViewState("OtherContactInfoPolicyID") = PolData.Rows(0).Item("id") OtherContactInfo.Text = PolData.Rows(0).Item("description") End If End Sub End Class