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

📄 checktaskbook.aspx.vb

📁 一个很不错的实验室管理系统,用vb+sql编写,功能强大,界面美观
💻 VB
字号:
Imports System.Data.SqlClient
Public Class CheckTaskBook
    Inherits clsTaskBook
    Protected WithEvents btnAccept As System.Web.UI.WebControls.Button
    Protected WithEvents btnReject As System.Web.UI.WebControls.Button
    Protected WithEvents tablehead As System.Web.UI.HtmlControls.HtmlTable
    Protected WithEvents tablepara As System.Web.UI.HtmlControls.HtmlTable
    Protected WithEvents Tablemainpart As System.Web.UI.HtmlControls.HtmlTable
    Protected WithEvents Tableitem As System.Web.UI.HtmlControls.HtmlTable    
    Protected WithEvents Table1 As System.Web.UI.HtmlControls.HtmlTable
    Protected WithEvents DropDownListAddress As System.Web.UI.WebControls.DropDownList
    Protected WithEvents txtBeiZhu As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtAreaIceBoxSerail As System.Web.UI.HtmlControls.HtmlTextArea
    Protected WithEvents drpTestID As System.Web.UI.WebControls.DropDownList
    Protected WithEvents txtTestDep As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtIceProvider As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtTestXiaDa As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtTestShengQing As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtSignature As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtTestPiZhun As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtIceModel As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtIceNum As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtIceMakePos As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtExecuteStandard As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtTestObjectDescription As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtSampleStep As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtBrand As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtSampleAddress As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtSampleBase As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtSampleBy As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtProductAddress As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtConsumeArea As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtIceBoxName As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtTestObject As System.Web.UI.WebControls.TextBox
    Protected WithEvents chkN As System.Web.UI.WebControls.CheckBox
    Protected WithEvents chkSN As System.Web.UI.WebControls.CheckBox
    Protected WithEvents chkT As System.Web.UI.WebControls.CheckBox
    Protected WithEvents chkST As System.Web.UI.WebControls.CheckBox
    Protected WithEvents chkTestPropertyWeiTuo As System.Web.UI.WebControls.CheckBox
    Protected WithEvents chkTestPropertyPeriod As System.Web.UI.WebControls.CheckBox
    Protected WithEvents chkTestPropertyQiTa As System.Web.UI.WebControls.CheckBox
    Protected WithEvents txtIceSerial As System.Web.UI.WebControls.TextBox
    Protected WithEvents chkTestPropertyNewTest As System.Web.UI.WebControls.CheckBox
    Protected WithEvents Tablespecialitem As System.Web.UI.HtmlControls.HtmlTable
#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region
    '函数名称:InitTable
    '函数功能:显示指定的任务书
    '输入参数:strTestID任务编号
    '          strAddress任务书地址
    Private Sub InitTable(ByVal strTestId As String, ByVal strAddress As String)
        '选择没有审核的任务书
        PubStrSql = "select TestDep,IceProvider,IceBoxName,TestXiaDa,TestShengQing,Signature," _
        & "TestPiZhun,IceModel,IceNum,IceSerial,IceMakePos,ConsumeArea,ExecuteStandard," _
        & "TaskBook.TestObject,TestObjectDescription,SampleStep,BeiZhu,ProductAddress,SampleAddress," _
        & "SampleBase,SampleBy,Brand from taskbook,report where taskbook.testid=report.testid and" _
        & " taskbook.address=report.address and checked=1 AND State=1 and taskbook.address='" _
        & strAddress & "'" & " and taskbook.TestID='" _
        & strTestId & "'"
        PubDataAdapter.SelectCommand.CommandText = PubStrSql
        Try
            PubDataSet.Tables("taskbook").Clear()
        Catch
        End Try
        PubDataAdapter.Fill(PubDataSet, "taskbook")
        '任务书基本内容       
        DisplayUpperTaskBook(PubStrSql)
        '显示任务书
        DisplayTaskBook(strAddress, strTestId, tablepara, Tablemainpart, Tableitem, Tablespecialitem)
    End Sub
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            Response.Cache.SetNoServerCaching()
            '显示地址
            DisplayAddress(DropDownListAddress)
            For intLoopIndex = 0 To DropDownListAddress.Items.Count - 1
                If DropDownListAddress.Items(intLoopIndex).Text.Trim = Session("UserAddress") Then
                    DropDownListAddress.Items(intLoopIndex).Selected = True
                    Exit For
                End If
            Next
            '显示任务书编号
            PubStrSql = "select TestID from taskbook where state=1 and checked=1 and address='" _
            & DropDownListAddress.SelectedItem.Text.Trim & "'" & " order by testxiada asc"
            DisplayTestID(PubStrSql, drpTestID)
            '显示任务书明细
            If drpTestID.Items.Count > 0 Then
                Call InitTable(drpTestID.SelectedItem.Text.Trim, DropDownListAddress.SelectedItem.Text.Trim)
            Else
                btnAccept.Enabled = False
                btnReject.Enabled = False
            End If
        End If
    End Sub

    Private Sub btnAccept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAccept.Click
        '审核通过
        PubStrSql = "update taskbook set checked=2 where testid='" _
        & Trim(drpTestID.SelectedItem.Text) & "'"
        PubSqlCmd.CommandText = PubStrSql
        PubSqlCmd.ExecuteNonQuery()
        drpTestID.Items.Remove(drpTestID.SelectedItem.Text)
        If drpTestID.Items.Count > 0 Then
            Call InitTable(drpTestID.SelectedItem.Text.Trim, DropDownListAddress.SelectedItem.Text.Trim)
        Else
            btnAccept.Enabled = False
            btnReject.Enabled = False
        End If
    End Sub
    Private Sub btnReject_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReject.Click
        '审核没有通过
        PubStrSql = "update taskbook set checked=3 where testid='" & Trim(drpTestID.SelectedItem.Text) & "'"
        PubSqlCmd.CommandText = PubStrSql
        PubSqlCmd.ExecuteNonQuery()
        drpTestID.Items.Remove(drpTestID.SelectedItem.Text)
        If drpTestID.Items.Count > 0 Then
            Call InitTable(drpTestID.SelectedItem.Text.Trim, DropDownListAddress.SelectedItem.Text.Trim)
        Else
            btnAccept.Enabled = False
            btnReject.Enabled = False
        End If
    End Sub
    Private Sub DropDownListAddress_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownListAddress.SelectedIndexChanged
        '显示当前地址的任务书
        PubStrSql = "select * from taskbook where state=1 and checked=1 and address='" _
        & DropDownListAddress.SelectedItem.Text.Trim & "'" & " order by testxiada asc"
        '显示任务书编号
        DisplayTestID(PubStrSql, drpTestID)
        If drpTestID.Items.Count > 0 Then
            Call InitTable(drpTestID.SelectedItem.Text.Trim, DropDownListAddress.SelectedItem.Text.Trim)
        Else
            btnAccept.Enabled = False
            btnReject.Enabled = False
        End If
    End Sub
    Private Sub drpTestID_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drpTestID.SelectedIndexChanged
        Call InitTable(drpTestID.SelectedItem.Text.Trim, DropDownListAddress.SelectedItem.Text.Trim)
    End Sub
End Class

⌨️ 快捷键说明

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