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();
 }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
 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);
     }
 }
示例#6
0
 private void consultarParametroTabla()
 {
     this.tablaParametro.DataSource = NegocioParametro.consultarParametroTabla(this.txtNombreParametro.Text);
 }
示例#7
0
 private void mostrarParametros()
 {
     this.tablaParametro.DataSource         = NegocioParametro.mostrarParametros();
     this.tablaParametro.Columns[0].Visible = false;
 }
示例#8
0
 private void mostrarIVA()
 {
     this.tablaIva.DataSource = NegocioParametro.consultarParametroTabla("IVA");
 }