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

📄 frmmadd.frm

📁 自动售药系统
💻 FRM
📖 第 1 页 / 共 4 页
字号:
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Index           =   0
      Left            =   3840
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      TabIndex        =   5
      Text            =   "frmMadd.frx":208BF
      Top             =   2520
      Width           =   1575
   End
   Begin VB.CommandButton Command3 
      Height          =   495
      Left            =   720
      Picture         =   "frmMadd.frx":208C5
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   2520
      Width           =   2055
   End
   Begin VB.CommandButton Command6 
      Height          =   495
      Left            =   720
      Picture         =   "frmMadd.frx":25203
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3120
      Width           =   2055
   End
   Begin VB.CommandButton Command7 
      Height          =   495
      Left            =   720
      Picture         =   "frmMadd.frx":29B93
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   3720
      Width           =   2055
   End
   Begin VB.CommandButton Command8 
      Height          =   495
      Left            =   720
      Picture         =   "frmMadd.frx":2E5E2
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   4920
      Width           =   2055
   End
   Begin VB.CommandButton Command9 
      Height          =   495
      Left            =   720
      Picture         =   "frmMadd.frx":32FCA
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   4320
      Width           =   2055
   End
   Begin VB.Menu gdh 
      Caption         =   "轨道货物"
      Visible         =   0   'False
      Begin VB.Menu add 
         Caption         =   "补货"
      End
      Begin VB.Menu del 
         Caption         =   "卸货"
      End
      Begin VB.Menu change 
         Caption         =   "指定药品"
      End
      Begin VB.Menu view 
         Caption         =   "查看信息"
      End
      Begin VB.Menu u 
         Caption         =   "-"
      End
      Begin VB.Menu clear 
         Caption         =   "清空轨道"
      End
      Begin VB.Menu closeg 
         Caption         =   "关闭轨道"
      End
      Begin VB.Menu openg 
         Caption         =   "打开轨道"
      End
   End
End
Attribute VB_Name = "frmMadd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private ck As Integer
Private act As Integer


Private Sub add_Click()
act = 0
txtPwd.Text = ""
lsm.Caption = Text1(ck).Text & ",请输入补货数量:"
picnum.Visible = True
End Sub

Private Sub change_Click()
frmSelect.gd = ck + 1
frmSelect.Show (1)
loaddata
End Sub

Private Sub Command2_Click()
Unload Me
frmMadd.Show (1)

End Sub

Private Sub clear_Click()
Dim rs As New ADODB.Recordset
  rs.Source = "select * from DrugsDB  where DrugID='" & Text1(ck).Tag & "'"
 rs.ActiveConnection = Constr
  rs.CursorType = adOpenKeyset
 rs.LockType = adLockOptimistic
 rs.Open
 rs!del_flg = "1"
 rs!StoreNum = 0
 rs!sgd = 0
 rs.Update
  rs.Close
  loaddata
End Sub

Private Sub closeg_Click()
Dim rs As New ADODB.Recordset
  rs.Source = "select * from DrugsDB  where sgd=" & ck + 1
 rs.ActiveConnection = Constr
  rs.CursorType = adOpenKeyset
 rs.LockType = adLockOptimistic
 rs.Open
 rs!forsale = "0"
 rs.Update
  rs.Close
  loaddata
End Sub

Private Sub Command3_Click()
Unload Me
frmMsale.Show (1)
End Sub

Private Sub Command4_Click()
Unload Me
frmMdel.Show (1)
End Sub

Private Sub Command5_Click()
Unload Me
frmMpd.Show (1)
End Sub

Private Sub Command6_Click()
Unload Me
frmMadd.Show (1)
End Sub

Private Sub Command7_Click()
'Unload Me
frmMchpwd.Show (1)
End Sub

Private Sub Command8_Click()
Unload Me
frmMsystem.Show (1)
End Sub

Private Sub Command9_Click()
Unload Me
frmMotc.Show (1)
End Sub

Private Sub Image1_Click()
End Sub

Private Sub del_Click()
act = 1
txtPwd.Text = ""
lsm.Caption = Text1(ck).Text & ",请输入卸货数量:"
picnum.Visible = True
End Sub

Private Sub Form_Load()
loaddata
End Sub

