Imports EDSL.Entities
Imports EDSL.DAL
Partial Public Class ITServicesPanel
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objMainCategory As New entmainCategory
        Dim intCategoryID As New Integer

        'Get main category details
        If Not Request.QueryString("cid") Is Nothing Then
            intCategoryID = Convert.ToInt32(Request.QueryString("cid"))
            objMainCategory = GetCategory(intCategoryID)
            With objMainCategory
                lblITHeader.Text = .CategoryName
                divITContent.InnerHtml = .CategorySummary
                'Build Sub Category repeater
                Dim objSubCategory As New List(Of entUserPage)
                objSubCategory = GetAll(.CategoryID)
                rptITSubcategories.DataSource = objSubCategory
                rptITSubcategories.DataBind()

            End With
        End If
    End Sub
    Private Function GetAll(ByVal intCategoryID As Integer) As List(Of entUserPage)
        Dim objMain As New dbMainUserPage
        Dim objMainEntity As List(Of entUserPage) = objMain.GetAllITServices(intCategoryID)
        Return objMainEntity
    End Function
    Private Function GetCategory(ByVal intCategoryID As Integer) As entmainCategory
        Dim objMain As New dbMainCategory
        Dim objMainCategory As entmainCategory = objMain.GetITServiceItem(intCategoryID)
        Return objMainCategory
    End Function
End Class