📄 frmusu_helpperson.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmUSU_HelpPerson
BorderStyle = 3 'Fixed Dialog
Caption = "输入参照 - 个人(业务员)"
ClientHeight = 6810
ClientLeft = 45
ClientTop = 330
ClientWidth = 5685
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6810
ScaleWidth = 5685
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 345
Left = 3278
TabIndex = 2
Top = 6360
Width = 1065
End
Begin VB.CommandButton cmdOk
Caption = "确定(&O)"
Default = -1 'True
Height = 345
Left = 1358
TabIndex = 1
Top = 6360
Width = 1065
End
Begin MSComctlLib.TreeView tVw
Height = 6225
Left = 0
TabIndex = 0
Top = 0
Width = 5685
_ExtentX = 10028
_ExtentY = 10980
_Version = 393217
HideSelection = 0 'False
LabelEdit = 1
Style = 7
ImageList = "ilsTvw"
Appearance = 1
End
Begin MSComctlLib.ImageList ilsTvw
Left = 240
Top = 6120
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmUSU_HelpPerson.frx":0000
Key = "Root"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmUSU_HelpPerson.frx":0454
Key = "UnSelected"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmUSU_HelpPerson.frx":08A8
Key = "Selected"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmUSU_HelpPerson.frx":0CFC
Key = "Expand"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmUSU_HelpPerson.frx":1150
Key = "Collapse"
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmUSU_HelpPerson"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const sTABLECG = "tUSU_Department"
Private sTable As String
Const sFIELD_CODECG = "cDepCode"
Const sFIELD_NAMECG = "cDepName"
Const sFIELD_DEGREECG = "iDepGrade"
Const sFIELD_ENDCG = "bDepEnd"
Const sFIELD_CODE = "ZGBH"
Const sFIELD_NAME = "ZGXM"
Const sTitle = "个人(业务员)"
Const sITEM = "部门"
Dim CUsual As clsContentsSet
Public OK As Boolean
Private m_sCode As String
Private m_sName As String
Public Property Get usCode() As String
usCode = m_sCode
End Property
Public Property Get usName() As String
usName = m_sName
End Property
Private Sub Form_Load()
Dim rSt As ADODB.Recordset
Dim aryLen() As Integer
Dim i As Long
sTable = GetPersTableName
Set rSt = New ADODB.Recordset
With rSt
.CursorLocation = adUseClient
.Open "SELECT * FROM tUSU_dmjs WHERE Type='" & _
sITEM & "' ORDER BY JC", _
glo.cnnMain, adOpenStatic, adLockReadOnly
ReDim aryLen(.RecordCount)
i = 0
Do Until .EOF
aryLen(i) = .Fields("WS").Value
.MoveNext
i = i + 1
Loop
.Close
End With
Set CUsual = New clsContentsSet
With CUsual
.TypeOfContents = ctCategory
.DBConnection = glo.cnnMain
.TableCG = sTABLECG & glo.sOperateYear
.Table = sTable
.FieldCodeCG = sFIELD_CODECG
.FieldCode = sFIELD_CODE
.FieldNameCG = sFIELD_NAMECG
.FieldName = sFIELD_NAME
.FieldLevelCG = sFIELD_DEGREECG
.FieldEndCG = sFIELD_ENDCG
.OtherFieldCount = 0
.TreeView = tVw
.RootKey = "R"
.RootText = sTitle
.NodeKeyPrefixCG = "K"
.ImageRootUnSelected = "Root"
.ImageNodeUnSelectedCG = "Collapse"
.ImageNodeSelectedCG = "Expand"
.ImageNodeUnSelected = "UnSelected"
.ImageNodeSelected = "Selected"
.LevelsCG = UBound(aryLen)
.LevelLenCG = aryLen()
.LoadTvwCategory
.FieldCategory = "BMBH"
.LoadTvwContents
End With
Call tVw_NodeClick(tVw.Nodes(CUsual.RootKey))
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
Cancel = 1
Call cmdCancel_Click
End If
End Sub
Private Sub cmdOk_Click()
With tVw.SelectedItem
m_sCode = Mid$(.Key, 2)
m_sName = Mid$(.text, InStr(1, .text, "=") + 1)
End With
OK = True
Me.Hide
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub tVw_DblClick()
If tVw.SelectedItem.Key Like CUsual.NodeKeyPrefix & "*" Then
Call cmdOk_Click
End If
End Sub
Private Sub tVw_NodeClick(ByVal Node As MSComctlLib.Node)
cmdOk.Enabled = (Node.Key Like CUsual.NodeKeyPrefix & "*")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -