📄 frmbookmodifyinfo.frm
字号:
TabIndex = 39
Top = 4440
Width = 900
End
Begin VB.Label Label17
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "内容简介:"
Height = 180
Left = -74640
TabIndex = 38
Top = 2604
Width = 900
End
Begin VB.Label Label16
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出版日期:"
Height = 180
Left = -74640
TabIndex = 37
Top = 2170
Width = 900
End
Begin VB.Label Label14
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "库存总量:"
Height = 180
Left = -74640
TabIndex = 35
Top = 1108
Width = 900
End
Begin VB.Label Label13
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "现 存 量:"
Height = 180
Left = -74640
TabIndex = 34
Top = 570
Width = 900
End
Begin VB.Label Label12
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书价格:"
Height = 180
Left = 360
TabIndex = 33
Top = 5850
Width = 900
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书页数:"
Height = 180
Left = 360
TabIndex = 32
Top = 5370
Width = 900
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出版地点:"
Height = 180
Left = 360
TabIndex = 30
Top = 4890
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出版社名:"
Height = 180
Left = 360
TabIndex = 28
Top = 4410
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "译 者:"
Height = 180
Left = 360
TabIndex = 27
Top = 3930
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "作 者:"
Height = 180
Left = 360
TabIndex = 26
Top = 3450
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "书架位置:"
Height = 180
Left = 360
TabIndex = 25
Top = 2970
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类别名称:"
Height = 180
Left = 360
TabIndex = 23
Top = 2490
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类别编号:"
Height = 180
Left = 360
TabIndex = 21
Top = 2010
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "标准ISBN:"
Height = 180
Left = 360
TabIndex = 20
Top = 1530
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书名称:"
Height = 180
Left = 360
TabIndex = 19
Top = 1050
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书编号:"
Height = 180
Left = 360
TabIndex = 17
Top = 577
Width = 900
End
End
Begin VB.PictureBox Picbg1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 1440
Left = 6480
Picture = "frmbookmodifyinfo.frx":1989A
ScaleHeight = 1440
ScaleWidth = 1440
TabIndex = 43
Top = 720
Width = 1440
End
Begin VB.Shape Shape1
BorderColor = &H8000000A&
Height = 2295
Left = 6360
Top = 3960
Width = 1455
End
End
Attribute VB_Name = "frmbookmodifyinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'-------------------------------------------------------
' 作者:龙茂春
' 功能:修改图书信息
'-------------------------------------------------------
Dim total As Integer
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdsave_Click()
Dim rs As ADODB.Recordset
Dim sql As String
sql = "select * from tsxxb where 图书编号='" & Trim(txt图书编号.Text) & "'"
If Trim(txt图书名称.Text) = "" Then
MsgBox "图书名称不能为空!", vbOKOnly
Else
Set rs = TransactSQL(sql) '修改数据库中的纪录
rs.Fields(1) = Trim(txt图书名称.Text)
rs.Fields(2) = Trim(txtISBN.Text)
rs.Fields(3) = Trim(txt类别编号.Text)
rs.Fields(4) = Trim(txt类别名称.Text)
rs.Fields(5) = Trim(txt书架位置.Text)
rs.Fields(6) = Trim(txt作者.Text)
rs.Fields(7) = Trim(txt译者.Text)
rs.Fields(8) = Trim(txt出版社名.Text)
rs.Fields(9) = Trim(txt出版地点.Text)
rs.Fields(10) = Val(txt图书页数.Text)
rs.Fields(11) = Format(Val(txt图书价格.Text), "0.00")
rs.Fields(12) = Val(txt现存量.Text)
rs.Fields(13) = Val(txt库存总量.Text)
rs.Fields(16) = DTP入库日期.Value
rs.Fields(17) = DTP出版日期.Value
rs.Fields(18) = Trim(txt内容简介.Text)
rs.Fields(19) = Trim(txt备注.Text)
rs.Fields(20) = user
rs.Update
rs.Close
If Trim(txt图书名称.Text) <> Trim(frmbookmanage.bookGrid.TextMatrix(frmbookmanage.bookGrid.Row, 1)) Then
'更新其他表中的图书书称
sql = "update jsxxb set 图书名称='" & Trim(txt图书名称.Text) & "' where 图书编号='" & Trim(txt图书编号.Text) & "'"
TransactSQL (sql) '借书信息表
sql = "update hsxxb set 图书名称='" & Trim(txt图书名称.Text) & "' where 图书编号='" & Trim(txt图书编号.Text) & "'"
TransactSQL (sql) '还书信息表
sql = "update fkxxb set 图书名称='" & Trim(txt图书名称.Text) & "' where 图书编号='" & Trim(txt图书编号.Text) & "'"
TransactSQL (sql) '罚款信息表
End If
Call frmbookmanage.bookone_update(Trim(txt图书编号.Text), False) '更新frmbookmanage中bookGrid的记录
frmbookmanage.bookGrid.Refresh
frmbookmanage.cmdmodify.Enabled = False
Unload Me
Unload frmbookmanage
frmbookmanage.Show
End If
End Sub
Private Sub cmd出版社选择_Click()
Dim sql As String
sql = "select * from cbslbb"
If TransactSQL(sql).EOF Then
MsgBox "请到出版社资料管理添加出版社资料,再继续录入图书信息。", vbOKOnly
Else
frmbookmanage.bookinfo = False
frmbookinfo_choose.Show 1
End If
End Sub
Private Sub cmd类别选择_Click()
Dim sql As String
sql = "select * from tslbb"
If TransactSQL(sql).EOF Then
MsgBox "请到书籍类别管理添加书籍类别,再继续录入图书信息。", vbOKOnly
Else
frmbookmanage.bookinfo = True
frmbookinfo_choose.Show 1
End If
End Sub
Private Sub Form_Load()
Call fullpic(Me, Picbg1) '背景图
Me.Left = (frmmain.ScaleWidth - Me.Width) / 2
Me.Top = (frmmain.ScaleHeight - Me.Height) / 2
frmbookmanage.bookflag = False '表示是修改窗体
With frmbookmanage.bookGrid
txt图书编号.Text = .TextMatrix(.Row, 0)
txt图书编号.Locked = True
txt图书名称.Text = .TextMatrix(.Row, 1)
txtISBN.Text = .TextMatrix(.Row, 2)
txt类别编号.Text = .TextMatrix(.Row, 3)
txt类别名称.Text = .TextMatrix(.Row, 4)
txt书架位置.Text = .TextMatrix(.Row, 5)
txt作者.Text = .TextMatrix(.Row, 6)
txt译者.Text = .TextMatrix(.Row, 7)
txt出版社名.Text = .TextMatrix(.Row, 8)
txt出版地点.Text = .TextMatrix(.Row, 9)
txt图书页数.Text = .TextMatrix(.Row, 10)
txt图书价格.Text = Format(Val(.TextMatrix(.Row, 11)), "0.00")
txt现存量.Text = .TextMatrix(.Row, 12)
txt库存总量.Text = .TextMatrix(.Row, 13)
DTP入库日期.Value = .TextMatrix(.Row, 16)
DTP出版日期.Value = .TextMatrix(.Row, 17)
txt内容简介.Text = .TextMatrix(.Row, 18)
txt备注.Text = .TextMatrix(.Row, 19)
End With
total = 0
Dim rs As ADODB.Recordset
Dim sql As String
sql = "select 借阅数量 from jsxxb where 图书编号='" & Trim(txt图书编号.Text) & "'"
Set rs = TransactSQL(sql)
If Not rs.EOF Then
While Not rs.EOF
total = total + rs(0)
rs.MoveNext
Wend
Else
total = 0
End If
rs.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmbookmanage.Show
frmbookmanage.SetFocus
End Sub
Private Sub txt图书价格_Change()
If Not IsNumeric(txt图书价格.Text) And txt图书价格.Text <> "" Then
MsgBox "只能输入数值!", vbCritical + vbOKOnly, "错误"
txt图书价格.Text = Format(Val(frmbookmanage.bookGrid.TextMatrix(frmbookmanage.bookGrid.Row, 11)), "0.00")
End If
End Sub
Private Sub txt图书页数_Change()
If Not IsNumeric(txt图书页数.Text) And txt图书页数.Text <> "" Then
MsgBox "只能输入数值!", vbCritical + vbOKOnly, "错误"
txt图书页数.Text = frmbookmanage.bookGrid.TextMatrix(frmbookmanage.bookGrid.Row, 10)
End If
End Sub
Private Sub txt现存量_Change()
Dim total As Integer
If Not IsNumeric(txt现存量.Text) And txt现存量.Text <> "" Then
MsgBox "只能输入数值!", vbCritical + vbOKOnly, "错误"
txt现存量.Text = frmbookmanage.bookGrid.TextMatrix(frmbookmanage.bookGrid.Row, 12)
txt库存总量.Text = frmbookmanage.bookGrid.TextMatrix(frmbookmanage.bookGrid.Row, 13)
Else
txt库存总量.Text = txt现存量.Text + total
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -