Imports BVSoftware.BVC.Core Public Class configuration_payment_methods_editccprocessor Inherits BaseAdminPage #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents lblName As System.Web.UI.WebControls.Label Protected WithEvents EditorPlaceHolder As System.Web.UI.WebControls.PlaceHolder Protected WithEvents lblAuthor As System.Web.UI.WebControls.Label Protected WithEvents MetaDescriptionControl As BVSoftware.WebControls.MetaTag Protected WithEvents MetaKeywordsControl As BVSoftware.WebControls.MetaTag Protected WithEvents lblVersion As System.Web.UI.WebControls.Label Protected WithEvents msg As BVSoftware.WebControls.WebPageMessage 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object 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 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then BVC2004Store.CheckThisPage(Security.RolePermission.LoginToAdmin) BVC2004Store.CheckThisPage(Security.RolePermission.AccessSettingsArea) MetaKeywordsControl.Content = WebAppSettings.MetaKeywords MetaDescriptionControl.Content = WebAppSettings.MetaDescription Dim searchPath As String = Request.PhysicalApplicationPath If searchPath.EndsWith("\") = False Then searchPath += "\" End If searchPath += "plugins\payment\CCProcessors\" ViewState("SearchPath") = searchPath End If msg.Clear() ' Get componentID if needed If Not Page.IsPostBack Then Dim componentID As String = Request("ComponentID") If componentID Is Nothing Then msg.ShowError("No component ID was selected.") End If ViewState("ComponentID") = componentID End If LoadEditor() End Sub Sub LoadEditor() Dim component As BVSoftware.BVC.Interfaces.BVSoftwarePlugin component = GetComponent(ViewState("ComponentID")) If component Is Nothing Then msg.ShowError("Component could not be loaded. Please make sure the component is installed in the plugins folder.") Else lblName.Text = component.DisplayName lblAuthor.Text = component.Author Dim ver As System.Diagnostics.FileVersionInfo ver = BVSoftware.BVC.Core.DiagnosticServices.GetAssemblyVersionInfo(ViewState("SearchPath") & component.AssemblyFileName) If Not ver Is Nothing Then lblVersion.Text = ver.ProductVersion & "
" lblVersion.Text += ver.ProductName & "
" lblVersion.Text += ver.CompanyName & "
" lblVersion.Text += ver.LegalCopyright End If ver = Nothing Dim context As New ComponentConfigurationProvider If component.Configure(Page, context) = True Then Me.EditorPlaceHolder.Controls.Add(component.Editor) ' If this is not post back then popualte control If EditorPlaceHolder.Controls.Count() > 0 Then AddHandler CType(Me.EditorPlaceHolder.Controls(0), BVSoftware.BVC.Interfaces.IBVSoftwarePluginEditor).SettingsSaved, AddressOf Me.Editor_Click AddHandler CType(Me.EditorPlaceHolder.Controls(0), BVSoftware.BVC.Interfaces.IBVSoftwarePluginEditor).SettingsCanceled, AddressOf Me.Editor_Click If Not Page.IsPostBack Then If CType(Me.EditorPlaceHolder.Controls(0), BVSoftware.BVC.Interfaces.IBVSoftwarePluginEditor).Populate() = False Then msg.ShowError("Failed to populate editor!") End If End If End If Else msg.ShowError("Component Configuration Failed!") End If End If End Sub Private Function GetComponent(ByVal id As String) As BVSoftware.BVC.Interfaces.BVSoftwarePlugin Return PlugInLoader.GetBVSoftwarePlugin(ViewState("SearchPath"), id) End Function Sub Editor_Click(ByVal sender As Object, ByVal e As EventArgs) Response.Redirect("configuration_payment_methods.aspx") End Sub End Class