private void BtnGuardar_Click(object sender, EventArgs e) { try { if (entidad == null) { entidad = new EPresentacion(); } entidad.Nombre = txtNombre.Text.Trim(); entidad.Descripcion = txtDescripcion.Text.Trim(); if (editar) { entidad.IdPresentacion = Convert.ToInt32(txtIdPresentacion.Text); if (presentacion.EditarPresentacion(entidad)) { MessageBox.Show("¡Presentación editada con éxito!", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); MostrarPresentacion(); Limpiar(); Deshabilitar(); btnNuevo.Enabled = true; editar = false; } } else { if (presentacion.RegistrarPresentacion(entidad)) { MessageBox.Show("¡Presentación registrada con éxito!", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); MostrarPresentacion(); Limpiar(); Deshabilitar(); btnNuevo.Enabled = true; } } if (presentacion.builder.Length != 0) { MessageBox.Show(presentacion.builder.ToString(), "Para continuar...", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error inesperado", MessageBoxButtons.OK, MessageBoxIcon.Error); } }