Private Sub Label13_Click()
picnum.Visible = False
End Sub

Private Sub openg_Click()
Dim rs As New ADODB.Recordset
  rs.Source = "select * from DrugsDB  where sgd=" & ck + 1
 rs.ActiveConnection = Constr
  rs.CursorType = adOpenKeyset
 rs.LockType = adLockOptimistic
 rs.Open
 rs!forsale = "1"
 rs.Update
  rs.Close
  loaddata

End Sub

Private Sub Text1_Click(Index As Integer)
ck = Index
Dim rs As New ADODB.Recordset
  rs.Source = "select * from DrugsDB  where sgd=" & ck + 1
  rs.ActiveConnection = Constr
  rs.CursorType = adOpenKeyset
 rs.LockType = adLockOptimistic
 rs.Open
 If Not rs.EOF Then
 If rs!forsale = "0" Then
 add.Enabled = False
 del.Enabled = False
 view.Enabled = False
 closeg.Enabled = False
 openg.Enabled = True
 change.Enabled = False
 clear.Enabled = False
  Else
 add.Enabled = True
 del.Enabled = True
 view.Enabled = True
 closeg.Enabled = True
 openg.Enabled = False
 change.Enabled = False
 clear.Enabled = True
 End If
 Else
 add.Enabled = False
 del.Enabled = False
 view.Enabled = False
 closeg.Enabled = False
 openg.Enabled = False
 clear.Enabled = False
 change.Enabled = True
 End If
PopupMenu gdh
End Sub
Private Sub Label1_Click()
txtPwd.Text = txtPwd & "7"
End Sub

Private Sub Label10_Click()
txtPwd.Text = txtPwd & "0"
End Sub

Private Sub Label11_Click()
If txtPwd.Text <> "" Then
Select Case act
      Case 0
      Call addsale(Text1(ck).Tag, txtPwd.Text)
      Case 1
      Call addsale(Text1(ck).Tag, -txtPwd.Text)
      Case Else
         
   End Select
loaddata
picnum.Visible = False
End If

End Sub

Private Sub Label12_Click()
If Len(txtPwd.Text) > 0 Then
txtPwd.Text = Left(txtPwd.Text, Len(txtPwd.Text) - 1)
End If
End Sub

Private Sub Label2_Click()
txtPwd.Text = txtPwd & "8"
End Sub

Private Sub Label3_Click()
txtPwd.Text = txtPwd & "9"
End Sub

Private Sub Label4_Click()
txtPwd.Text = txtPwd & "4"
End Sub
Private Sub Label5_Click()
txtPwd.Text = txtPwd & "5"
End Sub

Private Sub Label6_Click()
txtPwd.Text = txtPwd & "6"
End Sub

Private Sub Label7_Click()
txtPwd.Text = txtPwd & "1"
End Sub

Private Sub Label8_Click()
txtPwd.Text = txtPwd & "2"
End Sub

Private Sub Label9_Click()
txtPwd.Text = txtPwd & "3"
End Sub

Private Sub txtPwd_DblClick()
picnum.Visible = False
End Sub

Private Sub view_Click()
frmView.ypstr = Text1(ck).Tag
frmView.Show (1)
loaddata
End Sub
Function addsale(ypid As String, num As Integer)
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 + num
 rs.Update
  rs.Close
End Function

Function loaddata()
Dim i As Integer
Dim rs As New ADODB.Recordset

For i = 0 To 44 Step 1
'Text1(i).Text = "轨道" & i + 1 & ":"

 rs.Source = "select * from DrugsDB where sgd=" & i + 1
 rs.ActiveConnection = Constr
 rs.Open
 'If rs.EOF Then rs.Cose: Exit Sub
    If Not rs.EOF Then
      If rs!forsale = "0" Then
        Text1(i).Text = "轨道" & i + 1 & ":已经关闭"
       Else
           Text1(i).Text = "轨道" & i + 1 & ":" & rs!Name & "(" & rs!StoreNum & ")价格(" & rs!StorePrice & ")"
      End If
     Text1(i).Tag = rs!DrugID
    Else
    Text1(i).Text = "轨道" & i + 1 & ":已经清空"
   End If
   rs.Close
   
   Next
End Function

⌨️ 快捷键说明

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