private void btnEliminar_Click(object sender, EventArgs e) { try { string respuesta = ""; DialogResult opcion; opcion = MessageBox.Show("¿Seguro que desea eliminar el Parámetro?", "Eliminar Parámetro", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (opcion == DialogResult.OK) { respuesta = NegocioParametro.eliminarParametro(this.txtNomnbreParametro.Text); if (respuesta.Equals("OK")) { this.MensajeOK("Registro eliminado exitosamente"); } else { this.MensajeError(respuesta); } } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } this.limpiarCampos(); btnEliminar.Visible = false; this.mostrarParametros(); }
private void capturarIVA() { decimal iva = 0; NegocioParametro.buscarParametro(this.lblIVA.Text); if (this.tablaIva.Rows.Count != 0) { iva = (Convert.ToDecimal(this.lblSubTotalValor.Text)) * ((Convert.ToDecimal(tablaIva.CurrentRow.Cells["VALOR"].Value)) / 100); iva = Math.Round(iva, 2); this.lblIVAValor.Text = Convert.ToString(iva); } }
private void btnBuscar_Click(object sender, EventArgs e) { DataTable tablaParametro = NegocioParametro.consultarParametroTabla(this.txtNombreParametro.Text); if (tablaParametro.Rows.Count == 0) { desbloquearCampos(); } else { MessageBox.Show("Parámetro ya registrado", "Registrar Parámetro", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnBuscar_Click(object sender, EventArgs e) { NegocioParametro.consultarParametroTabla(this.txtNombreParametro.Text); if (this.tablaParametro.Rows.Count != 0) { this.txtNombreParametro.Text = Convert.ToString(this.tablaParametro.CurrentRow.Cells["NOMBREPARAMETRO"].Value); this.lblValorParametro.Text = Convert.ToString(this.tablaParametro.CurrentRow.Cells["VALOR"].Value); } else { this.limpiarCampos(); this.mostrarParametros(); MessageBox.Show("Parámetro no registrado", "Consultar Parámetro", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btnGuardar_Click(object sender, EventArgs e) { try { string respuesta = ""; if (this.txtNombreParametro.Text == string.Empty || this.txtValorParametro.Text == string.Empty) { MensajeError("Falta ingresar algunos datos"); } else { respuesta = NegocioParametro.insertarParametro(this.txtNombreParametro.Text.ToUpper(), Int32.Parse(this.txtValorParametro.Text.Trim())); this.MensajeOK("Registro ingresado exitosamente"); this.limpiarCampos(); this.bloquearCampos(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void consultarParametroTabla() { this.tablaParametro.DataSource = NegocioParametro.consultarParametroTabla(this.txtNombreParametro.Text); }
private void mostrarParametros() { this.tablaParametro.DataSource = NegocioParametro.mostrarParametros(); this.tablaParametro.Columns[0].Visible = false; }
private void mostrarIVA() { this.tablaIva.DataSource = NegocioParametro.consultarParametroTabla("IVA"); }