|
 |
|
เช็ค radio button ในกริดวิว ว่าตอบทุกข้อหรือยัง ถ้ายังไม่ตอบ ให้มีเตือนค่ะ |
|
 |
|
|
 |
 |
|

Code (VBScript)
Protected Sub BtnSave_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim chkCusID1 As RadioButton
Dim chkCusID2, chkCusID3, chkCusID4, chkCusID5, chkCusID6, chkCusID7, chkCusID8, chkCusID9 As RadioButton
Dim i As Integer
lblsCore.Text = ""
For i = 0 To GridView1.Rows.Count - 1
chkCusID1 = CType(GridView1.Rows(i).FindControl("c1"), RadioButton)
chkCusID2 = CType(GridView1.Rows(i).FindControl("c2"), RadioButton)
chkCusID3 = CType(GridView1.Rows(i).FindControl("c3"), RadioButton)
chkCusID4 = CType(GridView1.Rows(i).FindControl("c4"), RadioButton)
chkCusID5 = CType(GridView1.Rows(i).FindControl("c5"), RadioButton)
chkCusID6 = CType(GridView1.Rows(i).FindControl("c6"), RadioButton)
chkCusID7 = CType(GridView1.Rows(i).FindControl("c7"), RadioButton)
chkCusID8 = CType(GridView1.Rows(i).FindControl("c8"), RadioButton)
chkCusID9 = CType(GridView1.Rows(i).FindControl("c9"), RadioButton)
lblID = CType(GridView1.Rows(i).FindControl("lbl2"), Label)
If chkCusID1.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "1.00"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
ElseIf chkCusID2.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "1.50"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
ElseIf chkCusID3.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "2.00"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
ElseIf chkCusID4.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "2.50"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
ElseIf chkCusID5.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "3.00"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
ElseIf chkCusID6.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "3.50"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
ElseIf chkCusID7.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "4.00"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
ElseIf chkCusID8.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "4.50"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
'insertdetail()
ElseIf chkCusID9.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "5.00"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
' insertdetail()
End If
runid_core()
insertdetail()
Next
'------------------------------------------------------------
Dim chkCusIDm1 As RadioButton
Dim chkCusIDm2, chkCusIDm3, chkCusIDm4, chkCusIDm5, chkCusIDm6, chkCusIDm7, chkCusIDm8, chkCusIDm9 As RadioButton
Dim j As Integer
lblsCore.Text = ""
For j = 0 To GridView2.Rows.Count - 1
chkCusIDm1 = CType(GridView2.Rows(j).FindControl("m1"), RadioButton)
chkCusIDm2 = CType(GridView2.Rows(j).FindControl("m2"), RadioButton)
chkCusIDm3 = CType(GridView2.Rows(j).FindControl("m3"), RadioButton)
chkCusIDm4 = CType(GridView2.Rows(j).FindControl("m4"), RadioButton)
chkCusIDm5 = CType(GridView2.Rows(j).FindControl("m5"), RadioButton)
chkCusIDm6 = CType(GridView2.Rows(j).FindControl("m6"), RadioButton)
chkCusIDm7 = CType(GridView2.Rows(j).FindControl("m7"), RadioButton)
chkCusIDm8 = CType(GridView2.Rows(j).FindControl("m8"), RadioButton)
chkCusIDm9 = CType(GridView2.Rows(j).FindControl("m9"), RadioButton)
lblIDm = CType(GridView2.Rows(j).FindControl("Label1"), Label)
If chkCusIDm1.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "1.00"
lblidmang.Text = lblIDm.Text
' insertdetail()
ElseIf chkCusIDm2.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "1.50"
lblidmang.Text = lblIDm.Text
ElseIf chkCusIDm3.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "2.00"
lblidmang.Text = lblIDm.Text
ElseIf chkCusIDm4.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "2.50"
lblidmang.Text = lblIDm.Text
ElseIf chkCusIDm5.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "3.00"
lblidmang.Text = lblIDm.Text
ElseIf chkCusIDm6.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "3.50"
lblidmang.Text = lblIDm.Text
ElseIf chkCusIDm7.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "4.00"
lblidmang.Text = lblIDm.Text
ElseIf chkCusIDm8.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "4.50"
lblidmang.Text = lblIDm.Text
ElseIf chkCusIDm9.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsMang.Text = "5.00"
lblidmang.Text = lblIDm.Text
End If
runid_mang()
insertdetailM()
Next
'---------------------------------------------------------------
Dim chkCusIDf1 As RadioButton
Dim chkCusIDf2, chkCusIDf3, chkCusIDf4, chkCusIDf5, chkCusIDf6, chkCusIDf7, chkCusIDf8, chkCusIDf9 As RadioButton
Dim k As Integer
lblsfunc.Text = ""
For k = 0 To GridView3.Rows.Count - 1
chkCusIDf1 = CType(GridView3.Rows(k).FindControl("f1"), RadioButton)
chkCusIDf2 = CType(GridView3.Rows(k).FindControl("f2"), RadioButton)
chkCusIDf3 = CType(GridView3.Rows(k).FindControl("f3"), RadioButton)
chkCusIDf4 = CType(GridView3.Rows(k).FindControl("f4"), RadioButton)
chkCusIDf5 = CType(GridView3.Rows(k).FindControl("f5"), RadioButton)
chkCusIDf6 = CType(GridView3.Rows(k).FindControl("f6"), RadioButton)
chkCusIDf7 = CType(GridView3.Rows(k).FindControl("f7"), RadioButton)
chkCusIDf8 = CType(GridView3.Rows(k).FindControl("f8"), RadioButton)
chkCusIDf9 = CType(GridView3.Rows(k).FindControl("f9"), RadioButton)
lblIDf = CType(GridView3.Rows(k).FindControl("label2"), Label)
If chkCusIDf1.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsfunc.Text = "1.00"
lblidfunc.Text = lblIDf.Text
' insertdetail()
ElseIf chkCusIDf2.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsfunc.Text = "1.50"
lblidfunc.Text = lblIDf.Text
ElseIf chkCusIDf3.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsfunc.Text = "2.00"
lblidfunc.Text = lblIDf.Text
' insertdetail()
ElseIf chkCusIDf4.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsfunc.Text = "2.50"
lblidfunc.Text = lblIDf.Text
ElseIf chkCusIDf5.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsfunc.Text = "3.00"
lblidfunc.Text = lblIDf.Text
ElseIf chkCusIDf6.Checked = True Then
Me.lblsfunc.Text = "3.50"
lblidfunc.Text = lblIDf.Text
ElseIf chkCusIDf7.Checked = True Then
Me.lblsfunc.Text = "4.00"
lblidfunc.Text = lblIDf.Text
ElseIf chkCusIDf8.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsfunc.Text = "4.50"
lblidfunc.Text = lblIDf.Text
ElseIf chkCusIDf9.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsfunc.Text = "5.00"
lblidfunc.Text = lblIDf.Text
End If
runid_func()
insertdetailF()
Next
update_status()
Response.Redirect("Main.aspx")
End Sub
Tag : .NET, Web (ASP.NET)

|
|
 |
 |
 |
 |
Date :
2013-06-25 13:25:04 |
By :
b2b |
View :
767 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 05
|