private void btnVerMatricula_Click(object sender, EventArgs e) { /* HojaDeMatricula report = new HojaDeMatricula(); * report.Parameters[0].Value = "SH-181096PV"; * ReportPrintTool printTool = new ReportPrintTool(report); * // Invoke the Print dialog. * printTool.PrintDialog();*/ int carne = gridViewLista.GetSelectedRows()[0]; var b = gridViewLista.GetFocusedDataRow()["CARNET"]; HojaMatricula frmPrint = new HojaMatricula(b.ToString()); frmPrint.Show(); }
private void guardarEstudiante() { var pnombre = txtPrimerNombre.Text; var snombre = txtSegundoNombre.Text; var papellido = txtPrimerApellido.Text; var sapellido = txtSegundoApellido.Text; var codMined = txtCodMINED.Text; var carnet = txtCarnet.Text; var cedula = txtCedula.Text; var fnacimiento = Convert.ToDateTime(dateFechaNacimiento.EditValue); var departamento = comboDepartamento.EditValue; var municipio = txtMunicipio.Text; var barrio = ""; var direccion = txtDireccion.Text.ToUpper(); var partida = true; var sexo = checkMasculino.Checked ? "M" : "F"; var telefono = txtTelefono.Text; var nacionalidad = txtNacionalidad.Text.ToUpper(); var discapacidad = txtPadecimientos.Text.ToUpper(); var modalidad = txtPrograma.EditValue; var grado = txtGrado.EditValue; var turno = txtTurno.EditValue; var email = txtCorreo.Text; if (pnombre.Trim() == string.Empty) { MessageBox.Show("Error al guardar"); return; } var result = ConexionBD.EjecutarPro("sp_INSERTARESTUDIANTE", codMined, carnet, cedula, pnombre, snombre, papellido, sapellido, fnacimiento, departamento, municipio, barrio, direccion, partida, sexo, telefono, nacionalidad, discapacidad, modalidad, grado, turno, email, Usuario.CodUser ); for (int i = 0; i < dtTutores.Rows.Count; i++) { var nbtutor = dtTutores.Rows[i]["Nombre"].ToString().ToUpper(); var parentescotutor = dtTutores.Rows[i]["Parentesco"].ToString(); var telefonotutor = dtTutores.Rows[i]["Telefono"].ToString(); var operadortutor = dtTutores.Rows[i]["Operador"].ToString(); var correotutor = dtTutores.Rows[i]["Correo"].ToString(); var resultTutores = ConexionBD.EjecutarPro("sp_AGREGARTUTOR", carnet, nbtutor, telefonotutor, operadortutor, correotutor, parentescotutor, Usuario.CodUser); } if (checkTraslado.Checked) { var trasladocodestable = txtTrasladoCodEstabl.Text; var trascodcentro = txtTrasladoCodCentro.Text; var trasnbcentro = txtTrasladoNombre.Text; var trasprograma = txtTrasladoPrograma.Text; var trasmodalidad = txtTrasladoModalidad.Text; var trasgrado = txtTrasladoGrado.Text; var trasperiodo = comboTrasladoPeriodo.Text; var resulttraslado = ConexionBD.EjecutarPro("sp_INSERTARTRASLADO", carnet, trasladocodestable, trascodcentro, trasnbcentro, trasprograma, trasmodalidad, trasgrado, trasperiodo, Usuario.CodUser); } var programa = txtPrograma.EditValue; var vlmatricula = Convert.ToDouble(txtMatricula.EditValue); var vlmensualidad = Convert.ToDouble(txtMensualidadTotal.EditValue); var fhmatricula = DateTime.Now; var resultmatricula = ConexionBD.EjecutarPro("sp_INSERTARMATRICULA", carnet, programa, modalidad, grado, turno, vlmatricula, vlmensualidad, fhmatricula, Usuario.CodUser); if (checkBeca.Checked) { var porcentaje = Convert.ToDouble(txtMontoPor.EditValue); var montocordobas = Convert.ToDouble(txtMonedaCor.EditValue); var mensualidadtotal = Convert.ToDouble(txtMensualidadTotal.EditValue); var resultbeca = ConexionBD.EjecutarPro("sp_INSERTARBECA", porcentaje, montocordobas, mensualidadtotal, DateTime.Now, Usuario.CodUser); } if (result && resultmatricula) { HojaMatricula print = new HojaMatricula(carnet); var dialog = print.ShowDialog(); if (dialog == DialogResult.OK) { this.DialogResult = DialogResult.OK; this.Dispose(); } } else { MessageBox.Show("Error al guardar"); } }