⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmks_zhsz.frm

📁 本系统可用于医院和专业体检中心的健康体检管理
💻 FRM
📖 第 1 页 / 共 4 页
字号:
         Caption         =   "名称"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   1
         Left            =   240
         TabIndex        =   26
         Top             =   855
         Width           =   855
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "项目ID"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   1
         Left            =   240
         TabIndex        =   25
         Top             =   420
         Width           =   855
      End
      Begin VB.Label Label6 
         BackStyle       =   0  'Transparent
         Caption         =   "价格"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   240
         TabIndex        =   24
         Top             =   2715
         Width           =   855
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "说明"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   1
         Left            =   240
         TabIndex        =   23
         Top             =   3540
         Width           =   855
      End
      Begin VB.Label Label7 
         BackStyle       =   0  'Transparent
         Caption         =   "性别"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   240
         TabIndex        =   22
         Top             =   2220
         Width           =   855
      End
      Begin VB.Label Label8 
         BackStyle       =   0  'Transparent
         Caption         =   "显示顺序"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   1
         Left            =   240
         TabIndex        =   21
         Top             =   1710
         Width           =   855
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "注意事项"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   2
         Left            =   240
         TabIndex        =   20
         Top             =   3135
         Width           =   855
      End
   End
   Begin VB.Frame Frame2 
      Appearance      =   0  'Flat
      BackColor       =   &H00D3DABC&
      ForeColor       =   &H80000008&
      Height          =   1695
      Left            =   3720
      TabIndex        =   0
      Top             =   4950
      Width           =   5385
      Begin XPControls.XPCommandButton cmdExit 
         Cancel          =   -1  'True
         Height          =   375
         Left            =   3660
         TabIndex        =   1
         Top             =   1020
         Width           =   1080
         _ExtentX        =   1905
         _ExtentY        =   661
         Caption         =   "退出"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin XPControls.XPCommandButton cmdSave 
         Height          =   375
         Left            =   630
         TabIndex        =   2
         Top             =   1050
         Width           =   1080
         _ExtentX        =   1905
         _ExtentY        =   661
         Caption         =   "保存"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin XPControls.XPCommandButton cmdDelete 
         Height          =   375
         Left            =   2145
         TabIndex        =   3
         Top             =   420
         Width           =   1080
         _ExtentX        =   1905
         _ExtentY        =   661
         Caption         =   "删除"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin XPControls.XPCommandButton cmdAdd 
         Height          =   375
         Left            =   630
         TabIndex        =   4
         Top             =   420
         Width           =   1080
         _ExtentX        =   1905
         _ExtentY        =   661
         Caption         =   "添加"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin XPControls.XPCommandButton cmdModify 
         Height          =   375
         Left            =   3660
         TabIndex        =   5
         Top             =   420
         Width           =   1080
         _ExtentX        =   1905
         _ExtentY        =   661
         Caption         =   "修改"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
   End
   Begin MSComctlLib.TreeView tvwKSZH 
      Height          =   6495
      Left            =   120
      TabIndex        =   6
      Top             =   150
      Width           =   3375
      _ExtentX        =   5953
      _ExtentY        =   11456
      _Version        =   393217
      HideSelection   =   0   'False
      LabelEdit       =   1
      Style           =   7
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "frmKS_ZHSZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim menuOperation As OperationType

