kqxt_funclist.aspx.vb

来自「vb2005电子书籍——vb.net项目开发宝典源码」· VB 代码 · 共 78 行

VB
78
字号
Option Strict On
Option Explicit On 
Imports System.Data.SqlClient


Namespace wsbgxt

Partial Class kqxt_funclist
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub


    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region


        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Put user code to initialize the page here
            If Session("id") Is Nothing Then
                Response.Redirect("../NotLogin.aspx?FromPageName=kqxt/kqxt_funclist")
            End If

            Dim myConn As New SqlConnection
            myConn.ConnectionString = SQL_CONNECTION_STRING '"user id=secs;password=sces;initial catalog=secs;data source=localhost;Connect Timeout=30"
            Try
                myConn.Open()
                Dim myCmdStr As String
                myCmdStr = "SELECT n_yhjbxx_ent.xm," + _
                           "n_dqxdmb_ent.dqxmc," + _
                           "n_bmdmb_ent.bmhdwmc" + _
                           " FROM n_yhjbxx_ent, n_dqxdmb_ent, n_bmdmb_ent" + _
                           " where n_yhjbxx_ent.id =" + "'" + Trim(CStr(Session("id"))) + "'" + _
                           " and n_yhjbxx_ent.bmhdwid = n_bmdmb_ent.id" + _
                           " and n_yhjbxx_ent.dqxid = n_dqxdmb_ent.id"
                Dim myCmd As SqlCommand = New SqlCommand(myCmdStr, myConn)
                Dim reader As SqlDataReader = myCmd.ExecuteReader()
                If reader.Read() Then
                    Dim xm As String = Trim(reader.Item("xm").ToString)
                    Dim bmhdwmc As String = Trim(reader.Item("bmhdwmc").ToString)
                    Dim dqxmc As String = Trim(reader.Item("dqxmc").ToString)
                    '按权限显示对应功能列表
                    Dim dqxbh As Integer = CInt(Session("dqxbh"))
                    If dqxbh <> 10 Then
                        lbtnJB.Visible = False
                        lbtnKQWH.Visible = False
                        lbtnSJGL.Visible = False
                        lbtnFZCDJ.Visible = False
                        lbtnGLY.Visible = False
                    Else
                        lbtnJB.Visible = True
                        lbtnKQWH.Visible = True
                        lbtnSJGL.Visible = True
                        lbtnFZCDJ.Visible = True
                        lbtnGLY.Visible = True
                    End If
                End If
                reader.Close()
            Catch ex As SqlException
            Finally
                myConn.Close()
            End Try
        End Sub

End Class

End Namespace

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?