001.
Public
Function
SaveGrid(
ByVal
objGv
As
GridView,
ByVal
newID
As
Integer
)
As
Boolean
002.
003.
004.
005.
006.
Dim
gvr
As
GridViewRow
007.
008.
Dim
i
As
Integer
= 0
009.
Dim
Score
As
Integer
010.
Dim
gvComment
As
String
011.
Dim
Radioname
As
String
012.
Dim
Textboxname
As
String
013.
014.
015.
With
objGv
016.
For
Each
gvr
In
.Rows
017.
018.
Dim
rd10
As
RadioButton
019.
Radioname = .ID &
"_10"
020.
rd10 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
021.
022.
If
rd10.Checked
Then
023.
024.
025.
Score = 10
026.
End
If
027.
028.
Dim
rd9
As
RadioButton
029.
Radioname = .ID &
"_9"
030.
rd9 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
031.
If
rd9.Checked
Then
032.
Score = 9
033.
End
If
034.
035.
Dim
rd8
As
RadioButton
036.
Radioname = .ID &
"_8"
037.
rd8 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
038.
If
rd8.Checked
Then
039.
Score = 8
040.
End
If
041.
042.
Dim
rd7
As
RadioButton
043.
Radioname = .ID &
"_7"
044.
rd7 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
045.
If
rd7.Checked
Then
046.
Score = 7
047.
048.
End
If
049.
050.
Dim
rd6
As
RadioButton
051.
Radioname = .ID &
"_6"
052.
rd6 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
053.
If
rd6.Checked
Then
054.
Score = 6
055.
End
If
056.
057.
Dim
rd5
As
RadioButton
058.
Radioname = .ID &
"_5"
059.
rd5 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
060.
If
rd5.Checked
Then
061.
Score = 5
062.
End
If
063.
064.
Dim
rd4
As
RadioButton
065.
Radioname = .ID &
"_4"
066.
rd4 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
067.
If
rd4.Checked
Then
068.
Score = 4
069.
End
If
070.
071.
Dim
rd3
As
RadioButton
072.
Radioname = .ID &
"_3"
073.
rd3 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
074.
If
rd3.Checked
Then
075.
Score = 3
076.
End
If
077.
078.
Dim
rd2
As
RadioButton
079.
Radioname = .ID &
"_2"
080.
rd2 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
081.
If
rd2.Checked
Then
082.
Score = 2
083.
End
If
084.
085.
Dim
rd1
As
RadioButton
086.
Radioname = .ID &
"_1"
087.
rd1 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
088.
If
rd1.Checked
Then
089.
Score = 1
090.
End
If
091.
092.
Dim
rd0
As
RadioButton
093.
Radioname = .ID &
"_0"
094.
rd0 =
CType
(.Rows(i).FindControl(Radioname), RadioButton)
095.
If
rd0.Checked
Then
096.
097.
Score = 0
098.
099.
End
If
100.
101.
Dim
txtcomment
As
TextBox
102.
Textboxname = .ID &
"_comment"
103.
txtcomment =
CType
(.Rows(i).FindControl(Textboxname), TextBox)
104.
If
rd0.Checked
Then
105.
106.
107.
gvComment = (.ID &
"_comment"
).ToString
108.
109.
End
If
110.
111.
112.
113.
114.
115.
116.
117.
118.
Select
Case
objGv.ID
119.
Case
"gvchk1"
120.
Me
.AddInspectDetail(newID,
CInt
(gvr.Cells(0).Text), Score, txtcomment.Text)
121.
122.
Case
"gvchk2"
123.
124.
125.
Me
.AddInspectDetail(newID,
CInt
(gvr.Cells(0).Text), Score, txtcomment.Text)
126.
127.
Case
"gvchk3"
128.
Me
.AddInspectDetail(newID,
CInt
(gvr.Cells(0).Text), Score, txtcomment.Text)
129.
130.
131.
Case
"gvchk4"
132.
Me
.AddInspectDetail(newID,
CInt
(gvr.Cells(0).Text), Score, txtcomment.Text)
133.
End
Select
134.
135.
136.
137.
138.
i += 1
139.
Next
140.
.Enabled =
False
141.
End
With
142.
143.
End
Function