
Partial Class Manager_GroupJurisdiction
    Inherits System.Web.UI.Page

    Public Function GetPlugClass() As String
        Dim strHtml As New StringBuilder
        Dim mGroupID As Integer = BaseFunction.SiteUser.UserGroupID

        Dim mAllClassList = DB_PlugModular.clsPlugClass.GetLinq.ToList
        Dim mAllUserSec = DB_PlugModular.clsPlugUserSecurity.GetLinq(CType(BaseFunction.PublicMethod.GetApplication("SiteID"), Integer)).ToList
        Dim mAllPlug = DB_PlugModular.clsPlug.GetLinq.ToList
        Dim mUserSec = (From u In mAllUserSec _
                        Where u.ParID = 0 _
                        And u.GroupID = mGroupID _
                        Select u.PlugID).ToArray
        If Not IsNothing(mUserSec) Then
            Dim mShowClass = (From p In mAllPlug _
                              Join c In mAllClassList On p.ClassID Equals c.ClassID _
                              Where mUserSec.Contains(p.ID) _
                              Select c.ClassID, c.ClassName).Distinct.ToList
            For Each c In mShowClass
                strHtml.Append("<li id='Class" & c.ClassID.ToString & "' onclick='GetPlugs(""" & c.ClassID.ToString & """)'>" & c.ClassName & "</li>")
            Next
        End If
        Return strHtml.ToString
    End Function
    Public Function GetGroupID() As String
        Return Request("GroupID")
    End Function

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.ClientScript.IsClientScriptIncludeRegistered("jqueryminScript") Then Page.ClientScript.RegisterClientScriptInclude("jqueryminScript", "/App_Themes/ManagerTheme/js/jquery.min.js")
        If Not Page.ClientScript.IsClientScriptIncludeRegistered("GroupJurisdictionScript") Then Page.ClientScript.RegisterClientScriptInclude("GroupJurisdictionScript", "/App_Themes/ManagerTheme/js/GroupJurisdiction.js")
    End Sub
End Class
