📄 frmin_pztempletlist.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmIN_PzTempletList
BorderStyle = 3 'Fixed Dialog
Caption = "凭证模板列表"
ClientHeight = 5490
ClientLeft = 45
ClientTop = 330
ClientWidth = 7635
Icon = "frmIN_PzTempletList.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5490
ScaleWidth = 7635
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSComctlLib.ImageList ilsTbr
Left = 4620
Top = 300
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 9
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":000C
Key = "Preview"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":0550
Key = "Print"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":0A94
Key = "Append"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":0EEC
Key = "Delete"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":1000
Key = "Quit"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":145C
Key = "Help"
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":1570
Key = "Design"
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":19C8
Key = "Edit"
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmIN_PzTempletList.frx":1E1C
Key = "Paste"
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar tBr
Align = 1 'Align Top
Height = 555
Left = 0
TabIndex = 1
Top = 0
Width = 7635
_ExtentX = 13467
_ExtentY = 979
ButtonWidth = 820
ButtonHeight = 926
AllowCustomize = 0 'False
Appearance = 1
Style = 1
ImageList = "ilsTbr"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 12
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "打印"
Key = "Print"
ImageKey = "Print"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "预览"
Key = "Preview"
ImageKey = "Preview"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "增加"
Key = "Append"
ImageKey = "Append"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "Edit"
ImageKey = "Edit"
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "Delete"
ImageKey = "Delete"
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "设计"
Key = "Design"
ImageKey = "Design"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "导入"
Key = "Guide"
ImageKey = "Paste"
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "帮助"
Key = "Help"
ImageKey = "Help"
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "Quit"
ImageKey = "Quit"
EndProperty
EndProperty
BorderStyle = 1
End
Begin MSFlexGridLib.MSFlexGrid mFg
Height = 4875
Left = -30
TabIndex = 0
Top = 600
Width = 7725
_ExtentX = 13626
_ExtentY = 8599
_Version = 393216
FixedCols = 0
BackColor = -2147483634
BackColorFixed = -2147483624
ForeColorFixed = 4210816
TextStyleFixed = 1
GridLinesFixed = 1
End
End
Attribute VB_Name = "frmIN_PzTempletList"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim CGrid As clsGrid
Public OnGuideState As Boolean
Public Ok As Boolean
Private m_TempletCode As String
Private m_TempletVoucherType As String
Private m_TempletVoucherAffix As Integer
Public Property Get usTempletCode() As String
usTempletCode = m_TempletCode
End Property
Public Property Get usTempletVoucherType() As String
usTempletVoucherType = m_TempletVoucherType
End Property
Public Property Get uiTempletVoucherAffix() As Integer
uiTempletVoucherAffix = m_TempletVoucherAffix
End Property
Private Sub Form_Initialize()
Ok = False
OnGuideState = False
End Sub
Private Sub form_load()
Set CGrid = New clsGrid
With CGrid
.Init mFg
.FormatString = "<模板编码|<模板说明|<凭证种类|<附件张数"
.Rows = 1
.SetRowHeight 0, 350
.WidthString = "1200,4000,1200,1200"
.TextFillType = gftOneRecordSet
.QueryString = "select * from tZW_TempletMain" & glo.sOperateYear & " order by cCode"
.SetHeadCenter
End With
If OnGuideState Then
tbr.Buttons("Guide").Enabled = True
End If
End Sub
Private Sub mFg_DblClick()
Call tbr_ButtonClick(tbr.Buttons("Design"))
End Sub
Private Sub mFg_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call tbr_ButtonClick(tbr.Buttons("Edit"))
End If
End Sub
Private Sub PrintAll(strPrt As String)
Dim frmP As frmPreview
Dim i As Integer
If Printers.Count = 0 Then
MsgBox "未安装打印机。", vbInformation
Else
Set frmP = New frmPreview
With frmP
.pControlType = pmsFlexGrid
.pControl = Me.mFg
.PaperWidth = Printer.Width
.PaperHeight = Printer.Height
.PaperScaleTop = Printer.ScaleTop
.PaperScaleLeft = 500 ' Printer.ScaleLeft
.PaperScaleWidth = Printer.ScaleWidth * 0.9
.PaperScaleHeight = Printer.ScaleHeight * 0.9
.Title = "凭证模板表"
.TitleFontBold = True
.TitleTop = 200
.HeadLeft = 700
.GridLeft = 700
If strPrt = "PRINT" Then
.ExcutePrint
Else
.ExcutePreview
End If
End With
Unload frmP
End If
End Sub
Private Sub tbr_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim frmD As frmIN_PzTempletDesign
Dim frmOne As frmIN_PzTempletNew
Dim adoCmd As ADODB.Command
Select Case Button.Key
Case "Print"
Call PrintAll("PRINT")
Case "Preview"
'frmUSU_Print.cdlgPrt.ShowPrinter
Call PrintAll("PREVIEW")
Case "Append"
Set frmOne = New frmIN_PzTempletNew
With frmOne
.Ok = False
.usFunction = "新增"
.usTempletCode = ""
.usTempletComment = ""
.usTempletPzzl = ""
.uiTempletFjzs = 0
.HelpContextID = 2
.Show 1, Me
If .Ok Then
mFg.Rows = mFg.Rows + 1
mFg.TextMatrix(mFg.Rows - 1, 0) = .usTempletCode
mFg.TextMatrix(mFg.Rows - 1, 1) = .usTempletComment
mFg.TextMatrix(mFg.Rows - 1, 2) = .usTempletPzzl
mFg.TextMatrix(mFg.Rows - 1, 3) = .uiTempletFjzs
Set adoCmd = New ADODB.Command
adoCmd.ActiveConnection = glo.cnnMain
adoCmd.CommandType = adCmdText
adoCmd.CommandText = "INSERT INTO tZW_TempletMain" & glo.sOperateYear & "(cCode," & _
"vcComment,cPzzl,tiFjzs) values('" & .usTempletCode & _
"','" & .usTempletComment & "','" & .usTempletPzzl & _
"'," & CStr(.uiTempletFjzs) & ")"
adoCmd.Execute
End If
End With
Case "Edit"
If mFg.Rows > 1 Then
Set frmOne = New frmIN_PzTempletNew
With frmOne
.Ok = False
.usFunction = "修改"
.usTempletCode = mFg.TextMatrix(mFg.Row, 0)
.usTempletComment = mFg.TextMatrix(mFg.Row, 1)
.usTempletPzzl = mFg.TextMatrix(mFg.Row, 2)
.uiTempletFjzs = Val(mFg.TextMatrix(mFg.Row, 3))
.HelpContextID = 2
.Show 1, Me
If .Ok Then
mFg.TextMatrix(mFg.Row, 1) = .usTempletComment
mFg.TextMatrix(mFg.Row, 2) = .usTempletPzzl
mFg.TextMatrix(mFg.Row, 3) = .uiTempletFjzs
Set adoCmd = New ADODB.Command
adoCmd.ActiveConnection = glo.cnnMain
adoCmd.CommandType = adCmdText
adoCmd.CommandText = "Update tZW_TempletMain" & glo.sOperateYear & " set vcComment='" & _
.usTempletComment & "',cPzzl='" & .usTempletPzzl & _
"',tiFjzs=" & CStr(.uiTempletFjzs) & " where cCode='" & _
.usTempletCode & "'"
adoCmd.Execute
End If
End With
End If
Case "Delete"
If mFg.Rows > 1 Then
If MsgBox("确实要删除吗?", vbQuestion + vbYesNo) = vbYes Then
Set adoCmd = New ADODB.Command
adoCmd.ActiveConnection = glo.cnnMain
adoCmd.CommandType = adCmdText
adoCmd.CommandText = "Delete from tZW_TempletMain" & glo.sOperateYear & " where rtrim(cCode)='" & _
mFg.TextMatrix(mFg.Row, 0) & "'"
adoCmd.Execute
'=====================================================2002.9.12 yao revise==============================================
adoCmd.CommandText = "delete from tZW_TempletDetail" & glo.sOperateYear & " where rtrim(cCode)='" & _
mFg.TextMatrix(mFg.Row, 0) & "'"
adoCmd.Execute
'===========================================================================================================================
If mFg.Rows = 2 Then
mFg.Rows = 1
Else
mFg.RemoveItem mFg.Row
End If
End If
End If
Case "Design"
If mFg.Rows > 1 Then
Set frmD = New frmIN_PzTempletDesign
With frmD
.usTempletCode = CGrid.GetCellText(mFg.Row, 0)
.usVoucherType = CGrid.GetCellText(mFg.Row, 2)
.uiAffixPieces = Val(CGrid.GetCellText(mFg.Row, 3))
.ExecuteDesign
.HelpContextID = 2
End With
End If
Case "Guide"
If mFg.Row > 0 Then
m_TempletCode = mFg.TextMatrix(mFg.Row, 0)
m_TempletVoucherType = mFg.TextMatrix(mFg.Row, 2)
m_TempletVoucherAffix = Val(mFg.TextMatrix(mFg.Row, 3))
Ok = True
Me.Hide
End If
Case "Help"
Call ShowHelp
Case "Quit"
Unload Me
Unload frmUSU_Print
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -