📄 frmbookinformation.frm
字号:
AutoSize = -1 'True
Caption = "分类号:"
Height = 180
Index = 1
Left = 240
TabIndex = 11
Top = 480
Width = 630
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "简介:"
Height = 180
Index = 3
Left = 240
TabIndex = 10
Top = 2400
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "定价:"
Height = 180
Index = 4
Left = 240
TabIndex = 9
Top = 1200
Width = 450
End
End
Begin VB.PictureBox Picture1
Height = 7575
Index = 1
Left = 5600
ScaleHeight = 7515
ScaleWidth = 3900
TabIndex = 7
TabStop = 0 'False
Top = 0
Width = 3960
Begin MSDataGridLib.DataGrid DataGrid1
Height = 4170
Left = 0
TabIndex = 5
Top = 0
Width = 3795
_ExtentX = 6694
_ExtentY = 7355
_Version = 393216
AllowUpdate = 0 'False
BorderStyle = 0
HeadLines = 2
RowHeight = 17
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = "图书ID"
Caption = "图书ID"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "入册日期"
Caption = "入册日期"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 1
Format = "yyyy-MM-dd"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 1574.929
EndProperty
BeginProperty Column01
ColumnWidth = 2055.118
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmBookInformation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim WithEvents rs As ADODB.Recordset
Attribute rs.VB_VarHelpID = -1
Private Sub cmdPrint_Click()
Dim dpNew As New DrpBookCard
frmSetPage.Show vbModal
If frmSetPage.bOK = 0 Then Exit Sub
'打印设置
dpNew.TopMargin = frmSetPage.intTop
dpNew.LeftMargin = frmSetPage.intLeft
dpNew.RightMargin = frmSetPage.intRight
dpNew.BottomMargin = frmSetPage.intBottom
dpNew.Sections("Section1").ForcePageBreak = rptPageBreakAfter
Set dpNew.DataSource = rs.Clone
dpNew.Show
End Sub
Private Sub Form_Activate()
fMain.RsNumber Tag
End Sub
Private Sub Form_Load()
StateForm
DTPicker1(0) = DateAdd("M", -1, Date)
DTPicker1(1) = Date
OpenRs "", "", 3, Date, Date
End Sub
Private Sub Form_Resize()
ReFrom
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
rs.Close
Set rs = Nothing
Set frmBookRegister = Nothing
End Sub
Private Sub imgPhoto_Click()
Dim frmNewWin As New frmPhoto
frmNewWin.imgPhoto.Picture = imgPhoto.Picture
frmNewWin.Show vbModal
Set frmNewWin = Nothing
End Sub
Private Sub rs_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error Resume Next
Dim intRsPos As Integer, intRsCount As Integer
intRsPos = rs.AbsolutePosition
intRsCount = rs.RecordCount
If intRsPos > 0 Then
cmdPrint.Enabled = True
Else
cmdPrint.Enabled = False
End If
Tag = Caption & Space(3) & "当前位置:" & _
intRsPos & Space(3) & "记录总数:" & intRsCount
fMain.RsNumber Tag
End Sub
Private Sub StateForm()
'设置树形查询搜索框的节点
Dim mNode As Node
Dim strNodeKeyLb As String
Dim strNodeKeyTs As String
Dim rsSetSort As ADODB.Recordset
Dim rsSetBookID As ADODB.Recordset
Set mNode = TreeView1.Nodes.Add(, tvwFirst, "RTNODE")
mNode.Text = "搜索"
'取得成员节点
Set rsSetSort = mCdt.rsBookSort
Do Until rsSetSort.EOF
strNodeKeyLb = "ST" & rsSetSort("类别代码")
Set mNode = TreeView1.Nodes.Add("RTNODE", tvwNext, strNodeKeyLb)
mNode.Text = rsSetSort("类别代码") & ":" & rsSetSort("命名描述")
mNode.Tag = rsSetSort("类别代码")
Set rsSetBookID = mCdt.rsBookIDList(rsSetSort("类别代码"))
Do Until rsSetBookID.EOF
strNodeKeyTs = "BK" & rsSetBookID("图书编码")
Set mNode = TreeView1.Nodes.Add(strNodeKeyLb, tvwChild, strNodeKeyTs)
mNode.Text = rsSetBookID("图书编码") & ":" & rsSetBookID("书名")
mNode.Tag = rsSetBookID("图书编码")
rsSetBookID.MoveNext
Loop
rsSetBookID.Close
rsSetSort.MoveNext
Loop
rsSetSort.Close
Set rsSetBookID = Nothing
Set rsSetSort = Nothing
TreeView1.Nodes.Remove "RTNODE"
cboModality.AddItem "在库"
cboModality.AddItem "借出"
cboModality.AddItem "丢失"
cboModality.ListIndex = 0
End Sub
Private Sub OpenRs(ByVal strSort As String, ByVal strBook As String, _
ByVal Modality As Byte, dtDate1 As Date, dtDate2 As Date)
On Error Resume Next
'从数据源取得记录集
rs.Close
Set rs = mCdt.rsBookInformation(strSort, strBook, Modality, dtDate1, dtDate2)
Set lblID.DataSource = rs
lblID.DataField = "图书编码"
Set lblBookName.DataSource = rs
lblBookName.DataField = "书名"
Set lblSort.DataSource = rs
lblSort.DataField = "类别代码"
Set lblPrice.DataSource = rs
lblPrice.DataField = "定价"
Set lblAuthor.DataSource = rs
lblAuthor.DataField = "作者"
Set lblBookConcern.DataSource = rs
lblBookConcern.DataField = "出版单位"
Set txtSynopsis.DataSource = rs
txtSynopsis.DataField = "简介"
Set imgPhoto.DataSource = rs
imgPhoto.DataField = "照片"
Set DataGrid1.DataSource = rs
End Sub
Public Sub ReFrom()
On Error Resume Next
'调整控件位置、大小
If Width < 5680 Then Width = 5680
If Height < 7600 Then Height = 7600
Picture1(1).Move 5565, 0, Width - 5680, Height - 400
DataGrid1.Move 0, 0, Picture1(1).Width - 60, Picture1(1).Height - 60
Frame1.Height = Height - 5200
TreeView1.Height = Height - 6800
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Dim strSort As String, strBook As String
If Left(Node.Key, 2) = "ST" Then
strSort = Node.Tag
strBook = "%"
ElseIf Left(Node.Key, 2) = "BK" Then
strSort = Node.Parent.Tag
strBook = Node.Tag
End If
OpenRs strSort, strBook, cboModality.ListIndex, DTPicker1(0), DTPicker1(1)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -