Sorry about that, don't know what happened:
Imports System.Data
Imports System.Data.SqlClient
Imports DotNetNuke.Common
Imports DotNetNuke
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Data
Imports DotNetNuke.Entities.Users
Imports DotNetNuke.Framework
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.UI
Namespace DotNetNuke
Partial Class DispHierarchyS
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Dim vAgentid As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Request.Params("agentid") Is Nothing Then
Dim poPageController As New Entities.Tabs.TabController
Dim pnTabID As Integer = poPageController.GetTabByName("Agent Search", PortalSettings.PortalId).TabID
Dim psURL As String = NavigateURL(pnTabID)
Session("RetTab") = TabId
Response.Redirect(psURL)
Else
vAgentid = Request.Params("agentid")
If Not IsPostBack Then
GetMC()
End If
End If
End Sub
Private Sub GetMC()
Dim vCount As Integer
Dim vMC As String
Dim AgentConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("YourAppSettings").ConnectionString)
Dim dbCommandMC As SqlCommand = New SqlCommand("dbo.spHIERGetMarketCodes", AgentConn)
If Request.Params("agentid") <> "" Then
dbCommandMC.Parameters.Add(New SqlParameter("@pAgentNum", Request.Params("agentid")))
Else
dbCommandMC.Parameters.Add(New SqlParameter("@pAgentNum", vAgentid.ToUpper))
End If
dbCommandMC.CommandType = CommandType.StoredProcedure
Dim Ds As New DataSet
Dim SqlAdp As New SqlDataAdapter
SqlAdp = New SqlDataAdapter(dbCommandMC)
SqlAdp.Fill(Ds, "MC")
Dim dt As DataTable
dt = Ds.Tables("MC")
vCount = dt.Rows.Count
If (vCount = 1) Then
vMC = "1"
Else
ddlMC.DataSource = Ds.Tables("MC")
ddlMC.DataTextField = "description"
ddlMC.DataValueField = "marketCode"
ddlMC.DataBind()
End If
Dim mytabid As Integer
Dim myUrl As String
Try
mytabid = Me.PortalSettings.ActiveTab.TabID
myUrl = Me.PortalSettings.HomeDirectory
Catch
mytabid = 0
End Try
If (vCount = 1) Then
Response.Redirect(Trim(myUrl) + "/tabid/" + Trim(Str(mytabid)) + "/Default.aspx?Agentid=" + Request.Params("agentid") + "&mc=" + vMC)
End If
End Sub
Private Sub butMC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butMC.Click
Dim objModules As Entities.Modules.ModuleController = New Entities.Modules.ModuleController
Response.Redirect(Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "HierDetails", "mid=" & objModules.GetModuleByDefinition(PortalSettings.PortalId, "Agent Hierarchy").ModuleID) & "?agentid=" + Request.Params("AgentID") + "&mc=" + ddlMC.SelectedIndex.ToString)
End Sub
End Class
End Namespace