Protected Sub rdoPlat_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
lblmessage.Text = ""
Try
Dim row As System.Web.UI.WebControls.GridViewRow
row = sender.Parent.Parent
Dim lblno As String = DirectCast(row.FindControl("lblno"), Label).Text
Dim lblPartNo As String = DirectCast(row.FindControl("lblPartNo"), Label).Text
Dim rdoPlat As String = DirectCast(row.FindControl("rdoPlat"), RadioButton).Text
Dim lblPbspect As Label = DirectCast(row.FindControl("lblPbspect"), Label)
Dim lblCdspect As Label = DirectCast(row.FindControl("lblCdspect"), Label)
Dim lblHgspect As Label = DirectCast(row.FindControl("lblHgspect"), Label)
Dim lblCrspect As Label = DirectCast(row.FindControl("lblCrspect"), Label)
Dim lblBrspect As Label = DirectCast(row.FindControl("lblBrspect"), Label)
Dim lblClspect As Label = DirectCast(row.FindControl("lblClspect"), Label)
Dim lblPbContent As String = DirectCast(row.FindControl("lblPbContent"), Label).Text.Trim()
Dim lblCdContent As String = DirectCast(row.FindControl("lblCdContent"), Label).Text.Trim()
Dim lblHgContent As String = DirectCast(row.FindControl("lblHgContent"), Label).Text.Trim()
Dim lblCrContent As String = DirectCast(row.FindControl("lblCrContent"), Label).Text.Trim()
Dim lblBrContent As String = DirectCast(row.FindControl("lblBrContent"), Label).Text.Trim()
Dim lblClContent As String = DirectCast(row.FindControl("lblClContent"), Label).Text.Trim()
Dim lblPbJudment As Label = DirectCast(row.FindControl("lblPbJudment"), Label)
Dim lblCdJudment As Label = DirectCast(row.FindControl("lblCdJudment"), Label)
Dim lblHgJudment As Label = DirectCast(row.FindControl("lblHgJudment"), Label)
Dim lblCrJudment As Label = DirectCast(row.FindControl("lblCrJudment"), Label)
Dim lblBrJudment As Label = DirectCast(row.FindControl("lblBrJudment"), Label)
Dim lblClJudment As Label = DirectCast(row.FindControl("lblClJudment"), Label)
If lblPartNo.ToLower() = "packing" Then
lblPbspect.Text = PackingPb
lblCdspect.Text = PackingCd
lblHgspect.Text = PackingHg
lblCrspect.Text = PackingCr
lblBrspect.Text = PackingBr
lblClspect.Text = PackingCl
Else
Dim custid As String = ""
Dim strString As String = lblPartNo
Dim strSplit2 As Array
Dim j As Integer
strSplit2 = strString.Split("/")
For j = 0 To strSplit2.Length - 1
If j = 0 Then
custid = strSplit2(j)
Else
custid = custid & "','" & strSplit2(j)
End If
Next
Dim spec As String = EdxResult(custid, rdoPlat.ToLower())
If spec <> "" Then
Dim strStringS As String = spec
Dim strSplitS As Array
Dim k As Integer
strSplitS = strStringS.Split("/")
For k = 0 To strSplitS.Length - 1
If k = 0 Then
lblPbspect.Text = strSplitS(k)
ElseIf k = 1 Then
lblCdspect.Text = strSplitS(k)
ElseIf k = 2 Then
lblHgspect.Text = strSplitS(k)
ElseIf k = 3 Then
lblCrspect.Text = strSplitS(k)
ElseIf k = 4 Then
lblBrspect.Text = strSplitS(k)
ElseIf k = 5 Then
lblClspect.Text = strSplitS(k)
End If
'-----------check status------------------------------
Dim a As Double
Dim type1 As String = ""
Dim type2 As String = ""
Dim type3 As Label
For x As Integer = 1 To 6
If x = 1 Then
type1 = lblPbspect.Text
type2 = lblPbContent
type3 = lblPbJudment
ElseIf x = 2 Then
type1 = lblCdspect.Text
type2 = lblCdContent
type3 = lblCdJudment
ElseIf x = 3 Then
type1 = lblHgspect.Text
type2 = lblHgContent
type3 = lblHgJudment
ElseIf x = 4 Then
type1 = lblCrspect.Text
type2 = lblCrContent
type3 = lblCrJudment
ElseIf x = 5 Then
type1 = lblBrspect.Text
type2 = lblBrContent
type3 = lblBrJudment
ElseIf x = 6 Then
type1 = lblClspect.Text
type2 = lblClContent
type3 = lblClJudment
End If
If Double.TryParse(type1, a) And Double.TryParse(type2, a) Then
If CDbl(type2) > CDbl(type1) Then
type3.Text = "REJECT"
Else
type3.Text = "ACCEPT"
End If
End If
Next
'-----------------------------------------
Next
Else
lblPbspect.Text = ""
lblCdspect.Text = ""
lblHgspect.Text = ""
lblCrspect.Text = ""
lblBrspect.Text = ""
lblClspect.Text = ""
End If
End If
Catch ex As Exception
lblmessage.Text = ex.Message()
End Try
End Sub