📄 clsbiz.vb
字号:
'业务逻辑类
Public Class clsBiz
Inherits clsDataAccess
'定义子类使用的变量
Public intLoopIndex As Int16 '循环变量
Public i%, j%, k% '循环变量
''''''''''''''''''''''''''''''''
'函数名称:DisplayStandardClass
'函数功能:在指定的下拉框中显示标准类别
'输入参数:drpStandardClass标准类别下拉框
Public Sub DisplayStandardClass(ByVal drpStandardClass As DropDownList)
PubStrSql = "select distinct standardClass from Standard order by standardClass"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "standardClass")
drpStandardClass.DataSource = PubDataSet.Tables("standardClass")
drpStandardClass.DataBind()
End Sub
'函数名称:DisplayStandardSerial
'函数功能:根据给定的标准类别显示该类别的标准编号
'输入参数:strStandardClass标准类别
' drpStandardSerial标准编号下拉框
Public Sub DisplayStandardSerial(ByVal strStandardClass As String, _
ByVal drpStandardSerial As DropDownList)
PubStrSql = "select distinct standardserial from standardserial " _
& "where standardClass='" & strStandardClass & "' order by standardserial"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "standardserial")
drpStandardSerial.DataSource = PubDataSet.Tables("standardserial")
drpStandardSerial.DataBind()
End Sub
'函数名称:DisplayTestObj
'函数功能:根据给定的标准编号显示该标准编号的实验目的
'输入参数:strStandardSerial标准编号
' drpTestObj实验目的下拉框
Public Sub DisplayTestObj(ByVal strStandardSerial As String, ByVal drpTestObj As DropDownList)
PubStrSql = "select distinct testobject from testobj" & _
" where standardserial='" & strStandardSerial & "' order by testobject"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "testobject")
drpTestObj.DataSource = PubDataSet.Tables("testobject")
drpTestObj.DataBind()
End Sub
'函数名称:DisplayTestObj
'函数功能:显示所有的实验目的
'输入参数:drpTestObj实验目的下拉框
Public Sub DisplayTestObj(ByVal drpTestObj As DropDownList)
PubStrSql = "select distinct testobject from testobj order by testobject"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "testobject")
With drpTestObj
.DataSource = PubDataSet.Tables("testobject")
.DataTextField = "testobject"
.DataValueField = "testobject"
.DataBind()
End With
End Sub
'函数名称:DisplayNoClassifiedTestProject
'函数功能:在给定的列表框中显示没有分类的实验项目
'输入参数:listTestProject要显示的列表框
Public Sub DisplayNoClassifiedTestProject(ByVal listTestProject As ListBox)
'选择没有分类的实验项目
PubStrSql = "select distinct project from TestProject " _
& "where project not in (select distinct project from testClass) order by project"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "AllTestProject")
listTestProject.DataSource = PubDataSet.Tables("AllTestProject")
listTestProject.DataBind()
End Sub
'函数名称:DisplayTestClass
'函数功能:在给定的下拉框中显示没有分类的实验项目
'输入参数:drpTestClass要显示的列表框
Public Sub DisplayTestClass(ByVal drpTestClass As DropDownList)
PubStrSql = "select distinct TestClass from TClass order by TestClass"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "TestClass")
drpTestClass.DataSource = PubDataSet.Tables("TestClass")
drpTestClass.DataBind()
End Sub
'函数名称:DisplayCurrentTestProjectInListBox
'函数功能:在给定的列表框中显示指定的实验类别的实验项目
'输入参数:strTestClass实验类别
' listTestProject要显示的项目的listbox
Public Sub DisplayCurrentTestProjectInListBox(ByVal strTestClass As String, ByVal listTestProject As ListBox)
PubStrSql = "select distinct project from TestClass"
PubStrSql = PubStrSql & " where TestClass='" & strTestClass & "' order by project"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "testProject")
listTestProject.DataSource = PubDataSet.Tables("testProject")
listTestProject.DataBind()
End Sub
'函数名称:DisplayAddress
'函数功能:在给定的下拉框中显示地址
'输入参数:drpDropDownList指定的下拉框
Public Sub DisplayAddress(ByVal drpDropDownList As DropDownList)
'在下拉框中显示地址
PubStrSql = "Select * from AddressTable order by Address"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "Address")
With drpDropDownList
.DataSource = PubDataSet.Tables("Address")
.DataTextField = "Address"
.DataValueField = "Address"
.DataBind()
End With
End Sub
'函数名称:DisplayBrand
'函数功能:在给定的下拉框中显示品牌
'输入参数:drpDropDownList指定的下拉框
Public Sub DisplayBrand(ByVal drpDropDownList As DropDownList)
PubStrSql = "select * from Tbl_Band"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "brand")
With drpDropDownList
.DataSource = PubDataSet.Tables("brand")
.DataTextField = "Band"
.DataValueField = "Band"
.DataBind()
End With
End Sub
'函数名称:DisplayConsumeAddress
'函数功能:在给定的下拉框中显示消费地区
'输入参数:drpDropDownList指定的下拉框
Public Sub DisplayConsumeAddress(ByVal drpDropDownList As DropDownList)
PubStrSql = "select * from consumeaddress"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "xiaofeidiqu")
With drpDropDownList
.DataSource = PubDataSet.Tables("xiaofeidiqu")
.DataTextField = "consumeaddress"
.DataValueField = "consumeaddress"
.DataBind()
End With
End Sub
'函数名称:DisplayOneColumnInDropDownList
'函数功能:在下拉框中显示strSql语句的内容
'输入参数:strSql数据库查询语句
'drpDownList显示数据的下拉框
'下拉框的数据显示和数据值都是一个字段
Public Sub DisplayOneColumnInDropDownList(ByVal strSql As String, ByVal drpDownList As DropDownList)
PubDataAdapter.SelectCommand.CommandText = strSql
PubDataAdapter.Fill(PubDataSet, "tblDisplayOneColumnInDropDownList")
With drpDownList
.DataSource = PubDataSet.Tables("tblDisplayOneColumnInDropDownList")
.DataTextField = PubDataSet.Tables("tblDisplayOneColumnInDropDownList").Columns(0).ColumnName
.DataValueField = PubDataSet.Tables("tblDisplayOneColumnInDropDownList").Columns(0).ColumnName
.DataBind()
End With
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -