void BALTAS_Click(object sender, EventArgs e) { AsignarValores(); if (Errores.AñadirTutores(tutor, check, DGVTUTORES) != null) { MessageBox.Show(Errores.AñadirTutores(tutor, check, DGVTUTORES)); } else { query = "Insert into " + tabla + "(NombreTutores,ApellidosTutores,CorreoTutores,Telefono,DNI) values ('" + tutor.nombre + "','" + tutor.apellidos + "' ,'" + tutor.correo + "' ,'" + tutor.telefono + "' ,'" + tutor.dni + "');"; if ((resultado = tutor.Cruz(conexion, query)) > 0) { BLIMPIAR.PerformClick(); MessageBox.Show("Tutor Añadido Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information); } } BVTUTORES.PerformClick(); }
void BMODIFICAR_Click(object sender, EventArgs e) { AsignarValores(); if (Errores.ModificarTutores(tutor, check, DGVTUTORES) != null) { MessageBox.Show(Errores.ModificarTutores(tutor, check, DGVTUTORES)); } else { tutor.id = Convert.ToInt32(TBIDTUTOR.Text); query = "UPDATE " + tabla + " SET NombreTutores = '" + tutor.nombre + "', ApellidosTutores = '" + tutor.apellidos + "', CorreoTutores = '" + tutor.correo + "', Telefono = '" + tutor.telefono + "', DNI = '" + tutor.dni + "' WHERE idTutores = '" + tutor.id + "';"; if ((resultado = tutor.Cruz(conexion, query)) > 0) { BLIMPIAR.PerformClick(); MessageBox.Show("Tutor Modificado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information); } } BVTUTORES.PerformClick(); }
void BBAJAS_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(TBIDTUTOR.Text)) { BVTUTORES.PerformClick(); MessageBox.Show("Seleccione el Tutor que desea borrar"); } else { tutor.id = Convert.ToInt32(TBIDTUTOR.Text); query = "Delete from " + tabla + " Where idTutores='" + tutor.id + "';"; if ((resultado = tutor.Bajas(conexion, query)) > 0) { BLIMPIAR.PerformClick(); MessageBox.Show("Tutor Eliminado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information); } } BVTUTORES.PerformClick(); }
void FormTutores_Load(object sender, EventArgs e) { BVTUTORES.PerformClick(); Design.caracteristicasGrid(DGVTUTORES, 8, 17); }