Imports System
Imports System.Web.UI
Imports Northwind45.BusinessObject
Imports System.Web.Services
Imports System.Runtime.InteropServices
 
Namespace Northwind45
    Partial Public Class GridView_Products
        Inherits System.Web.UI.Page
 
        Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs)
            Functions.GridViewRowDataBound(sender, e, 1)
        End Sub
 
        Protected Sub GridView1_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs)
            Functions.GridViewRowCreated(sender, e, 1)
        End Sub
 
        Public Function GetGridData(maximumRows As Integer, startRowIndex As Integer, <Out()> ByRef totalRowCount As Integer, sortByExpression As StringAs ProductsCollection
            Return Products.SelectSkipAndTake(maximumRows, startRowIndex, totalRowCount, sortByExpression)
        End Function
 
        Public Sub DeleteGridItem(ByVal productID As Integer)
            Try
                Products.Delete(productID)
            Catch ex As Exception
                Functions.ShowModalError(ex, Me)
            End Try
        End Sub
    End Class
End Namespace