资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:7k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frm_new_bbmb
- AutoRedraw = -1 'True
- Caption = "新建报表模板"
- ClientHeight = 2070
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4200
- HelpContextID = 105003
- Icon = "新建报表模板.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2070
- ScaleWidth = 4200
- StartUpPosition = 1 '所有者中心
- Begin VB.Frame Frame1
- Height = 1515
- Left = 60
- TabIndex = 2
- Top = 90
- Width = 4065
- Begin VB.TextBox Text2
- Height = 300
- Left = 1080
- MaxLength = 20
- TabIndex = 5
- Top = 1095
- Width = 2865
- End
- Begin VB.TextBox Text1
- BeginProperty DataFormat
- Type = 1
- Format = "99999"
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- Height = 300
- Left = 1080
- MaxLength = 5
- TabIndex = 4
- Top = 690
- Width = 2865
- End
- Begin VB.TextBox Text3
- Enabled = 0 'False
- Height = 300
- Left = 1080
- TabIndex = 3
- Top = 270
- Width = 2865
- End
- Begin VB.Label Label1
- Caption = "系统编号:"
- Height = 210
- Left = 120
- TabIndex = 8
- Top = 315
- Width = 825
- End
- Begin VB.Label Label3
- Caption = "报表名称:"
- Height = 225
- Left = 120
- TabIndex = 7
- Top = 1140
- Width = 825
- End
- Begin VB.Label Label2
- Caption = "报表编号:"
- Height = 225
- Left = 120
- TabIndex = 6
- Top = 750
- Width = 825
- End
- End
- Begin VB.CommandButton Command2
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 3000
- TabIndex = 1
- Top = 1695
- Width = 1120
- End
- Begin VB.CommandButton Command1
- Caption = "确定(&O)"
- Height = 300
- Left = 1800
- TabIndex = 0
- Top = 1695
- Width = 1120
- End
- End
- Attribute VB_Name = "frm_new_bbmb"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '***********************************************
- '* 模 块 名 称 :新建报表模板
- '* 功 能 描 述 :
- '* 程序员姓名 :奚俊峰
- '* 最后修改人 :奚俊峰
- '* 最后修改时间:2002/01/21
- '***********************************************
- Option Explicit
- Private Sub Command1_Click()
- Dim lrst_select As New ADODB.Recordset
- Dim ls_select As String
- If Len(Trim(ls_xtbm)) = 0 Then
- MsgBox "请输入系统编码!", vbOKOnly, "百利/ERP5.0-电子报表"
- ls_xtbm.SetFocus
- Exit Sub
- End If
- If Len(Trim(Text1.Text)) = 0 Then
- MsgBox "请输入报表模板号!", vbOKOnly, "百利/ERP5.0-电子报表"
- Text1.SetFocus
- Exit Sub
- End If
- If Len(Trim(Text2.Text)) = 0 Then
- MsgBox "请输入报表模板名称!", vbOKOnly, "百利/ERP5.0-电子报表"
- Text2.SetFocus
- Exit Sub
- End If
- If Not IsNumeric(Text1) Then
- MsgBox "请输入报表模板号!" & vbCrLf & "模板号必须为数字!", vbOKOnly, "百利/ERP5.0-电子报表"
- Text1.SetFocus
- Exit Sub
- End If
- Text1.Text = Right("000000" & Text1.Text, 5)
- ls_select = "select report_model_id from dzbb_bbmb where system_code='" & Left(ls_xtbm, 2) _
- & "' and report_model_id='" & Text1.Text & "'"
- lrst_select.Open ls_select, Cw_DataEnvi.dataconnect, adOpenDynamic, adLockOptimistic
- If lrst_select.RecordCount > 0 Then
- lrst_select.Close
- Set lrst_select = Nothing
- MsgBox "您输入的报表模板号已存在!", vbOKOnly, "百利/ERP5.0-电子报表"
- Text1.SetFocus
- Exit Sub
- End If
- lrst_select.Close
- ls_select = "select report_model_id from dzbb_bbmb where system_code='" & Left(ls_xtbm, 2) _
- & "' and report_model_name='" & Trim(Text2.Text) & "'"
- lrst_select.Open ls_select, Cw_DataEnvi.dataconnect, adOpenDynamic, adLockOptimistic
- If lrst_select.RecordCount > 0 Then
- lrst_select.Close
- Set lrst_select = Nothing
- MsgBox "您输入的报表模板名称已存在!", vbOKOnly, "百利/ERP5.0-电子报表"
- Text2.SetFocus
- Exit Sub
- End If
- lrst_select.Close
- With MDI_frame
- .mb_new_report_model = True
- .mb_new_report_model = True
- .mcls_new_report_model.ls_system_code = Left(ls_xtbm, 2)
- .mcls_new_report_model.ls_report_model_id = Trim(Text1.Text)
- .mcls_new_report_model.ls_report_model_name = Trim(Text2.Text)
- End With
- Unload Me
- End Sub
- Private Sub command2_Click()
- MDI_frame.mb_new_report_model = False
- Unload Me
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer)
- Select Case KeyAscii
- Case vbKeyReturn
- SendKeys "{tab}"
- Case 39 '屏蔽"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load() '填充数据
- Me.HelpContextID = "1015003"
- Dim lrst_xtbm As ADODB.Recordset
- Dim ls_select As String
- Set lrst_xtbm = New ADODB.Recordset
- Dim k As Long
- ls_select = "select system_code,report_model_id from dzbb_bbmb where system_code= '" & Left(ls_xtbm, 2) & "' order by system_code , report_model_id"
- lrst_xtbm.Open ls_select, Cw_DataEnvi.dataconnect, adOpenStatic, adLockReadOnly, adCmdText
- If lrst_xtbm.RecordCount = 0 Then
- Text1.Text = "00001"
- Else
- k = 1
- With lrst_xtbm
- '为方便用户 是程序自动添加模板编号
- Do While Not .EOF
- If k <> Val(.Fields("report_model_id")) Then
- Text1.Text = Right("00000" & Trim(Str(k)), 5)
- Exit Do
- End If
- k = k + 1
- Text1.Text = Right("00000" & Trim(Str(k)), 5)
- .MoveNext
- Loop
- End With
- lrst_xtbm.Close
- End If
- Set lrst_xtbm = Nothing
- Text3.Text = ls_xtbm
- End Sub
- Private Sub Form_Resize()
- Text2.SetFocus
- End Sub