frmbillquery.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:10k
- Imports System.Data.SqlClient
- Imports System.Reflection.Assembly
- Imports System.Configuration
- Public Class frmbillquery
- Inherits System.Windows.Forms.Form
- #Region " Windows 窗体设计器生成的代码 "
- Public Sub New()
- MyBase.New()
- '该调用是 Windows 窗体设计器所必需的。
- InitializeComponent()
- '在 InitializeComponent() 调用之后添加任何初始化
- End Sub
- '窗体重写 dispose 以清理组件列表。
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- 'Windows 窗体设计器所必需的
- Private components As System.ComponentModel.IContainer
- '注意: 以下过程是 Windows 窗体设计器所必需的
- '可以使用 Windows 窗体设计器修改此过程。
- '不要使用代码编辑器修改它。
- Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
- Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents Button1 As System.Windows.Forms.Button
- Friend WithEvents Button3 As System.Windows.Forms.Button
- Friend WithEvents billViewer As DataDynamics.ActiveReports.Viewer.Viewer
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.Button3 = New System.Windows.Forms.Button
- Me.Button1 = New System.Windows.Forms.Button
- Me.Label1 = New System.Windows.Forms.Label
- Me.TextBox1 = New System.Windows.Forms.TextBox
- Me.ComboBox1 = New System.Windows.Forms.ComboBox
- Me.billViewer = New DataDynamics.ActiveReports.Viewer.Viewer
- Me.GroupBox1.SuspendLayout()
- Me.SuspendLayout()
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.Button3)
- Me.GroupBox1.Controls.Add(Me.Button1)
- Me.GroupBox1.Controls.Add(Me.Label1)
- Me.GroupBox1.Controls.Add(Me.TextBox1)
- Me.GroupBox1.Controls.Add(Me.ComboBox1)
- Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top
- Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(1032, 49)
- Me.GroupBox1.TabIndex = 0
- Me.GroupBox1.TabStop = False
- '
- 'Button3
- '
- Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.Button3.Location = New System.Drawing.Point(523, 15)
- Me.Button3.Name = "Button3"
- Me.Button3.Size = New System.Drawing.Size(74, 25)
- Me.Button3.TabIndex = 5
- Me.Button3.Text = "退出"
- Me.Button3.TextAlign = System.Drawing.ContentAlignment.TopCenter
- '
- 'Button1
- '
- Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.Button1.Location = New System.Drawing.Point(448, 15)
- Me.Button1.Name = "Button1"
- Me.Button1.Size = New System.Drawing.Size(75, 25)
- Me.Button1.TabIndex = 3
- Me.Button1.Text = "查询"
- Me.Button1.TextAlign = System.Drawing.ContentAlignment.TopCenter
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(11, 15)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(129, 21)
- Me.Label1.TabIndex = 2
- Me.Label1.Text = "请选择票据类型:"
- '
- 'TextBox1
- '
- Me.TextBox1.Location = New System.Drawing.Point(280, 15)
- Me.TextBox1.Name = "TextBox1"
- Me.TextBox1.Size = New System.Drawing.Size(160, 25)
- Me.TextBox1.TabIndex = 1
- Me.TextBox1.Text = ""
- '
- 'ComboBox1
- '
- Me.ComboBox1.Items.AddRange(New Object() {"销售单", "小票单", "采购单", "盘点单"})
- Me.ComboBox1.Location = New System.Drawing.Point(152, 15)
- Me.ComboBox1.Name = "ComboBox1"
- Me.ComboBox1.Size = New System.Drawing.Size(121, 23)
- Me.ComboBox1.TabIndex = 0
- '
- 'billViewer
- '
- Me.billViewer.BackColor = System.Drawing.SystemColors.Control
- Me.billViewer.Dock = System.Windows.Forms.DockStyle.Fill
- Me.billViewer.Location = New System.Drawing.Point(0, 49)
- Me.billViewer.Name = "billViewer"
- Me.billViewer.ReportViewer.CurrentPage = 0
- Me.billViewer.ReportViewer.MultiplePageCols = 3
- Me.billViewer.ReportViewer.MultiplePageRows = 2
- Me.billViewer.Size = New System.Drawing.Size(1032, 697)
- Me.billViewer.TabIndex = 1
- Me.billViewer.TableOfContents.Text = "Contents"
- Me.billViewer.TableOfContents.Width = 267
- Me.billViewer.Toolbar.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
- '
- 'frmbillquery
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
- Me.ClientSize = New System.Drawing.Size(1032, 746)
- Me.Controls.Add(Me.billViewer)
- Me.Controls.Add(Me.GroupBox1)
- Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
- Me.Name = "frmbillquery"
- Me.Text = "票据重打"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- Me.GroupBox1.ResumeLayout(False)
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If ComboBox1.Text = String.Empty Or TextBox1.Text = String.Empty Then
- MessageBox.Show("请输入查询条件!", "提示", MessageBoxButtons.OK)
- Else
- Dim strquery As String
- Dim strtable As String
- Dim strrptview As String
- Dim sqlString As String
- Select Case ComboBox1.Text
- Case "销售单"
- Try
- sqlString = "select * from wz_ck where 票号='" & TextBox1.Text & "'"
- Dim rpt As New rpxck
- Dim myDS As New DataDynamics.ActiveReports.DataSources.SqlDBDataSource
- myDS.ConnectionString = ConfigurationSettings.AppSettings.Get("constr")
- myDS.SQL = sqlString
- rpt.DataSource = myDS
- Me.billViewer.Document = rpt.Document
- rpt.Run(False)
- Catch ex As Exception
- MessageBox.Show(Me, "报表错误: " + ex.Message + "; " + ex.InnerException.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
-
- Case "小票单"
- Try
- sqlString = "select * from wz_ck where 票号='" & TextBox1.Text & "'"
- Dim rpt As New rpxckz
- Dim myDS As New DataDynamics.ActiveReports.DataSources.SqlDBDataSource
- myDS.ConnectionString = ConfigurationSettings.AppSettings.Get("constr")
- myDS.SQL = sqlString
- rpt.DataSource = myDS
- Me.billViewer.Document = rpt.Document
- rpt.Run(False)
- Catch ex As Exception
- MessageBox.Show(Me, "报表错误: " + ex.Message + "; " + ex.InnerException.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
-
- Case "采购单"
- Try
- sqlString = "select * from wz_rk where 票号='" & TextBox1.Text & "'"
- Dim rpt As New rpxrk
- Dim myDS As New DataDynamics.ActiveReports.DataSources.SqlDBDataSource
- myDS.ConnectionString = ConfigurationSettings.AppSettings.Get("constr")
- myDS.SQL = sqlString
- rpt.DataSource = myDS
- Me.billViewer.Document = rpt.Document
- rpt.Run(False)
- Catch ex As Exception
- MessageBox.Show(Me, "报表错误: " + ex.Message + "; " + ex.InnerException.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
-
- Case "盘点单"
- Try
- sqlString = "select * from wz_pd where 票号='" & TextBox1.Text & "'"
- Dim rpt As New rpxpd
- Dim myDS As New DataDynamics.ActiveReports.DataSources.SqlDBDataSource
- myDS.ConnectionString = ConfigurationSettings.AppSettings.Get("constr")
- myDS.SQL = sqlString
- rpt.DataSource = myDS
- Me.billViewer.Document = rpt.Document
- rpt.Run(False)
- Catch ex As Exception
- MessageBox.Show(Me, "报表错误: " + ex.Message + "; " + ex.InnerException.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
- End Select
- End If
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Me.Close()
- End Sub
- Private Sub frmbillquery_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- End Class