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

📄 check_count.aspx.vb

📁 c++builder开发的一个仓库信息管理系统
💻 VB
字号:
Option Explicit On
Option Strict On

Imports System.Data
Imports System.Data.SqlClient

Partial Class Mode4_Default
    Inherits System.Web.UI.Page

    Dim conn As New SqlConnection("data source=.;database=wms;user=sa;pwd=074345")

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then

            For index As Integer = 1 To 30

                Dim str As String = CStr(1990 + index)
                Me.DropDownList2.Items.Add("" + str)
                Me.DropDownList8.Items.Add("" + str)

            Next

            For index As Integer = 1 To 12

                If index < 10 And index > 0 Then

                    Me.DropDownList3.Items.Add("0" + index.ToString)
                    Me.DropDownList9.Items.Add("0" + index.ToString)

                Else
                    Me.DropDownList3.Items.Add("" + index.ToString)
                    Me.DropDownList9.Items.Add("" + index.ToString)
                End If

            Next

            For index As Integer = 1 To 31

                If index < 10 And index > 0 Then
                    Me.DropDownList4.Items.Add("0" + index.ToString)
                    Me.DropDownList10.Items.Add("0" + index.ToString)

                Else
                    Me.DropDownList4.Items.Add("" + index.ToString)
                    Me.DropDownList10.Items.Add("" + index.ToString)

                End If

            Next

            Dim adap3 As New SqlDataAdapter("select * from chek", conn)
            conn.Open()
            Dim dataset3 As New DataSet
            Dim tb3 As New DataTable
            adap3.Fill(dataset3)
            tb3 = dataset3.Tables(0)
            Me.DropDownList1.DataSource = tb3
            Me.DropDownList1.DataTextField = "chekno"
            Me.DropDownList1.DataValueField = "chekno"
            Me.DropDownList1.DataBind()
            conn.Close()

            Dim adap1 As New SqlDataAdapter("select * from thingclass", conn)
            conn.Open()
            Dim dataset1 As New DataSet
            Dim tb1 As New DataTable
            adap1.Fill(dataset1)
            tb1 = dataset1.Tables(0)
            Me.DropDownList6.DataSource = tb1
            Me.DropDownList6.DataTextField = "classname"
            Me.DropDownList6.DataValueField = "classno"
            Me.DropDownList6.DataBind()
            conn.Close()

            Dim adap2 As New SqlDataAdapter("select * from thing", conn)
            conn.Open()
            Dim dataset2 As New DataSet
            Dim tb2 As New DataTable
            adap2.Fill(dataset2)
            tb2 = dataset2.Tables(0)
            Me.DropDownList7.DataSource = tb2
            Me.DropDownList7.DataTextField = "thingname"
            Me.DropDownList7.DataValueField = "thingno"
            Me.DropDownList7.DataBind()
            conn.Close()

            Me.DropDownList1.Enabled = False
            Me.DropDownList2.Enabled = False
            Me.DropDownList3.Enabled = False
            Me.DropDownList4.Enabled = False
            Me.DropDownList8.Enabled = False
            Me.DropDownList9.Enabled = False
            Me.DropDownList10.Enabled = False
            Me.DropDownList6.Enabled = False
            Me.DropDownList7.Enabled = False

        End If

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.CheckBox1.Enabled = False
        Me.CheckBox3.Enabled = False
        Me.CheckBox4.Enabled = False
        Me.CheckBox5.Enabled = False

        If Me.CheckBox5.Checked = True Then

            Me.DropDownList1.Enabled = True

        End If

        If Me.CheckBox1.Checked = True Then

            Me.DropDownList2.Enabled = True
            Me.DropDownList3.Enabled = True
            Me.DropDownList4.Enabled = True
            Me.DropDownList8.Enabled = True
            Me.DropDownList9.Enabled = True
            Me.DropDownList10.Enabled = True

        End If

        If Me.CheckBox3.Checked = True Then

            Me.DropDownList6.Enabled = True

        End If

        If Me.CheckBox4.Checked = True Then

            Me.DropDownList7.Enabled = True

        End If

    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

        Me.CheckBox1.Enabled = True
        Me.CheckBox3.Enabled = True
        Me.CheckBox4.Enabled = True
        Me.CheckBox5.Enabled = True

        DropDownList1.Enabled = False
        Me.DropDownList2.Enabled = False
        Me.DropDownList3.Enabled = False
        Me.DropDownList4.Enabled = False
        Me.DropDownList8.Enabled = False
        Me.DropDownList9.Enabled = False
        Me.DropDownList10.Enabled = False
        Me.DropDownList6.Enabled = False
        Me.DropDownList7.Enabled = False

    End Sub

    Protected Sub count_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles count.Click

        Dim conn As New SqlConnection("data source=.;database=wms;user=sa;pwd=074345")
        Dim sqlbuff As New StringBuilder

        sqlbuff.Append("  select chek.chekno,  ")
        sqlbuff.Append("    chek.chekdate,")
        sqlbuff.Append("    chek.classno,")
        sqlbuff.Append("    thingclass.classname,")
        sqlbuff.Append("    chek.BankNote,")
        sqlbuff.Append("    checklist.thingno,")
        sqlbuff.Append("    thing.thingname,")
        sqlbuff.Append("    thingclass.classname,")
        sqlbuff.Append("    checklist.RealNumber,")
        sqlbuff.Append("    thing.providerprice,")
        sqlbuff.Append("    checklist.minplmoney,")
        sqlbuff.Append("    checklist.Remark ")
        sqlbuff.Append("  from chek,checklist,thing,thingclass")
        sqlbuff.Append("  where chek.chekno=checklist.checkno ")
        sqlbuff.Append("  and checklist.thingno=thing.thingno")
        sqlbuff.Append("  and thing.classno=thingclass.classno ")

        If Me.CheckBox5.Checked = True Then

            sqlbuff.Append(" and chek.chekno=" + DropDownList1.SelectedValue)

        End If

        If Me.CheckBox1.Checked = True Then

            Dim str As String = DropDownList2.Text + DropDownList3.Text + DropDownList4.Text
            Dim str1 As String = DropDownList8.Text + DropDownList9.Text + DropDownList10.Text

            sqlbuff.Append(" and chek.chekdate>=" + str)
            sqlbuff.Append(" and chek.chekdate<=" + str1)

        End If

        If Me.CheckBox3.Checked = True Then

            sqlbuff.Append(" and thingclass.classno=" + DropDownList6.SelectedValue)

        End If

        If Me.CheckBox4.Checked = True Then

            sqlbuff.Append(" and thing.thingno=" + DropDownList7.SelectedValue)

        End If

        Dim adap As New SqlDataAdapter(sqlbuff.ToString, conn)
        conn.Open()
        Dim dataset As New DataSet
        Dim tb As New DataTable
        adap.Fill(dataset)
        tb = dataset.Tables(0)
        Me.DataGrid1.DataSource = tb
        Me.DataGrid1.DataBind()

    End Sub

End Class

⌨️ 快捷键说明

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