public void cargarMatriculas() { // CARGAR EN LA TABLA MatriculaBL bl = new MatriculaBL(); gvMatriculas.DataSource = bl.getMatriculas(); gvMatriculas.DataBind(); }
protected void btnMatricular_Click(object sender, EventArgs e) { string id_alumno = ddlAlumno.SelectedValue; string id_curso = ddlCurso.SelectedValue; DateTime fechaHoy = DateTime.Now; MatriculaBL bl = new MatriculaBL(); bl.Matricular(id_alumno, id_curso, fechaHoy); cargarMatriculas(); }
protected void gvMatriculas_RowCommand(object sender, GridViewCommandEventArgs e) { short id = short.Parse(e.CommandArgument.ToString()); if (e.CommandName.ToString() == "eliminar") { MatriculaBL bl = new MatriculaBL(); bl.Deletematricula(id); cargarMatriculas(); } }
protected void btnMatricular_Click(object sender, EventArgs e) { try { mitb = (DataTable)Session["Matricula"]; if (cboAlumno.SelectedValue == "-1") { throw new Exception("Debe seleccionar un alumno."); } if (mitb.Rows.Count > Int16.Parse(cboCantCursos.SelectedValue)) { throw new Exception("La cantidad de cursos excede a la cantidad máxima."); } MatriculaBE matriculaBE = new MatriculaBE(); MatriculaBL matriculaBL = new MatriculaBL(); matriculaBE.idPeriodo = Int16.Parse(cboPeriodo.SelectedValue); matriculaBE.idAlumno = Int16.Parse(cboAlumno.SelectedValue); matriculaBE.grado = Int16.Parse(cboGrado.SelectedValue); matriculaBE.UsuRegistro = "dibarra"; matriculaBE.Estado = 1; mitb.Columns.Remove("Descripcion"); matriculaBE.DetalleMatricula = mitb; String output = matriculaBL.RegistrarMatricula(matriculaBE); if (output.StartsWith("[ERROR]")) { throw new Exception(output); } else { lblMensaje.Text = "Se registró la matricula Nro: " + output + " exitosamente."; mpeMensaje.Show(); cboAlumno.SelectedIndex = 0; cboPeriodo.SelectedIndex = 0; cboCantCursos.SelectedIndex = 0; cboGrado.SelectedIndex = 0; cboCursos.SelectedIndex = 0; CrearTabla(); } } catch (Exception ex) { lblMensaje.Text = ex.Message; mpeMensaje.Show(); } }
public JsonResult ObtenerPorId(Int64 pId) { return(Json(MatriculaBL.ObtenerPorId(pId), JsonRequestBehavior.AllowGet)); }