?? 系統私有模塊.bas
字號:
Attribute VB_Name = "XtsyModule"
'系統私有模塊用來放置一些子系統獨有的過程與函數
'Public connParaSet As Connection '指定數據庫的連接對象
'列表框項目設置變量
Public str_ComboCode As String '列表框編碼
Public str_ComboName As String '列表框名稱
Public str_SysCode As String '系統模塊編碼
'編碼定位用
Public str_Code As String '編碼名稱
Public FormStr As String '圖形中判斷界面
Public Sub Drxtztcs() '讀入系統帳套參數
Dim Ztcsbrec As New ADODB.Recordset
Dim RecTemp As New ADODB.Recordset
Dim SqlStr As String
With Ztcsbrec
'金額總位數
.Open "Select * From Gy_AccInformation Where SystemCode='cwzz'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
If .EOF Then Exit Sub
.MoveFirst
.Find "itemcode='cwjezws'"
If Not Ztcsbrec.EOF Then
Xtjezws = Val(Trim(Ztcsbrec.Fields("itemvalue")))
End If
'數量總位數
.MoveFirst
.Find "itemcode='cwslzws'"
If Not Ztcsbrec.EOF Then
Xtslzws = Val(Trim(Ztcsbrec.Fields("itemvalue")))
End If
'單價總位數
.MoveFirst
.Find "itemcode='cwdjzws'"
If Not Ztcsbrec.EOF Then
Xtdjzws = Val(Trim(Ztcsbrec.Fields("itemvalue")))
End If
'金額小數位數
.MoveFirst
.Find "itemcode='cwjexsws'"
If Not Ztcsbrec.EOF Then
Xtjexsws = Val(Trim(Ztcsbrec.Fields("itemvalue")))
End If
'數量小數位數
.MoveFirst
.Find "itemcode='cwslxsws'"
If Not Ztcsbrec.EOF Then
Xtslxsws = Val(Trim(Ztcsbrec.Fields("itemvalue")))
End If
'單價小數位數
.MoveFirst
.Find "itemcode='cwdjxsws'"
If Not Ztcsbrec.EOF Then
Xtdjxsws = Val(Trim(Ztcsbrec.Fields("itemvalue")))
End If
.Close
End With
End Sub
'---------------------------------------
'編寫人員:奚俊峰
'函數功能:網格記錄定位
'輸入參數:obj_Grid 網格對象
' int_Column 要搜索的列號
' 返回值:
'---------------------------------------
Public Function Fun_GridLocate(obj_Grid As Object, int_Column As Integer)
Dim int_Count As Integer
If obj_Grid.Row < obj_Grid.FixedRows Then Exit Function
str_Code = ""
CSH_FrmGridSearch.Show 1
If str_Code = "" Then Exit Function
With obj_Grid
For int_Count = .FixedRows To .Rows - 1
If UCase(Mid(.TextMatrix(int_Count, int_Column), 1, Len(str_Code))) = UCase(str_Code) Then
.Select int_Count, int_Column
.TopRow = int_Count
Exit For
End If
Next int_Count
End With
End Function
'---------------------------------------
'編寫人員:奚俊峰
'函數功能:取出操作人員的子系統使用權限并填充列表框
'輸入參數:obj_Combo 列表框對象
' str_UserCode 操作人員編號
' 返回值:
'---------------------------------------
Public Function Fun_FillUserSystem(obj_Combo As Object, str_UserCode As String)
Dim str_Sql As String
Dim tRs As Recordset
Dim str_Auth As String
On Error GoTo ErrHandle
'取出該用戶的子系統使用權限
' str_Sql = "select isnull(AuthorityID,'') from Gy_Czygl where czybm='" & str_UserCode & "'"
' Set tRs = Cw_DataEnvi.DataConnect.Execute(str_Sql)
' str_Auth = Left(Trim(tRs(0)), 200)
'取出該帳套的子系統ID
str_Sql = "select * from gy_syscode order by sysnumb"
Set tRs = Cw_DataEnvi.DataConnect.Execute(str_Sql)
obj_Combo.ComboItems.Clear
Do While Not tRs.EOF
' If Mid(str_Auth, tRs("ID"), 1) = "1" Then
obj_Combo.ComboItems.Add , "@" + Trim(tRs.Fields("syscode")), Trim(tRs.Fields("sysnumb")) & " " & Trim(tRs.Fields("sysname"))
' End If
tRs.MoveNext
Loop
obj_Combo.Locked = True
ErrHandle:
End Function
'---------------------------------------
'編寫人員:奚俊峰
'函數功能:
'輸入參數:str_Function 功能編碼
' str_UserCode 操作人員編號
' 返回值:Boolean
' True : 有權限
' False : 無權限
'---------------------------------------
Public Function IsPermission(str_Function As String, str_UserCode As String) As Boolean
Dim aDo_userGroup As New Recordset '存取功能索引ID
Dim aDo_gnbm As New Recordset '存取用戶權限
Dim str_Auth As String
On Error GoTo ErrHandle
Set aDo_gnbm = Cw_DataEnvi.DataConnect.Execute("select * from Xt_xtgnb where gnsy='" & Trim(str_Function) & "'")
Set aDo_userGroup = Cw_DataEnvi.DataConnect.Execute("select * from Gy_Czygl where czybm='" & Trim(str_UserCode) & "'")
str_Auth = Mid(Trim(aDo_userGroup("AuthorityID") & ""), 201)
If Mid(str_Auth, aDo_gnbm!Id, 1) = "1" Then
IsPermission = True
Else
IsPermission = False
End If
Set aDo_gnbm = Nothing
Set aDo_userGroup = Nothing
ErrHandle:
End Function
'---------------------------------------
'編寫人員:奚俊峰
'函數功能:校驗輸入的編碼是否符合規范
'輸入參數:str_SystemCode 功能編碼
' str_Code 操作人員編號
' 返回值:String
' ="" : 校驗正確
' <>"" : 返回錯誤信息
'---------------------------------------
Public Function ConfirmCode(str_SystemCode As String, str_Code As String) As String
Dim str_tInfo As String
str_SystemCode = Trim(str_SystemCode)
str_Code = Trim(str_Code)
'長度不對提示
If Len(str_Code) <= Len(str_SystemCode) + 1 Then
ConfirmCode = "編碼輸入錯誤,應該為:" & vbCrLf & vbCrLf & str_SystemCode & "_名稱"
Exit Function
End If
'前綴不對提示
If UCase(Left(str_Code, Len(str_SystemCode) + 1)) <> UCase(str_SystemCode & "_") Then
ConfirmCode = "編碼輸入錯誤,應該為:" & vbCrLf & vbCrLf & str_SystemCode & "_名稱"
Exit Function
End If
ConfirmCode = ""
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -