private void btnEliminar_Click(object sender, EventArgs e) { try { if (MessageBox.Show("¿Esta seguro de que desea eliminar este registro?", "Eliminar", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { MessageBox.Show("Resultado: " + ClaseAtencion.Eliminar(Convert.ToInt32(this.txtIDAtencion.Text))); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnModificar_Click(object sender, EventArgs e) { if (validacion()) { try { ClaseAtencion Atencion = new ClaseAtencion(Convert.ToInt32(this.txtIDAtencion.Text), Convert.ToInt32(this.txtIdMascota.Text), Convert.ToInt32(this.txtIdVeterinario.Text), this.dtpFechaAtencion.Value, this.rhtDiagnostico.Rtf, this.rhtReceta.Rtf); MessageBox.Show("Registro : " + Atencion.Modificar(Atencion)); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Registro no modificado, Datos erroneos", "Ingreso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }