上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:7k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form XT_BillPrintType 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "打印类型编码设置"
  5.    ClientHeight    =   2940
  6.    ClientLeft      =   1260
  7.    ClientTop       =   1665
  8.    ClientWidth     =   3630
  9.    Icon            =   "单据打印类型.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2940
  14.    ScaleWidth      =   3630
  15.    Begin VB.CommandButton Command4 
  16.       Caption         =   "取消&C"
  17.       Height          =   285
  18.       Left            =   2490
  19.       TabIndex        =   4
  20.       Top             =   2550
  21.       Width           =   975
  22.    End
  23.    Begin VB.CommandButton Command3 
  24.       Caption         =   "删除&D"
  25.       Height          =   285
  26.       Left            =   2490
  27.       TabIndex        =   3
  28.       Top             =   1020
  29.       Width           =   975
  30.    End
  31.    Begin VB.CommandButton Command2 
  32.       Caption         =   "添加&N"
  33.       Height          =   285
  34.       Left            =   2520
  35.       TabIndex        =   2
  36.       Top             =   120
  37.       Width           =   975
  38.    End
  39.    Begin VB.CommandButton Command1 
  40.       Caption         =   "修改&E"
  41.       Height          =   285
  42.       Left            =   2490
  43.       TabIndex        =   1
  44.       Top             =   570
  45.       Width           =   975
  46.    End
  47.    Begin VB.ListBox List1 
  48.       Height          =   2760
  49.       Left            =   60
  50.       TabIndex        =   0
  51.       Top             =   90
  52.       Width           =   2295
  53.    End
  54. End
  55. Attribute VB_Name = "XT_BillPrintType"
  56. Attribute VB_GlobalNameSpace = False
  57. Attribute VB_Creatable = False
  58. Attribute VB_PredeclaredId = True
  59. Attribute VB_Exposed = False
  60. Dim Ssql As String
  61. Private Sub Command1_Click()
  62.     On Error GoTo err_exit
  63.     If XT_BillDesign.WglrGrid.Visible = False Then MsgBox "此种单据类型不能修改类型!  ", 16: Exit Sub
  64.     
  65.     Dim valueStr As String
  66.     Dim aDo_re As New Recordset
  67.     If Trim(List1.Text) = "" Then MsgBox "请选定一个编码!  ", 48: Exit Sub
  68.     valueStr = InputBox("编码名称", "打印类型编码设置---修改", Trim(List1.Text))
  69.     If Trim(valueStr) = "" Then Exit Sub
  70.     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) & "'")
  71.     If aDo_re.RecordCount > 0 Then MsgBox "编码不能重复!   ", 48: Exit Sub
  72.     aDo_re.Close
  73.     Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
  74.     
  75.     Ssql = "UPDATE Xt_BillGridPrint SET PrintGridCode='" & valueStr & "' WHERE PrintGridCode='" & Trim(List1.Text) & "' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
  76.     Cw_DataEnvi.DataConnect.Execute Ssql
  77.     Ssql = "UPDATE Xt_BilltextPrint SET PrinttextCode='" & valueStr & "' WHERE PrinttextCode='" & Trim(List1.Text) & "' and text_group_code='" & Trim(aDo_re!Grid_code) & "'"
  78.     Cw_DataEnvi.DataConnect.Execute Ssql
  79.     
  80.     Form_Activate
  81.     
  82.     Exit Sub
  83. err_exit:
  84.     MsgBox Err.Description, 16
  85.     
  86. End Sub
  87. Private Sub Command2_Click()
  88.     On Error GoTo err_exit
  89.     If XT_BillDesign.WglrGrid.Visible = False Then MsgBox "此种单据类型不能添加类型!  ", 16: Exit Sub
  90.     Dim valueStr As String
  91.     Dim aDo_re As New Recordset
  92.     
  93.     valueStr = InputBox("编码名称", "打印类型编码设置---添加", "")
  94.     If Trim(valueStr) = "" Then Exit Sub
  95.     Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from Xt_BillGridPrint where PrintGridCode='" & Trim(valueStr) & "' and grid_code='" & Trim(Me.Tag) & "'")
  96.     If aDo_re.RecordCount > 0 Then MsgBox "编码不能重复!   ", 48: Exit Sub
  97.     aDo_re.Close
  98.     Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
  99.     
  100.     
  101.     Ssql = "insert into Xt_BillGridPrint(Grid_Code,ColIndex,PrintGridCode,PrintGridHeight,PrintGridWidth,PrintGridTop,PrintGridLeft,PrintDataRows,PrintColWidth,BillTitlePrint)" _
  102.     & " select Grid_Code,ColIndex,PrintGridCode='" & Trim(valueStr) & "',PrintGridHeight=GridHeight,PrintGridWidth=GridWidth,PrintGridTop=GridTop," _
  103.     & "PrintGridLeft=GridLeft,PrintDataRows=3,PrintColWidth=ColWidth,BillTitlePrint='" & XT_BillDesign.Lab_Title.Caption & "' from xt_grid where grid_code='" & Trim(aDo_re!Grid_code) & "'"
  104.     Cw_DataEnvi.DataConnect.Execute Ssql
  105.     Ssql = "insert into Xt_BilltextPrint(text_group_code,text_index,PrintTextCode,PrintTop,PrintLeft,Printwidth) " _
  106.     & " select text_group_code,text_index,PrintTextCode='" & Trim(valueStr) & "', PrintTop=texttop,PrintLeft=textleft,Printwidth=textwidth from Xt_text_input" _
  107.     & " where text_group_code='" & Trim(aDo_re!text_group_code) & "'"
  108.     Cw_DataEnvi.DataConnect.Execute Ssql
  109.     Form_Activate
  110.     
  111.     Exit Sub
  112. err_exit:
  113.     MsgBox Err.Description, 16
  114.     
  115. End Sub
  116. Private Sub Command3_Click()
  117.     
  118.     On Error GoTo err_exit
  119.     Dim aDo_re As New Recordset
  120.     
  121.     Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
  122.     If XT_BillDesign.WglrGrid.Visible = True Then
  123.         Ssql = "delete Xt_BillGridPrint  WHERE PrintGridCode='" & Trim(List1.Text) & "' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
  124.         Cw_DataEnvi.DataConnect.Execute Ssql
  125.     End If
  126.     Ssql = "delete Xt_BilltextPrint  WHERE PrinttextCode='" & Trim(List1.Text) & "' and text_group_code='" & Trim(aDo_re!text_group_code) & "'"
  127.     Cw_DataEnvi.DataConnect.Execute Ssql
  128.     
  129.     Form_Activate
  130.     
  131.     Exit Sub
  132. err_exit:
  133.     MsgBox Err.Description, 16
  134. End Sub
  135. Private Sub Command4_Click()
  136.     Unload Me
  137. End Sub
  138. Private Sub Form_Activate()
  139.     Dim aDo_Printtype As New Recordset
  140.     List1.Clear
  141.     Dim aDo_re As New Recordset
  142.     Set aDo_re = Cw_DataEnvi.DataConnect.Execute("select * from xt_BillDesign where  Billname='" & Trim(XT_BillDesign.ComboName.Tag) & "'")
  143.     If XT_BillDesign.WglrGrid.Visible = True Then
  144.         Ssql = "select * from Xt_BillGridPrint where colindex='000' and grid_code='" & Trim(aDo_re!Grid_code) & "'"
  145.         Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
  146.         Do While Not aDo_Printtype.EOF
  147.             List1.AddItem aDo_Printtype!printgridcode
  148.             aDo_Printtype.MoveNext
  149.         Loop
  150. Else: Ssql = "select * from Xt_BillTextPrint where text_group_code='" & Trim(aDo_re!text_group_code) & "'"
  151.         Set aDo_Printtype = Cw_DataEnvi.DataConnect.Execute(Ssql)
  152.         If aDo_Printtype.RecordCount < 1 Then Exit Sub
  153.         List1.AddItem "Default"
  154.     End If
  155. End Sub