📄 accepttaskbook.aspx.vb
字号:
Case "发泡剂"
DestFlag = "FP"
Case "温控器"
DestFlag = "WK"
Case "主控板"
DestFlag = "ZK"
Case "其它"
DestFlag = "QT"
End Select
PubStrSql = "select testid, IceNum,IceSerial,TestObjFlag from taskbook" _
& " where testid='" & drpTestID.SelectedItem.Value.Trim & "'" _
& " and address='" & DropDownListaddress.SelectedItem.Text.Trim & "'"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "taskbookobj")
PubStrSql = "select * from MusterMainPart where testid='" _
& drpTestID.SelectedItem.Value.Trim & "'" & " and address='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "MainPart")
PubStrSql = "select * from MusterTechPara where testid='" _
& drpTestID.SelectedItem.Value.Trim & "'" & " and address='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "TechPara")
If PubDataSet.Tables("taskbookobj").Rows(0)("testobjflag") = 0 Then
'试验目的不是其它
If txtTestObject.Text.Trim = "全新产品" Then '实验目的是全新产品
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "AcceptNum")
If PubDataSet.Tables("AcceptNum").Rows.Count <> 0 Then
AcceptNum = PubDataSet.Tables("AcceptNum").Rows(0)("SHYCSH")
AcceptNum += 1
Else
AcceptNum = 1
End If
Else '试验目的不是其它和全新产品
Select Case txtTestObject.Text.Trim
Case "压机匹配"
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'" _
& " and ZHGJGG='" _
& Trim(PubDataSet.Tables("MainPart").Rows(0)("GuiGe")) & "'"
tempString = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim _
& "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
Case "蒸发器\冷凝器改进"
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'" _
& " and ZHGJGG='" _
& Trim(PubDataSet.Tables("MainPart").Rows(3)("GuiGe")) _
& Trim(PubDataSet.Tables("MainPart").Rows(5)("GuiGe")) _
& Trim(PubDataSet.Tables("MainPart").Rows(6)("GuiGe")) & "'"
tempString = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
Case "制冷剂"
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'" _
& " and ZHGJGG='" _
& Trim(PubDataSet.Tables("TechPara").Rows(0)("Quantity")) & "'"
tempString = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
Case "发泡剂"
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'" _
& " and ZHGJGG='" _
& Trim(PubDataSet.Tables("TechPara").Rows(8)("Quantity")) & "'"
tempString = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
Case "温控器"
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'" _
& " and ZHGJGG='" _
& Trim(PubDataSet.Tables("MainPart").Rows(1)("GuiGe")) & "'"
tempString = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
Case "主控板"
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='" _
& txtTestObject.Text.Trim & "'" & " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'" _
& " and ZHGJGG='" _
& Trim(PubDataSet.Tables("MainPart").Rows(2)("GuiGe")) & "'"
tempString = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" _
& " and SHYMD='" & txtTestObject.Text.Trim & "'" _
& " and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
Case Else
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" _
& " and SHYMD='其它' and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
End Select
If txtTestObject.Text.Trim = "压机匹配" Or _
txtTestObject.Text.Trim = "蒸发器\冷凝器改进" Or _
txtTestObject.Text.Trim = "制冷剂" Or _
txtTestObject.Text.Trim = "发泡剂" Or _
txtTestObject.Text.Trim = "温控器" Or _
txtTestObject.Text.Trim = "主控板" Then
PubDataAdapter.SelectCommand.CommandText = tempString
PubDataAdapter.Fill(PubDataSet, "ChangeNum")
ChangeNum = PubDataSet.Tables("ChangeNum").Rows.Count
End If
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "AcceptNum")
If PubDataSet.Tables("AcceptNum").Rows.Count <> 0 Then
AcceptNum = PubDataSet.Tables("AcceptNum").Rows(0)("SHYCSH")
AcceptNum += 1
Else
AcceptNum = 1
End If
If PubDataSet.Tables("AcceptNum").Rows.Count = 0 Then
Select Case txtTestObject.Text.Trim
Case "压机匹配"
ChangeNum += 1
Case "蒸发器\冷凝器改进"
ChangeNum += 1
Case "制冷剂"
ChangeNum += 1
Case "发泡剂"
ChangeNum += 1
Case "温控器"
ChangeNum += 1
Case "主控板"
ChangeNum += 1
End Select
End If
End If
Else
PubStrSql = "select * from accepttaskbooknum where BXXH='" _
& txtIceModel.Text.Trim & "'" & " and SHYMD='其它' and DZH='" _
& DropDownListaddress.SelectedItem.Text.Trim & "'"
PubDataAdapter.SelectCommand.CommandText = PubStrSql
PubDataAdapter.Fill(PubDataSet, "AcceptNum")
If PubDataSet.Tables("AcceptNum").Rows.Count <> 0 Then
AcceptNum = PubDataSet.Tables("AcceptNum").Rows(0)("SHYCSH")
AcceptNum += 1
Else
AcceptNum = 1
End If
End If
'形成编号
If PubDataSet.Tables("taskbookobj").Rows(0)("testobjflag") = 1 Then
TaskBookSerial = "HR" & strDate & AddressFlag & "_" _
& txtIceModel.Text.Trim & "_" & "QT" & "_" & AcceptNum.ToString("00")
tempIceBoxSerial = "S" & strDate & AddressFlag & "_" _
& txtIceModel.Text.Trim & "_" & "QT" & "_" & AcceptNum.ToString("00")
Else
If txtTestObject.Text.Trim = "全新产品" Then
TaskBookSerial = "HR" & strDate & AddressFlag & "_" _
& txtIceModel.Text.Trim & "_" & DestFlag & "." & AcceptNum.ToString("00")
tempIceBoxSerial = "S" & strDate & AddressFlag & "_" _
& txtIceModel.Text.Trim & "_" & DestFlag & "." & AcceptNum.ToString("00")
ElseIf txtTestObject.Text.Trim = "压机匹配" Or _
txtTestObject.Text.Trim = "蒸发器\冷凝器改进" Or _
txtTestObject.Text.Trim = "制冷剂" _
Or txtTestObject.Text.Trim = "发泡剂" Or _
txtTestObject.Text.Trim = "温控器" Or _
txtTestObject.Text.Trim = "主控板" Then
TaskBookSerial = "HR" & strDate & AddressFlag & "_" _
& txtIceModel.Text.Trim & "_" & DestFlag & "_" _
& ChangeNum.ToString("00") & "." & AcceptNum.ToString("00")
tempIceBoxSerial = "S" & strDate & AddressFlag _
& "_" & txtIceModel.Text.Trim & "_" & DestFlag _
& "_" & ChangeNum.ToString("00") & "." & AcceptNum.ToString("00")
Else
TaskBookSerial = "HR" & strDate & AddressFlag & "_" _
& txtIceModel.Text.Trim & "_" & "QT" & "_" & AcceptNum.ToString("00")
tempIceBoxSerial = "S" & strDate & AddressFlag & "_" _
& txtIceModel.Text.Trim & "_" & "QT" & "_" & AcceptNum.ToString("00")
End If
End If
For intloopindex = 1 To CInt(txtIceNum.Text.Trim)
IceBoxSerial(intloopindex) = tempIceBoxSerial & "-" _
& intloopindex.ToString("00")
Next
For intloopindex = 1 To CInt(txtIceNum.Text.Trim)
TotalIceBoxSerial += IceBoxSerial(intloopindex) & "#"
Next
TotalIceBoxSerial = Left(TotalIceBoxSerial, Len(TotalIceBoxSerial) - 1)
If InStr(Trim(PubDataSet.Tables("taskbookobj").Rows(0)("testid")), "HR") = 0 Then
txtTestID.Text = TaskBookSerial
If Trim(PubDataSet.Tables("taskbookobj").Rows(0)("iceSerial")) = "" Then
txtIceSerial.Text = TotalIceBoxSerial
Else
txtIceSerial.Text = Trim(PubDataSet.Tables("taskbookobj").Rows(0)("iceSerial"))
End If
Else
txtTestID.Text = Trim(PubDataSet.Tables("taskbookobj").Rows(0)("testid"))
txtIceSerial.Text = Trim(PubDataSet.Tables("taskbookobj").Rows(0)("iceSerial"))
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -