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

📄 frmsale2.frm

📁 自动售药系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      windowlessVideo =   0   'False
      enabled         =   -1  'True
      enableContextMenu=   0   'False
      fullScreen      =   0   'False
      SAMIStyle       =   ""
      SAMILang        =   ""
      SAMIFilename    =   ""
      captioningID    =   ""
      enableErrorDialogs=   0   'False
      _cx             =   6668
      _cy             =   4445
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "用途:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   7320
      TabIndex        =   3
      Top             =   1680
      Width           =   855
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   360
      TabIndex        =   0
      Top             =   2040
      Width           =   1455
   End
End
Attribute VB_Name = "frmSale2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public ypstr As String
Public gd As Integer


Private Sub Command1_Click()
'Dim rs As New ADODB.Recordset

' rs.Source = "select * from SaleTmpDB"
 'rs.ActiveConnection = Constr
 ' rs.CursorType = adOpenKeyset
' rs.LockType = adLockOptimistic
' rs.Open
' rs.AddNew
' rs.Fields(0).Value = tempid
' rs.Fields(1).Value = ypstr
' rs.Fields(2).Value = 1
' rs.Update
' rs.Close
'Unload Me
'frmSale3.Show (1)

Genie.Speak "正在识别请等待......", ""
'Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset

Dim j As Integer
j = 1
' rs.Source = "select * from SaleTmpDB"
' rs.ActiveConnection = Constr
' rs.Open
 'If rs.EOF Then rs.Cose: Exit Sub
  '  While Not rs.EOF
    
    
    rs1.Source = "select * from DrugsDB where Drugid='" & ypstr & "'"
    rs1.ActiveConnection = Constr
    rs1.Open
    If Not rs1.EOF Then
         ' Call Sleep(5000)
           Text5.Text = rs1!sgd
           addsale (ypstr)
         rs1.Close
         End If
    
    
    'rs.MoveNext
  '  Wend
  ' rs.Close
  ' delcart
  Call Sleep(3000)
  frmSaleerror2.Show (1)
   Genie.Show
   Genie.Speak "请在取药口取出您所购买的药品,请在找零口取出您的找零.", ""
  ' Unload Me
   Call Sleep(1000)
   'Genie.Speak "谢谢您使用自动诊疗咨询售药机。期待您的再次光临", ""
  ' Unload frmSale2
   'Unload frmSale
End Sub

Private Sub Form_Load()
    Me.Adodc1.ConnectionString = Constr
    Adodc1.CommandType = adCmdText
  strSQL = "select spicture,Specification,storeprice,DrugUsage from DrugsDB where DrugID='" & ypstr & "'"
  Adodc1.RecordSource = strSQL
  Me.Adodc1.Refresh
      If Me.MSComm1.PortOpen Then
        Me.MSComm1.PortOpen = False
        End If
  test_ok = 0
  Dim rs As New ADODB.Recordset
 rs.Source = "select * from DrugsDB where DrugID='" & ypstr & "'"
 rs.ActiveConnection = Constr
 rs.Open
If rs!adpath <> "" Then
  'MsgBox rs!adpath
  WindowsMediaPlayer1.URL = rs!adpath
  WindowsMediaPlayer1.Controls.Play
  End If
  Label5.Caption = "金额:" & Text1.Text & "元"
End Sub

Private Sub Form_Unload(Cancel As Integer)
WindowsMediaPlayer1.Close
End Sub

Private Sub ImageButton1_Click()
'Dim rs As New ADODB.Recordset

' rs.Source = "select * from SaleTmpDB"
 'rs.ActiveConnection = Constr
 ' rs.CursorType = adOpenKeyset
' rs.LockType = adLockOptimistic
' rs.Open
' rs.AddNew
' rs.Fields(0).Value = tempid
' rs.Fields(1).Value = ypstr
' rs.Fields(2).Value = 1
' rs.Update
' rs.Close
'Unload Me
'frmSale3.Show (1)

Genie.Speak "正在识别请等待......", ""
'Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset

Dim j As Integer
j = 1
' rs.Source = "select * from SaleTmpDB"
' rs.ActiveConnection = Constr
' rs.Open
 'If rs.EOF Then rs.Cose: Exit Sub
  '  While Not rs.EOF
    
    
    rs1.Source = "select * from DrugsDB where Drugid='" & ypstr & "'"
    rs1.ActiveConnection = Constr
    rs1.Open
    If Not rs1.EOF Then
         ' Call Sleep(5000)
           Text5.Text = rs1!sgd
           addsale (ypstr)
         rs1.Close
         End If
    
    
    'rs.MoveNext
  '  Wend
  ' rs.Close
  ' delcart
  Call Sleep(3000)
  frmSaleerror2.Show (1)
   Genie.Show
   Genie.Speak "请在取药口取出您所购买的药品,请在找零口取出您的找零.", ""
  ' Unload Me
   Call Sleep(1000)
   'Genie.Speak "谢谢您使用自动诊疗咨询售药机。期待您的再次光临", ""
  ' Unload frmSale2
   'Unload frmSale

End Sub

Private Sub ImageButton2_Click()
Unload Me
End Sub

Private Sub ImageButton3_Click()
Dim rs As New ADODB.Recordset

 rs.Source = "select * from SaleTmpDB"
 rs.ActiveConnection = Constr
  rs.CursorType = adOpenKeyset
 rs.LockType = adLockOptimistic
 rs.Open
 rs.AddNew
 rs.Fields(0).Value = tempid
 rs.Fields(1).Value = ypstr
 rs.Fields(2).Value = 1
 rs.Update
 rs.Close
 Unload Me
End Sub

Private Sub Label1_Click()
Unload Me
End Sub


Private Sub Picture2_Click()

End Sub

Private Sub Picture3_Click()

End Sub

Private Sub Picture4_Click()

End Sub

Private Sub Timer1_Timer()
delay_ms = delay_ms + 1
If delay_ms > 10 Then
delay_ms = 0
End If
End Sub

Private Sub Timer2_Timer()
Timer2.Enabled = False
reset
If ValBit(CL_FOOD(0), 0) Then
 ImageButton1.Enabled = False
End If
'If ValBit(CL_FOOD(0), 1) Then
'Command2.Enabled = False
'End If
Timer2.Enabled = True
End Sub
Public Sub reset()    '一个简单的数组传递
 Dim databyte(2) As Byte
databyte(0) = &H88
databyte(1) = CByte(Text5.Text)
databyte(2) = databyte(0) + databyte(1)



     If Not Me.MSComm1.PortOpen Then
'        Me.MSComm1.PortOpen = True
    End If
    Me.MSComm1.InputMode = comInputModeBinary
'    Me.MSComm1.RThreshold = 16
   
    
    Me.MSComm1.settings = "9600,m,8,1" 'mode bit 1
 '   Me.MSComm1.Output = databyte
      '  Text2.Text = ""
    Me.MSComm1.settings = "9600,m,8,1"
End Sub

Private Sub MSComm1_OnComm()
 Dim intInputLen As Integer
    Dim temp As String
    Dim i As Integer
    
    
        
        intInputLen = MSComm1.InBufferCount
        If intInputLen = 0 Then
            Exit Sub
        End If
    
     If intInputLen > 15 Then
        MyArr = MSComm1.Input
        CL_FOOD(0) = MyArr(2)
        CL_FOOD(1) = MyArr(3)
        CL_FOOD(2) = MyArr(4)
        CL_FOOD(3) = MyArr(5)
        CL_FOOD(4) = MyArr(6)
        CL_FOOD(5) = MyArr(7)
       ' if received cl message then clear text.tx
       If MyArr(14) = CByte(Text5.Text) Then
     
       Text5.Text = 0

       End If
       'money display still not correct now
        Text6.Text = MyArr(11) / 10
        'BELOW command enable
        If MyArr(11) >= 10 * Text1.Text Then
        ImageButton1.Enabled = True
        'Command2.Enabled = True
        End If
        
        
        If test < 2 Then
        test = CInt(MyArr(13))
        End If
        If intInputLen = 0 Then
            Exit Sub
        End If
     End If
     
End Sub
Function addsale(ypid As String)
Dim m, d
m = Month(Date)
d = Day(Date)
If m < 10 Then
m = "0" & m
End If
If d < 10 Then
d = "0" & d
End If
Dim rs As New ADODB.Recordset

 rs.Source = "select * from SaleDB"
 rs.ActiveConnection = Constr
  rs.CursorType = adOpenKeyset
 rs.LockType = adLockOptimistic
 rs.Open
 rs.AddNew
 rs.Fields(1).Value = ypid
 rs.Fields(2).Value = 1
 rs.Fields(3).Value = Year(Date) & m & d
 rs.Update
  rs.Close
  rs.Source = "select * from DrugsDB  where DrugID='" & ypid & "'"
 rs.ActiveConnection = Constr
  rs.CursorType = adOpenKeyset
 rs.LockType = adLockOptimistic
 rs.Open
 rs!storenum = rs!storenum - 1
 rs.Update
  rs.Close
End Function

Private Sub WindowsMediaPlayer1_EndOfStream(ByVal Result As Long)
WindowsMediaPlayer1.Controls.Play
End Sub

Private Sub WindowsMediaPlayer1_PlayStateChange(ByVal NewState As Long)
If NewState = 1 Then
WindowsMediaPlayer1.Controls.Play
End If
End Sub

⌨️ 快捷键说明

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