Private Sub cmbDXSXH_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub cmbKSSXH_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub cmdAdd_Click()
On Error GoTo ErrMsg
    Dim Status
    Dim strKey As String
    Dim strSQL As String
    Dim rsSXH As ADODB.Recordset
    Dim i As Integer
    
    Me.MousePointer = vbHourglass
    
    cmdAdd.Enabled = False
    cmdDelete.Enabled = False
    cmdModify.Enabled = False
    cmdSave.Enabled = True
    
    If tvwKSZH.SelectedItem Is Nothing Then GoTo ExitLab
    
    menuOperation = Add
    strKey = Mid(tvwKSZH.SelectedItem.Key, 2)
    Select Case Len(strKey)
        Case 0 '选择了根节点
            fraKS.Visible = True
            fraDX.Visible = False
            
            '添加科室
            txtKSID.Text = GetKSID()
            txtKSMC.Text = ""
            txtKSMC.Tag = ""
            txtKSPYSX.Text = ""
            txtKSWBSX.Text = ""
            txtKSSM.Text = ""
            txtDXZYSX.Text = ""
            
            '构造查询字符串
            strSQL = "select SXH from SET_SXH" _
                    & " where SXH not in (" _
                    & "select SXH from SET_KSSZ)"
            '打开记录集
            Set rsSXH = New ADODB.Recordset
            rsSXH.Open strSQL, GCon, adOpenStatic, adLockOptimistic
            '清空可能存在的显示
            cmbKSSXH.Clear
            For i = 1 To rsSXH.RecordCount
                cmbKSSXH.AddItem rsSXH("SXH")
                rsSXH.MoveNext
            Next
            
            If rsSXH.RecordCount > 0 Then
                cmbKSSXH.ListIndex = 0
                rsSXH.Close
            Else
                MsgBox "添加的同级项目数已经达到最大,请删除掉一部分项目后再添加!", vbInformation, "提示"
                cmdExit_Click
            End If
            
            EnableKSInput True
            txtKSMC.SetFocus
        Case 2, 4 '选择了科室,或者组合节点
            '添加组合
            fraKS.Visible = False
            fraDX.Visible = True
            
            txtDXID.Text = GetDXID(Left(strKey, 2))
            txtDXMC.Text = ""
            txtDXMC.Tag = ""
            txtDXPYSX.Text = ""
            txtDXPYSX.Tag = ""
            txtDXWBSX.Text = ""
            txtDXJG.Text = ""
            txtDXZYSX.Text = ""
            txtDXSM.Text = ""
            
            '构造查询字符串
            strSQL = "select SXH from SET_SXH" _
                    & " where SXH not in (" _
                    & "select SXH from SET_DX" _
                    & " where left(DXID,2)='" & Left(strKey, 2) & "')"
            '打开记录集
            Set rsSXH = New ADODB.Recordset
            rsSXH.Open strSQL, GCon, adOpenStatic, adLockOptimistic
            '清空可能存在的显示
            cmbDXSXH.Clear
            For i = 1 To rsSXH.RecordCount
                cmbDXSXH.AddItem rsSXH("SXH")
                rsSXH.MoveNext
            Next
            
            If rsSXH.RecordCount > 0 Then
                cmbDXSXH.ListIndex = 0
                rsSXH.Close
            Else
                MsgBox "添加的同级项目数已经达到最大,请删除掉一部分项目后再添加!", vbInformation, "提示"
                cmdExit_Click
            End If
            
            EnableDXInput True
            txtDXMC.SetFocus
    End Select
    Set rsSXH = Nothing
    
    GoTo ExitLab
ErrMsg:
    Status = SetError(Err.Number, Err.Description, Err.Source)
    ErrMsg Status
ExitLab:
    Me.MousePointer = vbDefault
End Sub

Private Sub cmdDelete_Click()
On Error GoTo ErrMsg
    Dim Status
    Dim strKey As String
    Dim strSQL As String
    Dim rstemp As ADODB.Recordset
    Dim nodTemp As Node
    Dim lngCount As Long
    Dim i As Long
    Dim lngIndex As Long
    
    Me.MousePointer = vbHourglass
    
    If tvwKSZH.SelectedItem Is Nothing Then GoTo ExitLab
    
    strKey = Mid(tvwKSZH.SelectedItem.Key, 2)
    Select Case Len(strKey)
        Case 0 '选择了根节点
            GoTo ExitLab
        Case 2 '选择了科室
            If MsgBox("该操作不可恢复!" & vbCrLf & "确实要删除科室“" _
                    & tvwKSZH.SelectedItem.Text & "”吗?", _
                    vbExclamation + vbYesNo + vbDefaultButton2, _
                    "小心") = vbNo Then
                GoTo ExitLab
            End If
            
            '如果科室下尚有组合,则禁止删除
            strSQL = "select Count(*) from SET_DX" _
                    & " where left(DXID,2)='" & strKey & "'"
            Set rstemp = New ADODB.Recordset
            rstemp.Open strSQL, GCon, adOpenStatic, adLockReadOnly
            If rstemp(0) >= 1 Then

⌨️ 快捷键说明

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