All pastes #903189 Raw Edit

Stuff

public text v1 · immutable
·published 2008-02-14 01:37 UTC
rendered paste body
Imports System.Data
Partial Class LookupProducts
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then

            ' Instanciate the eRaceSystem
            Dim SystemManager As New eRaceSystem.eRace

            ' Retrieve and sort the Categories
            Dim CategoryList As DataSet
            CategoryList = SystemManager.LookupAllCategories
            CategoryList.Tables("CategoryInfo").DefaultView.Sort = "Description ASC"

            ' Build Our Category DropDown
            DD_CategoryId.DataSource = CategoryList.Tables("CategoryInfo")
            DD_CategoryId.DataTextField = "Description"
            DD_CategoryId.DataValueField = "CategoryId"
            DD_CategoryId.DataBind()
            DD_CategoryId.SelectedIndex = -1

        End If
    End Sub
    Protected Sub BT_Search_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BT_Search.Click

        ' Instanciate the eRaceWebService
        Dim WebServiceMgr As New localhost.Service

        ' Create an new DataSet
        Dim ProductDS As New DataSet

        Try
            ' Get the Employees
            ProductDS = WebServiceMgr.AvailableProducts(Integer.Parse(DD_CategoryId.SelectedValue))
            ' Sort the Result
            ProductDS.Tables("ProductInfo").DefaultView.Sort = "Description ASC"

            ' Load the GridView
            GV_Products.DataSource = ProductDS.Tables("ProductInfo")
            GV_Products.DataBind()
 
       Catch ex As Exception
            'AddError(ex.Message)
            'DisplayError()
        End Try
        'End If
    End Sub
    
End Class