-
Notifications
You must be signed in to change notification settings - Fork 0
/
Inscribe.asp
179 lines (150 loc) · 6.21 KB
/
Inscribe.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<%
Response.Expires = -1
%>
<!--#INCLUDE FILE="include/conexion.inc" -->
<!--#INCLUDE FILE="include/funciones.inc" -->
<%
Dim StrSql
Dim Rst
DIM RST1
codcarr=session("codcarr")
CodCli = Session("CodCli")
CodSede = Session("CodSede")
Ano = Session("Ano")
Periodo = Session("Periodo")
Curso = Trim(Request("C"))
Ramo = Trim(Request("R"))
Seccion = Trim(Request("S"))
TipoCurso = Request("H")
CodSeccTeo= trim(request("D"))
session("RamoSeleccionado")=Ramo
session("SeccionSeleccionado")=Seccion
'response.Write(tipocurso)
'response.End()
if tipocurso<>"T" then
strsql="select codcli from ra_carga"
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And codramo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
StrSql = StrSql & " and codsecc_i = " & CodSeccTeo
StrSql = StrSql & " And ramoequiv_i = '" & Ramo & "' "
if not bcl_ado(strsql, rst) then
if (clng(Seccion) = clng(0)) then
strsql = " delete from ra_cargaactividad"
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And codramo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
strsql = strsql & " And TipoCurso = '"& TipoCurso &"'"
Session("Conn").execute StrSql
end if
Response.Redirect("Horario.asp?P=S&T=S&X=1")
else
if (clng(Seccion) = clng(0)) then
strsql = " delete from ra_cargaactividad"
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And codramo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
strsql = strsql & " And TipoCurso = '"& TipoCurso &"'"
Session("Conn").execute StrSql
else
If VerificaTope(CodCli, Curso, Ramo, Seccion, CodSede, Ano, Periodo) then
Response.Redirect("Horario.asp?P=S&T=S&M=S&R=" & Ramo&"&S=" & Seccion & "&C=" & Curso)
end if
strsql = " select codramo from ra_cargaactividad"
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And codramo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
strsql = strsql & " And TipoCurso = '"& TipoCurso &"'"
if not bcl_ado(strsql, rst) then
StrSql = "insert into ra_cargaactividad (codramo,codcli,ano,periodo,reprobado,codcarr,inscrito,estado,ramoequiv,prioridad,ramoequiv_i,codsecc_i,PreInscrito,Tipocurso)"
strsql = strsql & " values ('"& curso &"','"& Codcli &"', '"& ano &"','"& periodo &"','N'"
strsql = strsql & " ,'"& codcarr &"', 'N'"
strsql = strsql & " ,'N','"& Ramo &"', '1'"
strsql = strsql & " ,'"& Ramo &"','"& SECCION &"','S','" & Trim(TipoCurso) & "')"
Session("Conn").execute StrSql
else
StrSql = "Update ra_cargaactividad Set PreInscrito = 'S', Ramoequiv_i = '" & Ramo & "', CodSecc_i = '" & Seccion & "' "
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And CodRamo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
strsql = strsql & " And TipoCurso = '"& TipoCurso &"'"
Session("Conn").execute StrSql
end if
StrSql = "Update ra_cargaactividad Set PreInscrito = 'N', ramoequiv_i = null, codsecc_i = null "
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And CodRamo <> '" & Curso & "' "
StrSql = StrSql & " And RamoEquiv_i = '" & Ramo & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
strsql = strsql & " And TipoCurso = '"& TipoCurso &"'"
Session("Conn").execute StrSql
end if
end if
else
if (clng(Seccion) = clng(0)) then
StrSql = "Update ra_carga Set PreInscrito = 'N',ramoequiv_i = null, codsecc_i = null "', SolicitudEspecial = 'N'"
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And codramo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
Session("Conn").execute StrSql
'nuevo
strsql = " delete from ra_cargaactividad"
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And codramo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
Session("Conn").execute StrSql
else
'Mejora validacion combos
strCombo = "SP_VALIDA_COMBOS_TR_PA '" & session("codcli")&"',"& Ano &"," & Periodo & ",'" & CodSede & "','" & codcarr &"','"& Ramo &"',"& Seccion &""
'response.Write(strCombo)
'response.End()
if bcl_ado(strCombo, rstCombo) then
if rstCombo("resultado") <> "OK" then
nombrecombo = rstCombo("nombrecombo")
Response.Redirect("Horario.asp?P=S&T=S&M=S&NC="& nombrecombo &"&R=" & Ramo&"&S=" & Seccion & "&C=" & Curso)
end if
end if
If VerificaTope(CodCli, Curso, Ramo, Seccion, CodSede, Ano, Periodo) then
Response.Redirect("Horario.asp?P=S&T=S&M=S&R=" & Ramo&"&S=" & Seccion & "&C=" & Curso)
end if
StrSql = "Update ra_carga Set PreInscrito = 'S', Ramoequiv_i = '" & Ramo & "', CodSecc_i = '" & Seccion & "' " ', SolicitudEspecial = 'S' "
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And CodRamo = '" & Curso & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
Session("Conn").execute StrSql
StrSql = "Update ra_carga Set PreInscrito = 'N', ramoequiv_i = null, codsecc_i = null "
StrSql = StrSql & " Where Codcli = '" & Codcli & "' "
StrSql = StrSql & " And CodRamo <> '" & Curso & "' "
StrSql = StrSql & " And RamoEquiv_i = '" & Ramo & "' "
StrSql = StrSql & " And Ano = " & Ano
StrSql = StrSql & " And Periodo = " & Periodo
Session("Conn").execute StrSql
end if
end if
Response.Redirect("Horario.asp?P=S&T=S")
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<script languaje="javascript">
function mensaje_alert1()
{
alert("hola")
return;
window.location = "Horario.asp?P=S&T=S";
}
</script>
<P> </P>
</BODY>
</HTML>
<!--#INCLUDE file="include/desconexion.inc" -->