private void btnGuardar_Click(object sender, EventArgs e) { try { string rpta = ""; if (this.txtNombre.Text == string.Empty) { MensajeError("Falta ingresar algunos datos, sarán remarcados"); errorIcono.SetError(txtNombre, "Ingrese un Nombre"); } else { if (this.IsNuevo) { rpta = NPresentaciones.Insertar(this.txtNombre.Text.Trim().ToUpper(), this.txtDescripcion.Text.Trim()); } else { rpta = NPresentaciones.Editar(Convert.ToInt32(this.txtIdPresentaciones.Text), this.txtNombre.Text.Trim().ToUpper(), this.txtDescripcion.Text.Trim()); } if (rpta.Equals("OK")) { if (this.IsNuevo) { this.MensajeOk("Se Insertó de forma correcta el registro"); } else { this.MensajeOk("Se Actualizó de forma correcta el registro"); } } else { this.MensajeError(rpta); } this.IsNuevo = false; this.IsEditar = false; this.Botones(); this.Limpiar(); this.Mostrar(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }