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

📄 assent_main.vb

📁 固定资产管理信息系统,虽然还有些不足,但基本功能已实现!希望大家多多改进!
💻 VB
📖 第 1 页 / 共 2 页
字号:
        Me.Button1.Text = "确 定"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(240, 368)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(56, 23)
        Me.Button2.TabIndex = 28
        Me.Button2.Text = "清 空"
        '
        'Button3
        '
        Me.Button3.Location = New System.Drawing.Point(376, 368)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(56, 23)
        Me.Button3.TabIndex = 29
        Me.Button3.Text = "关 闭"
        '
        'DateTimePicker2
        '
        Me.DateTimePicker2.Location = New System.Drawing.Point(312, 224)
        Me.DateTimePicker2.Name = "DateTimePicker2"
        Me.DateTimePicker2.Size = New System.Drawing.Size(128, 21)
        Me.DateTimePicker2.TabIndex = 30
        '
        'NumericUpDown1
        '
        Me.NumericUpDown1.Location = New System.Drawing.Point(104, 144)
        Me.NumericUpDown1.Name = "NumericUpDown1"
        Me.NumericUpDown1.Size = New System.Drawing.Size(104, 21)
        Me.NumericUpDown1.TabIndex = 31
        '
        'Assent_Main
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(496, 414)
        Me.Controls.Add(Me.NumericUpDown1)
        Me.Controls.Add(Me.DateTimePicker2)
        Me.Controls.Add(Me.Button3)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.TextBox10)
        Me.Controls.Add(Me.TextBox9)
        Me.Controls.Add(Me.TextBox8)
        Me.Controls.Add(Me.TextBox6)
        Me.Controls.Add(Me.TextBox5)
        Me.Controls.Add(Me.TextBox4)
        Me.Controls.Add(Me.TextBox3)
        Me.Controls.Add(Me.TextBox1)
        Me.Controls.Add(Me.Label14)
        Me.Controls.Add(Me.Label13)
        Me.Controls.Add(Me.Label12)
        Me.Controls.Add(Me.Label11)
        Me.Controls.Add(Me.Label10)
        Me.Controls.Add(Me.Label9)
        Me.Controls.Add(Me.Label8)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.DateTimePicker1)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.ComboBox2)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.ComboBox1)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.MaximizeBox = False
        Me.Name = "Assent_Main"
        Me.Text = "--------------资产登记"
        CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

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

        'MsgBox(node1)
        'MsgBox(node2)
        'MsgBox(node3)
        'MsgBox(node4)
        'MsgBox(node5)
        'MsgBox(node6)
        'MsgBox(node7)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Close()

    End Sub

    Private Sub Assent_Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' AssentClass()
        For Each ClassRow In ClassDataSet.Tables("T_ASSET_TYPE").Rows
            Me.ComboBox1.Items.Add(ClassRow("TYPE_NAME"))
        Next
        Me.ComboBox1.Text = Me.ComboBox1.Items(0)

        ' Departement()
        For Each DepartementRow In DepartementDataSet.Tables("T_DEPARTMENT").Rows
            Me.ComboBox2.Items.Add(DepartementRow("TYPE_NAME"))
        Next
        Me.ComboBox2.Text = Me.ComboBox2.Items(0)

        TextBox9.Text = 2
        TextBox9.Enabled = False
    End Sub


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


        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        assetType()
        MsgBox(assenType)
        depsType()
        MsgBox(depType)

        Try
            myConnStr = connstr()
            myConnetion = New SqlClient.SqlConnection(myConnStr)
            'comm.Connection = conn
            myCommand = New SqlClient.SqlCommand("PR_T_ASSET_MAIN", myConnetion)
            myCommand.CommandType = CommandType.StoredProcedure
            'comm.CommandText = "PR_T_ASSET_MAIN"


            Dim myparameter As SqlClient.SqlParameter
            myparameter = myCommand.Parameters.Add("@TYPE", SqlDbType.Char, 1)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = assenType

            myparameter = myCommand.Parameters.Add("@DEPARTMENT", SqlDbType.Char, 1)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = depType

            myparameter = myCommand.Parameters.Add("@ASSET_NAME", SqlDbType.VarChar, 20)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox1.Text

            myparameter = myCommand.Parameters.Add("@USE_DEP", SqlDbType.VarChar, 20)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = ComboBox2.Text

            myparameter = myCommand.Parameters.Add("@BUY_TIME", SqlDbType.DateTime)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = CDate(DateTimePicker1.Text)

            myparameter = myCommand.Parameters.Add("@ASSENT_QUANTITY", SqlDbType.Int)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = CInt(NumericUpDown1.Text)

            myparameter = myCommand.Parameters.Add("@ASSENT_PRICE", SqlDbType.Money)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox3.Text

            myparameter = myCommand.Parameters.Add("@BUY_MAN", SqlDbType.VarChar, 10)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox4.Text

            myparameter = myCommand.Parameters.Add("@BURDEN_MAN", SqlDbType.VarChar, 10)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox5.Text

            myparameter = myCommand.Parameters.Add("@USE_MAN", SqlDbType.VarChar, 10)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox6.Text

            myparameter = myCommand.Parameters.Add("@ADD_DATE", SqlDbType.DateTime)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = CDate(DateTimePicker2.Text)

            myparameter = myCommand.Parameters.Add("@ADD_REN", SqlDbType.VarChar, 10)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox8.Text

            myparameter = myCommand.Parameters.Add("@ASSET_TYPE", SqlDbType.VarChar, 1)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox9.Text

            myparameter = myCommand.Parameters.Add("@BAK", SqlDbType.VarChar, 200)
            myparameter.Direction = ParameterDirection.Input
            myparameter.Value = TextBox10.Text

            ' Dim i As Integer


            myConnetion.Open()
            'i =
            myCommand.ExecuteNonQuery()
            'MsgBox("i is :" & i)
            myConnetion.Close()

            MsgBox("添加成功!!!")
        Catch ex As Exception
            MsgBox("添加失败")
        End Try

    End Sub

    Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged

    End Sub

    Public Sub assetType()

        Try


            Dim conn1t As New SqlConnection
            Dim comm1t As New SqlCommand
            Dim ds1t As New DataSet
            Dim ada1t As New SqlDataAdapter
            Dim row As DataRow

            myConnStr = connstr()

            conn1t = New SqlConnection(myConnStr)
            conn1t.Open()
            'TextBox1.Text = TreeView1.SelectedNode.Text
            ' Dim t As String
            ' t = Mid(TextBox1.Text, 1, 1)
            ' TextBox3.Text = t
            'comm1t = New SqlCommand("select * from T_ASSET_TYPE where TYPE_CODE ='" + TextBox3.Text.Trim + "'", conn1t)

            comm1t = New SqlCommand("select * from T_ASSET_TYPE where TYPE_NAME ='" + ComboBox1.Text.Trim + "'", conn1t)
            Dim i1t As Integer

            i1t = comm1t.ExecuteNonQuery()
            ada1t.SelectCommand = comm1t
            conn1t.Close()
            'ds1t.Clear()
            ada1t.Fill(ds1t, "T_ASSET_TYPE")
            'assentTable.Clear()

            assentTable = ds1t.Tables("T_ASSET_TYPE")
            ' Dim i As Integer

            'typestr = assentTable.Rows(0).Item(1).ToString
            'typestr = "YYYY"
            row = assentTable.Rows(0)
            assenType = row.Item(0)
            'MsgBox(typestr)
            'TextBox5.Text = typestr

            ' MsgBox(TreeView1.SelectedNode.Text)

        Catch ex As Exception

        End Try

    End Sub

    Public Sub depsType()

        Try


            Dim conn1t As New SqlConnection
            Dim comm1t As New SqlCommand
            Dim ds1t As New DataSet
            Dim ada1t As New SqlDataAdapter
            Dim row As DataRow

            myConnStr = connstr()

            conn1t = New SqlConnection(myConnStr)
            conn1t.Open()
            'TextBox1.Text = TreeView1.SelectedNode.Text
            'Dim t As String
            't = Mid(TextBox1.Text, 1, 1)
            ' TextBox3.Text = t
            'comm1t = New SqlCommand("select * from T_ASSET_TYPE where TYPE_CODE ='" + TextBox3.Text.Trim + "'", conn1t)

            comm1t = New SqlCommand("select * from T_DEPARTMENT where TYPE_NAME ='" + ComboBox2.Text.Trim + "'", conn1t)
            Dim i1t As Integer

            i1t = comm1t.ExecuteNonQuery()
            ada1t.SelectCommand = comm1t
            conn1t.Close()
            'ds1t.Clear()
            ada1t.Fill(ds1t, "T_ASSET_TYPE")
            'assentTable.Clear()

            assentTable = ds1t.Tables("T_ASSET_TYPE")
            ' Dim i As Integer

            'typestr = assentTable.Rows(0).Item(1).ToString
            'typestr = "YYYY"
            row = assentTable.Rows(0)
            depType = row.Item(0)
            'MsgBox(typestr)
            'TextBox5.Text = typestr

            ' MsgBox(TreeView1.SelectedNode.Text)

        Catch ex As Exception

        End Try

    End Sub



    Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged


        datatime = DateTimePicker1.Text
    End Sub
End Class

⌨️ 快捷键说明

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