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

📄 单据打印类型.frm

📁 新世纪ERP系统管理源代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form XT_BillPrintType 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "打印类型编码设置"
   ClientHeight    =   2940
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3630
   Icon            =   "单据打印类型.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2940
   ScaleWidth      =   3630
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command4 
      Caption         =   "取消&C"
      Height          =   285
      Left            =   2490
      TabIndex        =   4
      Top             =   2550
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "删除&D"
      Height          =   285
      Left            =   2490
      TabIndex        =   3
      Top             =   1020
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "添加&N"
      Height          =   285
      Left            =   2520
      TabIndex        =   2
      Top             =   120
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修改&E"
      Height          =   285
      Left            =   2490
      TabIndex        =   1
      Top             =   570
      Width           =   975
   End
   Begin VB.ListBox List1 
      Height          =   2760
      Left            =   60
      TabIndex        =   0
      Top             =   90
      Width           =   2295
   End
End
Attribute VB_Name = "XT_BillPrintType"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Ssql As String

Private Sub Command1_Click()
    On Error GoTo err_exit
    If XT_BillDesign.WglrGrid.Visible = False Then MsgBox "此种单据类型不能修改类型!  ", 16: Exit Sub
    
    Dim valueStr As String
    Dim aDo_re As New Recordset
    If Trim(List1.Text) = "" Then MsgBox "请选定一个编码!  ", 48: Exit Sub
    valueStr = InputBox("编码名称", "打印类型编码设置---修改", Trim(List1.Text))
    If Trim(valueStr) = "" Then Exit Sub
    Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from Xt_BillGridPrint where PrintGridCode='" & Trim(valueStr) & "' AND PrintGridCode<>'" & Trim(List1.Text) & "' and grid_code='" & Trim(Me.Tag) & "'")
    If aDo_re.RecordCount > 0 Then MsgBox "编码不能重复!   ", 48: Exit Sub
    aDo_re.Close
    Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
    
    Ssql = "UPDATE Xt_BillGridPrint SET PrintGridCode='" & valueStr & "' WHERE PrintGridCode='" & Trim(List1.Text) & "' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
    Cw_DataEnvi.DataConnect.Execute Ssql
    Ssql = "UPDATE Xt_BilltextPrint SET PrinttextCode='" & valueStr & "' WHERE PrinttextCode='" & Trim(List1.Text) & "' and text_group_code='" & Trim(aDo_re!Grid_code) & "'"
    Cw_DataEnvi.DataConnect.Execute Ssql
    
    Form_Activate
    
    Exit Sub
err_exit:
    MsgBox Err.Description, 16
    
End Sub

Private Sub Command2_Click()
    On Error GoTo err_exit
    If XT_BillDesign.WglrGrid.Visible = False Then MsgBox "此种单据类型不能添加类型!  ", 16: Exit Sub
    Dim valueStr As String
    Dim aDo_re As New Recordset
    
    valueStr = InputBox("编码名称", "打印类型编码设置---添加", "")
    If Trim(valueStr) = "" Then Exit Sub
    Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from Xt_BillGridPrint where PrintGridCode='" & Trim(valueStr) & "' and grid_code='" & Trim(Me.Tag) & "'")
    If aDo_re.RecordCount > 0 Then MsgBox "编码不能重复!   ", 48: Exit Sub
    aDo_re.Close
    Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
    
    
    Ssql = "insert into Xt_BillGridPrint(Grid_Code,ColIndex,PrintGridCode,PrintGridHeight,PrintGridWidth,PrintGridTop,PrintGridLeft,PrintDataRows,PrintColWidth,BillTitlePrint)" _
    & " select Grid_Code,ColIndex,PrintGridCode='" & Trim(valueStr) & "',PrintGridHeight=GridHeight,PrintGridWidth=GridWidth,PrintGridTop=GridTop," _
    & "PrintGridLeft=GridLeft,PrintDataRows=3,PrintColWidth=ColWidth,BillTitlePrint='" & XT_BillDesign.Lab_Title.Caption & "' from xt_grid where grid_code='" & Trim(aDo_re!Grid_code) & "'"
    Cw_DataEnvi.DataConnect.Execute Ssql
    Ssql = "insert into Xt_BilltextPrint(text_group_code,text_index,PrintTextCode,PrintTop,PrintLeft,Printwidth) " _
    & " select text_group_code,text_index,PrintTextCode='" & Trim(valueStr) & "', PrintTop=texttop,PrintLeft=textleft,Printwidth=textwidth from Xt_text_input" _
    & " where text_group_code='" & Trim(aDo_re!text_group_code) & "'"
    Cw_DataEnvi.DataConnect.Execute Ssql
    Form_Activate
    
    Exit Sub
err_exit:
    MsgBox Err.Description, 16
    
End Sub

Private Sub Command3_Click()
    
    On Error GoTo err_exit
    Dim aDo_re As New Recordset
    
    Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
    If XT_BillDesign.WglrGrid.Visible = True Then
        Ssql = "delete Xt_BillGridPrint  WHERE PrintGridCode='" & Trim(List1.Text) & "' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
        Cw_DataEnvi.DataConnect.Execute Ssql
    End If
    Ssql = "delete Xt_BilltextPrint  WHERE PrinttextCode='" & Trim(List1.Text) & "' and text_group_code='" & Trim(aDo_re!text_group_code) & "'"
    Cw_DataEnvi.DataConnect.Execute Ssql
    
    Form_Activate
    
    Exit Sub
err_exit:
    MsgBox Err.Description, 16
End Sub

Private Sub Command4_Click()
    Unload Me
End Sub

Private Sub Form_Activate()
    Dim aDo_Printtype As New Recordset
    List1.Clear
    Dim aDo_re As New Recordset
    Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
    If XT_BillDesign.WglrGrid.Visible = True Then
        Ssql = "select * from Xt_BillGridPrint where colindex='000' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
        Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
        Do While Not aDo_Printtype.EOF
            List1.AddItem aDo_Printtype!printgridcode
            aDo_Printtype.MoveNext
        Loop
Else: Ssql = "select * from Xt_BillTextPrint where text_group_code='" & Trim(aDo_re!text_group_code) & "'"
        Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
        If aDo_Printtype.RecordCount < 1 Then Exit Sub
        List1.AddItem "Default"
    End If
End Sub

⌨️ 快捷键说明

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