-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModificaCalif.aspx.cs
More file actions
237 lines (208 loc) · 8.7 KB
/
ModificaCalif.aspx.cs
File metadata and controls
237 lines (208 loc) · 8.7 KB
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
using SchoolProyect.BL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SchoolProyect.DAL.Models;
namespace SchoolProyect
{
public partial class ModificaAlumno : System.Web.UI.Page
{
Operaciones opRepo = new Operaciones();
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string[] listMate = opRepo.DevuelveMaterias1er();
foreach (string mate in listMate)
{
DropDownList1.Items.Add(mate);
DropDownList2.Items.Add(mate);
}
string[] listMate2 = opRepo.DevuelveMaterias2do();
foreach (string mate in listMate2)
{
DropDownList5.Items.Add(mate);
DropDownList6.Items.Add(mate);
}
string[] listMate3 = opRepo.DevuelveMaterias3er();
foreach (string mate in listMate3)
{
DropDownList8.Items.Add(mate);
DropDownList9.Items.Add(mate);
}
int[] listMatri = opRepo.DevuelveMatris1();
foreach (int matris in listMatri)
DropDownList3.Items.Add(matris.ToString());
int[] listMatri2 = opRepo.DevuelveMatris2();
foreach (int matris in listMatri2)
DropDownList4.Items.Add(matris.ToString());
int[] listMatr3 = opRepo.DevuelveMatris3();
foreach (int matris in listMatr3)
DropDownList7.Items.Add(matris.ToString());
}
TextBox1.Enabled = false;
TextBox3.Enabled = false;
TextBox5.Enabled = false;
TextBox7.Enabled = false;
TextBox9.Enabled = false;
TextBox11.Enabled = false;
}
protected void btnButton_Click(object sender, EventArgs e)
{
try
{
int matri = Convert.ToInt32(TextBox1.Text);
string Mate = DropDownList1.SelectedValue;
double calif = Convert.ToDouble(TextBox2.Text);
opRepo.InsertarCal(matri, Mate, calif);
Response.AppendHeader("refresh", "1");
string script = "alert('ALUMNO DE 1ero CALIFICADO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
catch (FormatException)
{
string script = "alert('INGRESAME BIEN LOS CAMPOS, NO SEAS MALO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
}
protected void btnButton_Click2(object sender, EventArgs e)
{
try
{
int matri = Convert.ToInt32(TextBox3.Text);
string Mate = DropDownList2.SelectedValue;
double calif = Convert.ToDouble(TextBox4.Text);
opRepo.ActualCalif(matri, Mate, calif);
Response.AppendHeader("refresh", "1");
string script = "alert('ALUMNO CON CALIFICACIÓN ACTUALIZADA');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
catch (FormatException)
{
string script = "alert('INGRESAME BIEN LOS CAMPOS, NO SEAS MALO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
}
protected void btnLimpiar_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
}
protected void btnBuscar_Click(object sender, EventArgs e)
{
int Matri = Convert.ToInt32(DropDownList3.SelectedValue);
TextBox1.Text = Matri.ToString();
TextBox3.Text = Matri.ToString();
GridView1.DataSource = opRepo.AlumMatri1(Matri);
GridView1.DataBind();
}
protected void btnBuscar2_Click(object sender, EventArgs e)
{
int Matri = Convert.ToInt32(DropDownList4.SelectedValue);
TextBox5.Text = Matri.ToString();
TextBox7.Text = Matri.ToString();
GridView2.DataSource = opRepo.AlumMatri2(Matri);
GridView2.DataBind();
}
protected void btnButton_Click2doAño(object sender, EventArgs e)
{
try
{
int matri = Convert.ToInt32(TextBox5.Text);
string Mate = DropDownList5.SelectedValue;
double calif = Convert.ToDouble(TextBox6.Text);
opRepo.InsertarCal(matri, Mate, calif);
Response.AppendHeader("refresh", "1");
string script = "alert('ALUMNO DE 2DO CALIFICADO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
catch(FormatException)
{
string script = "alert('INGRESAME BIEN LOS CAMPOS, NO SEAS MALO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
}
protected void btnActualizarCalif2do(object sender, EventArgs e)
{
try
{
int matri = Convert.ToInt32(TextBox7.Text);
string mate = DropDownList6.SelectedValue;
double calif = Convert.ToDouble(TextBox8.Text);
opRepo.ActualCalif(matri, mate, calif);
Response.AppendHeader("refresh", "1");
string script = "alert('ALUMNO CON CALIFICACIÓN ACTUALIZADA');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
catch (FormatException)
{
string script = "alert('INGRESAME BIEN LOS CAMPOS, NO SEAS MALO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
}
protected void btnLimpiar_Click2(object sender, EventArgs e)
{
TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";
}
protected void btnBuscar3_Click(object sender, EventArgs e)
{
int Matri = Convert.ToInt32(DropDownList7.SelectedValue);
TextBox9.Text = Matri.ToString();
TextBox11.Text = Matri.ToString();
GridView3.DataSource = opRepo.AlumMatri3(Matri);
GridView3.DataBind();
}
protected void btnButton_Click3erAño(object sender, EventArgs e)
{
try
{
int matri = Convert.ToInt32(TextBox9.Text);
string mate = DropDownList8.SelectedValue;
double calif = Convert.ToDouble(TextBox10.Text);
opRepo.InsertarCal(matri, mate, calif);
Response.AppendHeader("refresh", "1");
string script = "alert('ALUMNO DE 3ER CALIFICADO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
catch(FormatException)
{
string script = "alert('INGRESAME BIEN LOS CAMPOS, NO SEAS MALO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
}
protected void btnActualizarCalif3er(object sender, EventArgs e)
{
try
{
int matri = Convert.ToInt32(TextBox11.Text);
string mate = DropDownList9.SelectedValue;
double calif = Convert.ToDouble(TextBox12.Text);
opRepo.ActualCalif(matri, mate, calif);
Response.AppendHeader("refresh", "1");
string script = "alert('ALUMNO CON CALIFICACIÓN ACTUALIZADA');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
catch (FormatException)
{
string script = "alert('INGRESAME BIEN LOS CAMPOS, NO SEAS MALO');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
}
}
protected void btnLimpiar_Click3(object sender, EventArgs e)
{
TextBox9.Text = "";
TextBox10.Text = "";
TextBox11.Text = "";
TextBox12.Text = "";
}
//http://125.165.102.3:5070/
}
}