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

📄 frmdf.frm

📁 大型医院管理源代码
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmdf 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "退款登记"
   ClientHeight    =   1380
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3750
   Icon            =   "frmdf.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Picture         =   "frmdf.frx":030A
   ScaleHeight     =   1380
   ScaleWidth      =   3750
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command2 
      Caption         =   "关闭&(C)"
      Height          =   300
      Left            =   2520
      TabIndex        =   7
      Top             =   780
      Width           =   1000
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退款&(R)"
      Height          =   300
      Left            =   2520
      TabIndex        =   6
      Top             =   300
      Width           =   1000
   End
   Begin VB.TextBox Text3 
      Height          =   270
      Left            =   1080
      TabIndex        =   5
      Top             =   930
      Width           =   1200
   End
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   1080
      TabIndex        =   4
      Top             =   570
      Width           =   1200
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   1080
      TabIndex        =   3
      Top             =   210
      Width           =   1200
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   2400
      Top             =   0
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "退款金额"
      Height          =   180
      Left            =   240
      TabIndex        =   2
      Top             =   960
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "患者姓名"
      Height          =   180
      Left            =   240
      TabIndex        =   1
      Top             =   600
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "住院证号"
      Height          =   180
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   720
   End
End
Attribute VB_Name = "frmdf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
On Error GoTo err
If Text3.text > 0 Then
With Adodc1
.RecordSource = "select * from fyjl where 住院证号='" & Text1.text & "' and 患者姓名='" & Text2.text & "' and 操作员='" & frmlogin.username & "' and 收费日期=Date()"
.Refresh
If .Recordset.AbsolutePosition = adPosUnknown Then
.Recordset.AddNew
.Recordset.Fields(1) = Text1.text
.Recordset.Fields(2) = Text2.text
.Recordset.Fields(4) = Date
.Recordset.Fields(5) = -CCur(Text3.text)
.Recordset.Fields(6) = frmlogin.username
.Recordset.UpdateBatch
Else
.Recordset.Fields(5) = .Recordset.Fields(5) - CCur(Text3.text)
.Recordset.UpdateBatch
End If
Command1.Enabled = False
End With
Else
MsgBox "退款数额不能小于或等于零!"
End If
Exit Sub
err:
MsgBox "数据库连接失败!"
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
On Error GoTo err3
frmdf.Top = (frmmain.Height - frmdf.Height) / 2 - 500
frmdf.Left = (frmmain.Width - frmdf.Width) / 2
Adodc1.ConnectionString = frmlogin.conn
Command1.Enabled = False
Text3.text = 0
Exit Sub
err3:
MsgBox "数据库连接失败!"
End Sub

Private Sub Text1_Change()
On Error GoTo err1
With Adodc1
.RecordSource = "select * from fyjl where 住院证号='" & Text1.text & "'"
.Refresh
If .Recordset.AbsolutePosition <> adPosUnknown Then
Text2.text = .Recordset.Fields(2)
Command1.Enabled = True
Else
Command1.Enabled = False
Text2.text = ""
Text3.text = 0
End If
End With
Exit Sub
err1:
MsgBox "输入数据不正确或原始数据可能出错!"
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活动窗口:" & frmdf.Caption
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前没有窗口被激活"
End Sub
Private Sub Text3_Change()
If Not IsNumeric(Text3.text) Or Text3.text Like "%.%" Then
MsgBox "退款金额只能填入数值!"
Text3.text = 0
Text3.SetFocus
End If
End Sub
Private Sub Text3_Click()
Text3.SelStart = 0
Text3.SelLength = Len(Text3.text)
End Sub

⌨️ 快捷键说明

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