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

📄 fk_xiabaobiangeng_xiangmuwenyuan.vb

📁 本软件设计为在"采购部""工程部""财务部""总经理"等部门之间的采购审核流转等事宜
💻 VB
📖 第 1 页 / 共 2 页
字号:
        Me.GroupBox3.TabStop = False
        Me.GroupBox3.Text = "变更原因"
        '
        'Fk_xiabaobiangeng_xiangmuwenyuan
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(432, 302)
        Me.Controls.Add(Me.ComboBox1)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.GroupBox1)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.GroupBox4)
        Me.Controls.Add(Me.TextBox1)
        Me.Controls.Add(Me.ComboBox2)
        Me.Controls.Add(Me.GroupBox2)
        Me.Controls.Add(Me.GroupBox3)
        Me.MaximizeBox = False
        Me.Name = "Fk_xiabaobiangeng_xiangmuwenyuan"
        Me.Text = "下包付款变更-申请表"
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox4.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Dim m As Integer




    '新建
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Button2.Enabled = True
        Button5.Enabled = False
        Button3.Enabled = False
        ComboBox1.Enabled = True
        RadioButton1.Checked = False
        ComboBox1.Text = ""

        '得到所有已经审批通过的请购申请单号,读入ComboBox1中
        Dim str As String
        Dim mydataset As New DataSet
        str = "select 编号 from fk_gongcheng_fukuan where   是否为变更 = " + Chr(39) + "0" + Chr(39) + "and 标志 = 4 "
        Dim i, y As Integer
        mydataset = GetDataFromDB(str)
        y = mydataset.Tables(0).Rows.Count
        If y = 0 Then
            Exit Sub
        End If
        Dim sstr As String
        ComboBox1.Items.Clear()
        For i = 0 To y - 1
            sstr = Trim(mydataset.Tables(0).Rows(i)("编号"))
            ComboBox1.Items.Add(sstr)
        Next
        mydataset.Dispose()
    End Sub

    '得到已经有的变更申请号
    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        If RadioButton1.Checked = True Then
            Button2.Enabled = False
            Button5.Enabled = True
            Button3.Enabled = True
            ComboBox1.Enabled = False
            Dim str As String
            Dim mydataset As New DataSet
            str = "select 付款申请单号 from bg_gongchengfukuan where 流程 = " + Chr(39) + "0" + Chr(39)
            Dim i, y As Integer
            mydataset = GetDataFromDB(str)
            y = mydataset.Tables(0).Rows.Count
            If y = 0 Then
                Exit Sub
            End If
            Dim sstr As String
            For i = 0 To y - 1
                sstr = Trim(mydataset.Tables(0).Rows(i)("付款申请单号"))
                ComboBox2.Items.Add(sstr)
            Next
        Else
            ComboBox2.Items.Clear()
            ComboBox2.Text = "变更付款单编号"
        End If
    End Sub


    '保存
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Me.ComboBox1.Text.Trim = "" Then
            MsgBox("请选择申请单编号!", MsgBoxStyle.Information, "提示!")
            Me.TextBox1.Text = Nothing
            Exit Sub
        End If
        Dim mystr As String
        Dim mystr1 As String = Me.TextBox1.Text.Trim
        mystr = "select * from bg_gongchengfukuan where 付款申请单号 =" + Chr(39) + mystr1 + Chr(39)
        If panduan(mystr) = True Then
            MsgBox("该变更单编号已经存在!", MsgBoxStyle.Information, "提示!")

            Exit Sub
        End If

        Dim sqlstr As String
        sqlstr = "INSERT INTO bg_gongchengfukuan " & _
        "(付款申请单号,变更原因,申请变更人,申请时间) " & _
        "VALUES ('" & Me.ComboBox1.Text.Trim & "','" & Me.TextBox1.Text.Trim & "','" & UserName.Trim & "','" & Now.Date & "')"

        If UpdateData(sqlstr) = False Then
            MsgBox("没有成功添加了该变更申请信息!", MsgBoxStyle.OKOnly + _
                    MsgBoxStyle.Exclamation, "添加成功")
            Exit Sub
        Else
            MsgBox("已经成功添加了该变更申请信息!", MsgBoxStyle.OKOnly + _
                    MsgBoxStyle.Exclamation, "添加成功")
            Button2.Enabled = False
            RadioButton1.Checked = True

            '’‘’‘’‘’‘’‘’‘’‘’
            Dim ssqlstr As String
            ssqlstr = "UPDATE fk_gongcheng_fukuan SET   是否为变更 =" + Chr(39) + "1" + Chr(39) + "  where 编号=" + Chr(39) + ComboBox1.Text.Trim + Chr(39)
            If UpdateData(ssqlstr) = True Then


            Else
                MsgBox("没有把工程下包付款申请单流程改为1,请与管理员联系!", MsgBoxStyle.OKOnly + _
                            MsgBoxStyle.Exclamation, "提交")
                Exit Sub
            End If
            '’‘’‘’‘’‘’‘’‘’‘’‘

        End If
    End Sub



    '删  除
    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        If RadioButton1.Checked = False Then
            MsgBox("请选择要删除的项的编号!", MsgBoxStyle.Information, "提示")
            RadioButton1.Checked = True
            Exit Sub
        End If

        If ComboBox2.Text.Trim = "变更付款单编号" Then
            MsgBox("请选择要删除的项的编号!", MsgBoxStyle.Information, "提示")
            RadioButton1.Checked = True
            Exit Sub
        End If

        Dim sqlstr As String
        sqlstr = "delete bg_gongchengfukuan  where 付款申请单号 = " + Chr(39) + ComboBox2.Text.Trim + Chr(39)
        If MsgBox("确定要删除吗?", MsgBoxStyle.YesNo, "删除") = MsgBoxResult.No Then
            Exit Sub
        End If
        If UpdateData(sqlstr) = True Then
            MsgBox("已经成功删除该信息", MsgBoxStyle.OKOnly + _
            MsgBoxStyle.Exclamation, "删除")


            '’‘’‘’‘’‘’‘’‘’‘’
            Dim ssqlstr As String
            ssqlstr = "UPDATE fk_gongcheng_fukuan SET   是否为变更 =" + Chr(39) + "0" + Chr(39) + "  where 编号 = " + Chr(39) + ComboBox2.Text.Trim + Chr(39)
            If UpdateData(ssqlstr) = True Then


            Else
                MsgBox("没有把工程付款流程改为0,请与管理员联系!", MsgBoxStyle.OKOnly + _
                            MsgBoxStyle.Exclamation, "提交")
                Exit Sub
            End If
            '’‘’‘’‘’‘’‘’‘’‘’‘
        Else
            MsgBox("没有成功删除该信息", MsgBoxStyle.OKOnly + _
                        MsgBoxStyle.Exclamation, "删除")
            Exit Sub
        End If
    End Sub


    '提交
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If RadioButton1.Checked = False Then
            MsgBox("请选择要提交的项的编号!", MsgBoxStyle.Information, "提示")
            RadioButton1.Checked = True
            Exit Sub
        End If

        Dim sqlstr As String
        sqlstr = "UPDATE bg_gongchengfukuan SET   流程 =" + Chr(39) + "1" + Chr(39) + "  where 付款申请单号=" + Chr(39) + ComboBox2.Text.Trim + Chr(39)
        If UpdateData(sqlstr) = True Then
            MsgBox("已经成功提交该信息", MsgBoxStyle.OKOnly + _
            MsgBoxStyle.Exclamation, "提交")
            RadioButton1.Checked = False

        Else
            MsgBox("没有成功提交该信息,请与管理员联系!", MsgBoxStyle.OKOnly + _
                        MsgBoxStyle.Exclamation, "提交")
            Exit Sub
        End If
    End Sub



    '得到变更单信息
    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        Dim str As String
        Dim mydataset As New DataSet
        str = "select * from bg_gongchengfukuan where 付款申请单号 = " + Chr(39) + ComboBox2.Text.Trim + Chr(39)

        mydataset = GetDataFromDB(str)
        ComboBox1.Text = mydataset.Tables(0).Rows(0)("付款申请单号")
        TextBox1.Text = mydataset.Tables(0).Rows(0)("变更原因")
        mydataset.Dispose()
    End Sub

   
End Class

⌨️ 快捷键说明

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