Doubt / converting asp to asp.net

P

Paulo Roberto

Hi everybody, how are you? I hope fine...

I am developing asp pages over 5 years, and resuming I have a project that
the teacher inputs the studants notes, so the code below paints the user
screen with vertical/horizontal input texts based on calculating the total
students on the classroom through nested loops, so I am moving slowly to
asp.net...

and to finalize the user clicks "next" to post to another asp page wich do
the SAME but using INSERT INTO instruction to adding each record on mdb
access file...

Just copying and pasting this code on .vb/VS 2005 solution wouldnt be the
best solution... What is the best method/performance doing that on asp .net
?

Thanks

<form name="notas" action="index3.asp" method="post">
<input name="materia" type="hidden" value="<%= request("materia") %>" />
<input name="trimestre" type="hidden" value="<%= request("trimestre") %>" />
<%
aluno = 31
serie = 11 ' 1 série até 3 ano colegial
notas = 3 ' PM1, PM2 e PO
Response.Write("Trimestre: " & request("trimestre") & "<br>")
Set rsNomeMateria = conn.Execute("Select * from materias where id = " &
request("materia"))
if not rsNomeMateria.Eof Then Response.Write("Matéria: " &
rsNomeMateria("Materia") & "<br><br>")
rsNomeMateria.Close
response.Write("<table border='0' cellpadding='2' cellspacing='2'>")
response.Write "<tr>"
response.Write "<td></td>"
response.Write "<td colspan='3' align='center'>1ª série</td>"
response.Write "<td colspan='3' align='center'>2ª série</td>"
response.Write "<td colspan='3' align='center'>3ª série</td>"
response.Write "<td colspan='3' align='center'>4ª série</td>"
response.Write "<td colspan='3' align='center'>5ª série</td>"
response.Write "<td colspan='3' align='center'>6ª série</td>"
response.Write "<td colspan='3' align='center'>7ª série</td>"
response.Write "<td colspan='3' align='center'>8ª série</td>"
response.Write "<td colspan='3' align='center'>1º Médio</td>"
response.Write "<td colspan='3' align='center'>2º Médio</td>"
response.Write "<td colspan='3' align='center'>3º Médio</td>"
response.Write "</tr>"

response.Write "<tr>"
response.Write "<td align='center'></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "</tr>"

For ForAlunos = 1 to aluno
response.Write("<tr>")
response.Write("<td>" & ForAlunos & "</td>")

for forserie = 1 to serie
if forserie = 1 then strSerie = "_1S"
if forserie = 2 then strSerie = "_2S"
if forserie = 3 then strSerie = "_3S"
if forserie = 4 then strSerie = "_4S"
if forserie = 5 then strSerie = "_5S"
if forserie = 6 then strSerie = "_6S"
if forserie = 7 then strSerie = "_7S"
if forserie = 8 then strSerie = "_8S"
if forserie = 9 then strSerie = "_1C"
if forserie = 10 then strSerie = "_2C"
if forserie = 11 then strSerie = "_3C"
select case (forserie mod 2)
case 0:
classenotas = "notas2"
case else
classenotas = "notas1"
end select

strSql = "Select PM1,PM2,PO From NOTAS Where Trimestre = " &
Request("trimestre") & " And Materia = " & _
Request("materia") & " And Numero = " & forAlunos & " And Serie
= " & forSerie
Set rsConsulta = conn.Execute(strSQL)
Valor(1) = ""
Valor(2) = ""
Valor(3) = ""
If Not rsConsulta.Eof Then
Valor(1) = rsConsulta("PM1")
Valor(2) = rsConsulta("PM2")
Valor(3) = rsConsulta("PO")
End If
If rsConsulta.State = 1 then rsConsulta.Close
for fornotas = 1 to notas

if fornotas = 1 then strNota = "_PM1"
if fornotas = 2 then strNota = "_PM2"
if fornotas = 3 then strNota = "_PO"%>
<td class="<%= classenotas %>"><input name="nota<%= ForAlunos & strSerie &
strNota %>" type="text" size="1" class="textbox" value="<%= Valor(fornotas)
%>"></td>
<%next 'fornotas

next 'fornotasserie

response.Write("</tr>")

next 'ForAlunos

response.Write("</table>")

%>
<br />
<input name="envia" type="submit" id="envia" value="Gravar" />
</form>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top