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

📄 clstaskbook.vb

📁 一个很不错的实验室管理系统,用vb+sql编写,功能强大,界面美观
💻 VB
📖 第 1 页 / 共 2 页
字号:
Public Class clsTaskBook
    Inherits clsBiz
    Public myRow As HtmlTableRow  '动态生成表格用
    Public myCell As HtmlTableCell
    '构造函数
    Public Sub New()
        MyBase.New()
    End Sub
    '函数名称:DisplayZhiLengJi
    '函数功能:在给定的下拉框中显示制冷剂
    '输入参数:drpDropDownList指定的下拉框  
    Public Sub DisplayZhiLengJi(ByVal drpDropDownList As DropDownList)
        PubStrSql = "select * from Tbl_ZhiLengJi"
        PubDataAdapter.SelectCommand.CommandText = PubStrSql
        PubDataAdapter.Fill(PubDataSet, "ZhiLengJi")
        With drpDropDownList
            .DataSource = PubDataSet.Tables("ZhiLengJi")
            .DataTextField = "ZhiLengJi"
            .DataValueField = "ZhiLengJi"
            .DataBind()
        End With
    End Sub
    '函数名称:DisplayFaPaoJi
    '函数功能:在给定的下拉框中显示发泡剂
    '输入参数:drpDropDownList指定的下拉框  
    Public Sub DisplayFaPaoJi(ByVal drpDropDownList As DropDownList)
        PubStrSql = "select * from Tbl_FaPaoJi"
        PubDataAdapter.SelectCommand.CommandText = PubStrSql
        PubDataAdapter.Fill(PubDataSet, "FaPaoJi")
        With drpDropDownList
            .DataSource = PubDataSet.Tables("FaPaoJi")
            .DataTextField = "FaPaoJi"
            .DataValueField = "FaPaoJi"
            .DataBind()
        End With
    End Sub
    '函数名称:DisplayZhuGuanJianGuiGe
    '函数功能:在给定的下拉框中显示主关件规格
    '输入参数:drpDropDownList指定的下拉框  
    'strZhuangGuanJianName主关件
    Public Sub DisplayZhuGuanJianGuiGe(ByVal drpDropDownList As DropDownList, ByVal strZhuangGuanJianName As String)
        PubStrSql = "select distinct guige from ZhuGuanBuJian where" _
          & " MingCheng='" & strZhuangGuanJianName & " ' order by guige"
        PubDataAdapter.SelectCommand.CommandText = PubStrSql
        Try
            PubDataSet.Tables("ZhuGuanJianGuiGe").Clear()
        Catch
        Finally
            PubDataAdapter.Fill(PubDataSet, "ZhuGuanJianGuiGe")
            With drpDropDownList
                .DataSource = PubDataSet.Tables("ZhuGuanJianGuiGe")
                .DataTextField = "guige"
                .DataValueField = "guige"
                .DataBind()
            End With
        End Try
    End Sub
    '函数名称:DisplayZhuGuanJianSupply
    '函数功能:在给定的下拉框中显示主关件的供应商
    '输入参数:drpDropDownList指定的下拉框  
    'strZhuangGuanJianSupply主关件供应商
    Public Sub DisplayZhuGuanJianSupply(ByVal drpDropDownList As DropDownList, ByVal strZhuangGuanJianName As String)
        PubStrSql = "select distinct gongyingshang from ZhuGuanBuJian where" _
          & " MingCheng='" & strZhuangGuanJianName & " ' order by gongyingshang"
        PubDataAdapter.SelectCommand.CommandText = PubStrSql
        Try
            PubDataSet.Tables("ZhuGuanJianSupply").Clear()
        Catch
        Finally
            PubDataAdapter.Fill(PubDataSet, "ZhuGuanJianSupply")
            With drpDropDownList
                .DataSource = PubDataSet.Tables("ZhuGuanJianSupply")
                .DataTextField = "gongyingshang"
                .DataValueField = "gongyingshang"
                .DataBind()
            End With
        End Try
    End Sub
    '函数名称:ProjectDataSet
    '功能描述:该函数根据用户设定的条件语句从数据库中取得实验项目、项目的标准编号、项目周期
    '          项目的方法模板和项目的要求模板
    '输入参数:strWhere数据库查询语句中的where语句
    '返回数值:返回DataSet类型的主关部件查询结果
    Public Sub GetProjectDataSet(ByVal strWhere As String)
        Dim strSelectProject As String
        strSelectProject = "select distinct testproject.Project,testproject.StandardSerial,"
        strSelectProject = strSelectProject & " testproject.Period,testproject.MethodTemplate,"
        strSelectProject = strSelectProject & " testproject.StandardTemplate from testproject,"
        strSelectProject = strSelectProject & " Standard,StandardSerial where " & strWhere
        PubDataAdapter.SelectCommand.CommandText = strSelectProject
        PubDataAdapter.Fill(PubDataSet, "TestProject")
    End Sub
    '函数名称:DisplayUpperTaskBook
    '功能描述:根据Sql语句显示任务书的固定部分   
    '输入参数:strSql数据库查询语句      
    Public Sub DisplayUpperTaskBook(ByVal strSql As String)
        Dim objTxtBox As TextBox
        PubDataAdapter.SelectCommand.CommandText = strSql
        Try
            PubDataSet.Tables("taskbook").Clear()
        Catch
        End Try
        PubDataAdapter.Fill(PubDataSet, "TaskBookDetail")
        With PubDataSet.Tables("TaskBookDetail")
            If .Rows.Count <> 0 Then
                For i = 0 To .Columns.Count - 1
                    objTxtBox = Me.Controls(1).FindControl("txt" & .Columns(i).ColumnName)
                    objTxtBox.Text = Trim(.Rows(0)(i))
                Next
            End If
        End With
    End Sub
    '函数名称:DisplayTechPara
    '功能描述:根据Sql语句显示任务书的技术参数部分
    '输入参数:strSql数据库查询语句   
    'tblForDispaly;技术参数的表格
    Public Sub DisplayTechPara(ByVal tblForDispaly As HtmlTable, ByVal strSql As String)
        Dim MusterTechParanum As Int32       
        PubDataAdapter.SelectCommand.CommandText = PubStrSql
        PubDataAdapter.Fill(PubDataSet, "mustertechpara")
        MusterTechParanum = PubDataSet.Tables("mustertechpara").Rows.Count    '技术参数项目数
        '动态生成技术参数的单元格
        tblForDispaly.Rows(1).Cells(0).RowSpan = FormatNumber(MusterTechParanum / 2, 0) + 1
        For i = 0 To FormatNumber((MusterTechParanum / 2), 0) - 1
            myrow = New HtmlTableRow()
            For j = 0 To 3
                mycell = New HtmlTableCell()
                mycell.Controls.Add(New LiteralControl())
                myrow.Cells.Add(mycell)
            Next
            tblForDispaly.Rows.Add(myrow)
        Next
        '将技术参数名写入单元格
        k = 0
        For i = 0 To FormatNumber(MusterTechParanum / 2, 0) - 1
            For j = 0 To 1
                tblForDispaly.Rows(i + 2).Cells(2 * j).InnerText = _
                Trim(PubDataSet.Tables("mustertechpara").Rows(k)("project"))
                k = k + 1
                If k = MusterTechParanum Then
                    Exit For
                End If
            Next
        Next
        '动态加载textbox
        Dim objTBpara As TextBox
        k = 0
        For i = 0 To tblForDispaly.Rows.Count - 3
            For j = 0 To 1
                objTBpara = New TextBox()
                objTBpara.ID = "tbTechPara" & (k + 1)
                objTBpara.CssClass = "tt"
                objTBpara.ReadOnly = True
                objTBpara.Text = Trim(PubDataSet.Tables("mustertechpara").Rows(k)("Quantity"))
                tblForDispaly.Rows(i + 2).Cells(2 * j + 1).Controls.Add(objTBpara)
                k = k + 1
                If k = MusterTechParanum Then
                    Exit For
                End If
            Next
        Next
    End Sub
    '函数名称:DisplayMainPart
    '功能描述:根据Sql语句显示任务书的主关部件部分   
    '输入参数:strSql数据库查询语句   
    'tblForDispaly;技术参数的表格
    Public Sub DisplayMainPart(ByVal tblForDispaly As HtmlTable, ByVal strSql As String)
        Dim MusterMainPartnum As Int32
        Dim myrow As HtmlTableRow
        '动态加载textbox
        Dim objTBpara As TextBox
        Dim mycell As HtmlTableCell
        PubDataAdapter.SelectCommand.CommandText = PubStrSql
        PubDataAdapter.Fill(PubDataSet, "mustermainpart")
        MusterMainPartnum = PubDataSet.Tables("mustermainpart").Rows.Count   '主关部件项目数
        tblForDispaly.Rows(0).Cells(0).RowSpan = FormatNumber(MusterMainPartnum / 2, 0) + 1
        '动态生成主关部件单元格
        For i = 0 To FormatNumber(MusterMainPartnum / 2, 0) - 1
            myrow = New HtmlTableRow()
            For j = 0 To 5
                mycell = New HtmlTableCell()
                mycell.Controls.Add(New LiteralControl())
                myrow.Cells.Add(mycell)
            Next
            tblForDispaly.Rows.Add(myrow)
        Next
        '将主关部件名写入单元格
        k = 0
        For i = 0 To FormatNumber(MusterMainPartnum / 2, 0) - 1
            For j = 0 To 1
                tblForDispaly.Rows(i + 1).Cells(3 * j).InnerText = _
                Trim(PubDataSet.Tables("mustermainpart").Rows(k)("NameSpec"))
                k = k + 1
                If k = MusterMainPartnum Then
                    Exit For
                End If
            Next
        Next
        '动态加载textbox
        k = 0
        For i = 0 To tblForDispaly.Rows.Count - 2
            For j = 0 To 1
                objTBpara = New TextBox()
                objTBpara.ID = "tbGuiGe" & (k + 1)
                objTBpara.CssClass = "tt"
                objTBpara.ReadOnly = True
                objTBpara.Text = Trim(PubDataSet.Tables("mustermainpart").Rows(k)("GuiGe"))
                tblForDispaly.Rows(i + 1).Cells(3 * j + 1).Controls.Add(objTBpara)
                k = k + 1

⌨️ 快捷键说明

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