初始化
This commit is contained in:
38
WT-DMS/CDepartmentManage.vb
Normal file
38
WT-DMS/CDepartmentManage.vb
Normal file
@@ -0,0 +1,38 @@
|
||||
Public Class CDepartmentManage
|
||||
Dim m_SQL As New CSQLInterface
|
||||
|
||||
Const cst_TABLE_NAME As String = "DepartmentManageTable"
|
||||
Dim m_COLS_NAME() As String = {"部门ID", "负责人ID", "部门地址", "联系方式"}
|
||||
Private Enum COLS
|
||||
部门ID
|
||||
负责人ID
|
||||
部门地址
|
||||
联系方式
|
||||
End Enum
|
||||
|
||||
'权限
|
||||
Public Shared AccessRight As Integer = RIGHTS.NONE
|
||||
|
||||
|
||||
Public Sub New()
|
||||
End Sub
|
||||
|
||||
Private Function QueryItem(ByVal departID As String, ByRef HeaderID As Integer, ByRef departAddress As String, ByRef departLink As String) As ERROR_CODE
|
||||
If CBool(AccessRight And RIGHTS.READ) = False Then
|
||||
Return ERROR_CODE.NORIGHT
|
||||
End If
|
||||
|
||||
Dim strSql As String = "SELECT * FROM " & cst_TABLE_NAME & " WHERE "
|
||||
strSql &= m_COLS_NAME(COLS.部门ID) & "=" & departID
|
||||
|
||||
Dim rTable As New System.Data.DataTable
|
||||
If SQL_Query(COL_RIGHTS.部门管理, strSql, rTable) = True Then
|
||||
HeaderID = rTable.Rows(0).Item(1)
|
||||
departAddress = rTable.Rows(0).Item(2)
|
||||
departLink = rTable.Rows(0).Item(3)
|
||||
Return ERROR_CODE.SUCCESS
|
||||
End If
|
||||
|
||||
Return ERROR_CODE.ACCESS
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user