frmckskquery.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:10k
- Public Class frmckskquery
- 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 GroupBox2 As System.Windows.Forms.GroupBox
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents txtbegintime As System.Windows.Forms.DateTimePicker
- Friend WithEvents txtendtime As System.Windows.Forms.DateTimePicker
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents txtkhname As System.Windows.Forms.TextBox
- Friend WithEvents btnQueryAll As System.Windows.Forms.Button
- Friend WithEvents btnQuery As System.Windows.Forms.Button
- Friend WithEvents btnPrint As System.Windows.Forms.Button
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- Friend WithEvents dgviewcp As System.Windows.Forms.DataGrid
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.txtkhname = New System.Windows.Forms.TextBox
- Me.Label3 = New System.Windows.Forms.Label
- Me.txtendtime = New System.Windows.Forms.DateTimePicker
- Me.txtbegintime = New System.Windows.Forms.DateTimePicker
- Me.Label2 = New System.Windows.Forms.Label
- Me.Label1 = New System.Windows.Forms.Label
- Me.GroupBox2 = New System.Windows.Forms.GroupBox
- Me.btnPrint = New System.Windows.Forms.Button
- Me.btnQuery = New System.Windows.Forms.Button
- Me.btnQueryAll = New System.Windows.Forms.Button
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.dgviewcp = New System.Windows.Forms.DataGrid
- Me.GroupBox1.SuspendLayout()
- Me.GroupBox2.SuspendLayout()
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- CType(Me.dgviewcp, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.txtkhname)
- Me.GroupBox1.Controls.Add(Me.Label3)
- Me.GroupBox1.Controls.Add(Me.txtendtime)
- Me.GroupBox1.Controls.Add(Me.txtbegintime)
- Me.GroupBox1.Controls.Add(Me.Label2)
- Me.GroupBox1.Controls.Add(Me.Label1)
- Me.GroupBox1.Location = New System.Drawing.Point(11, 10)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(533, 129)
- Me.GroupBox1.TabIndex = 0
- Me.GroupBox1.TabStop = False
- '
- 'txtkhname
- '
- Me.txtkhname.Location = New System.Drawing.Point(96, 62)
- Me.txtkhname.Name = "txtkhname"
- Me.txtkhname.Size = New System.Drawing.Size(416, 25)
- Me.txtkhname.TabIndex = 5
- Me.txtkhname.Text = ""
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(11, 72)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(83, 21)
- Me.Label3.TabIndex = 4
- Me.Label3.Text = "客户名称:"
- '
- 'txtendtime
- '
- Me.txtendtime.Location = New System.Drawing.Point(363, 21)
- Me.txtendtime.Name = "txtendtime"
- Me.txtendtime.Size = New System.Drawing.Size(149, 25)
- Me.txtendtime.TabIndex = 3
- Me.txtendtime.Value = New Date(2006, 2, 23, 0, 0, 0, 0)
- '
- 'txtbegintime
- '
- Me.txtbegintime.Location = New System.Drawing.Point(96, 21)
- Me.txtbegintime.Name = "txtbegintime"
- Me.txtbegintime.Size = New System.Drawing.Size(149, 25)
- Me.txtbegintime.TabIndex = 2
- Me.txtbegintime.Value = New Date(2006, 2, 23, 0, 0, 0, 0)
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(277, 31)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(83, 21)
- Me.Label2.TabIndex = 1
- Me.Label2.Text = "结束日期:"
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(11, 31)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(83, 21)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "开始日期:"
- '
- 'GroupBox2
- '
- Me.GroupBox2.Controls.Add(Me.btnPrint)
- Me.GroupBox2.Controls.Add(Me.btnQuery)
- Me.GroupBox2.Controls.Add(Me.btnQueryAll)
- Me.GroupBox2.Location = New System.Drawing.Point(555, 10)
- Me.GroupBox2.Name = "GroupBox2"
- Me.GroupBox2.Size = New System.Drawing.Size(128, 129)
- Me.GroupBox2.TabIndex = 1
- Me.GroupBox2.TabStop = False
- '
- 'btnPrint
- '
- Me.btnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnPrint.Location = New System.Drawing.Point(11, 82)
- Me.btnPrint.Name = "btnPrint"
- Me.btnPrint.Size = New System.Drawing.Size(100, 30)
- Me.btnPrint.TabIndex = 2
- Me.btnPrint.Text = "打印"
- '
- 'btnQuery
- '
- Me.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQuery.Location = New System.Drawing.Point(11, 51)
- Me.btnQuery.Name = "btnQuery"
- Me.btnQuery.Size = New System.Drawing.Size(100, 30)
- Me.btnQuery.TabIndex = 1
- Me.btnQuery.Text = "条件查询"
- '
- 'btnQueryAll
- '
- Me.btnQueryAll.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQueryAll.Location = New System.Drawing.Point(11, 22)
- Me.btnQueryAll.Name = "btnQueryAll"
- Me.btnQueryAll.Size = New System.Drawing.Size(100, 29)
- Me.btnQueryAll.TabIndex = 0
- Me.btnQueryAll.Text = "全部查询"
- '
- 'dgview
- '
- Me.dgview.DataMember = ""
- Me.dgview.HeaderForeColor = System.Drawing.SystemColors.ControlText
- Me.dgview.Location = New System.Drawing.Point(11, 144)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(1258, 175)
- Me.dgview.TabIndex = 2
- '
- 'dgviewcp
- '
- Me.dgviewcp.DataMember = ""
- Me.dgviewcp.HeaderForeColor = System.Drawing.SystemColors.ControlText
- Me.dgviewcp.Location = New System.Drawing.Point(11, 319)
- Me.dgviewcp.Name = "dgviewcp"
- Me.dgviewcp.Size = New System.Drawing.Size(1258, 247)
- Me.dgviewcp.TabIndex = 3
- '
- 'frmckskquery
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
- Me.ClientSize = New System.Drawing.Size(1028, 582)
- Me.Controls.Add(Me.dgviewcp)
- Me.Controls.Add(Me.dgview)
- Me.Controls.Add(Me.GroupBox2)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "frmckskquery"
- Me.Text = "应收账款查询"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- Me.GroupBox1.ResumeLayout(False)
- Me.GroupBox2.ResumeLayout(False)
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
- CType(Me.dgviewcp, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public dtlist As DataTable
- Public lsweb As New jxcmanage
- Private Sub frmckskquery_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- txtbegintime.Value = Today.ToString
- txtendtime.Value = Today.ToString
- End Sub
- Private Sub btnQueryAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQueryAll.Click
- Dim strquery As String
- strquery = "select * from wz_ck_sk"
- Dim dslocal As DataSet
- dslocal = lsweb.runSql(strquery)
- dgview.DataSource = dslocal.Tables(0).DefaultView
- End Sub
- Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
- If txtbegintime.Value > txtendtime.Value Or txtkhname.Text = String.Empty Then
- MessageBox.Show("开始时间不能大于结束时间,不能为空,请输入查询值!", "提示", MessageBoxButtons.OK)
- Else
- Dim dslocal As DataSet
- dslocal = lsweb.runSql("select * from wz_ck_sk where 日期 between '" & txtbegintime.Value & "' and '" & txtendtime.Value & "' and 客户名称='" & txtkhname.Text & "'")
- dgview.DataSource = dslocal.Tables(0).DefaultView
- End If
- End Sub
-
-
- Private Sub dgview_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgview.CurrentCellChanged
- Dim drv As DataRowView = BindingContext(Me.dgview.DataSource).Current
- Dim dr As DataRow
- dr = drv.Row
- Dim dslocal As DataSet
- dslocal = lsweb.runSql("select * from wz_ck where 票号= '" & dr("票号") & "'")
- dgviewcp.DataSource = dslocal.Tables(0).DefaultView
- End Sub
-
- End Class