public void consultarFactura()
        {
            NegocioFactura.consultarFacturaTabla(int.Parse(this.txtNumeroFactura.Text));
            if (this.tablaFactura.Rows.Count != 0)
            {
                this.lblClienteMostrar.Text      = Convert.ToString(this.tablaFactura.CurrentRow.Cells["IDCLIENTE"].Value);
                this.lblCIMostrar.Text           = Convert.ToString(this.tablaFactura.CurrentRow.Cells["CICLIENTE"].Value);
                this.lblNombreMostrar.Text       = Convert.ToString(this.tablaFactura.CurrentRow.Cells["NOMBRECLIENTE"].Value);
                this.lblDireccionMostrar.Text    = Convert.ToString(this.tablaFactura.CurrentRow.Cells["DIRECCIONCLIENTE"].Value);
                this.lblTelefonoFijoMostrar.Text = Convert.ToString(this.tablaFactura.CurrentRow.Cells["TELEFONOFIJOCLIENTE"].Value);
                this.lblCelularMostrar.Text      = Convert.ToString(this.tablaFactura.CurrentRow.Cells["TELEFONOMOVILCLIENTE"].Value);

                this.lblFecha.Text           = Convert.ToString(this.tablaFactura.CurrentRow.Cells["FECHAFACTURA"].Value);
                this.lblCajero.Text          = Convert.ToString(this.tablaFactura.CurrentRow.Cells["VENDEDOR"].Value);
                this.lblSubTotalValor.Text   = Convert.ToString(this.tablaFactura.CurrentRow.Cells["SUBTOTAL"].Value);
                this.lblDescuentoValor.Text  = Convert.ToString(this.tablaFactura.CurrentRow.Cells["DESCUENTO"].Value);
                this.lblIVAValor.Text        = Convert.ToString(this.tablaFactura.CurrentRow.Cells["IVA"].Value);
                this.lblTotalValor.Text      = Convert.ToString(this.tablaFactura.CurrentRow.Cells["TOTAL"].Value);
                this.lblTipoPagoMostrar.Text = Convert.ToString(this.tablaFactura.CurrentRow.Cells["ESTADOFACTURA"].Value);
            }

            else
            {
                this.limpiarCampos();
                this.mostrarFactura();
                MessageBox.Show("No existe la factura", "Consultar Factura", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                string respuesta = "";
                if (this.lblClienteMostrar.Text != string.Empty && this.pickerFechaNuevaFactura.Text != string.Empty && this.comboCajero.Text != string.Empty &&
                    this.lblSubTotalValor.Text != string.Empty && this.lblDescuento.Text != string.Empty && this.lblIVAValor.Text != string.Empty &&
                    this.lblTotalValor.Text != string.Empty && this.comboEstadoFactura.Text != string.Empty &&
                    (radioCheque.Checked == true || radioEfectivo.Checked == true) || radioTarjeta.Checked == true)
                {
                    respuesta = NegocioFactura.insertarFactura(Convert.ToInt32(this.lblClienteMostrar.Text), this.pickerFechaNuevaFactura.Text, this.comboCajero.Text,
                                                               this.TipoPago().ToString(), float.Parse(this.lblSubTotalValor.Text), float.Parse(this.lblDescuentoValor.Text),
                                                               float.Parse(this.lblIVAValor.Text), float.Parse(this.lblTotalValor.Text), this.comboEstadoFactura.Text);
                    this.insertarDetalles();
                    this.disminuirStock();

                    this.MensajeOK("Registro ingresado exitosamente");
                    btnImprimir.Visible = true;
                }
                else
                {
                    MensajeError("Falta ingresar algunos datos");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
 private void btnAnular_Click(object sender, EventArgs e)
 {
     try
     {
         string       respuesta = "";
         DialogResult opcion;
         opcion = MessageBox.Show("¿Seguro que desea anular la factura?", "Anular Factura", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (opcion == DialogResult.OK)
         {
             respuesta = NegocioFactura.anularFactura(int.Parse(this.txtNumeroFactura.Text));
             this.txtNumeroFactura.Clear();
             if (respuesta.Equals("OK"))
             {
                 this.MensajeOK("Factura anulada exitosamente");
                 limpiarCampos();
             }
             else
             {
                 this.MensajeError(respuesta);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + ex.StackTrace);
     }
     btnAnular.Visible = false;
 }
 private void consultarDetalleTabla()
 {
     if (this.txtNumeroFactura.Text == string.Empty)
     {
         this.tablaDetalle.DataSource = NegocioFactura.mostrarDetalle(0);
     }
     else
     {
         this.tablaDetalle.DataSource = NegocioFactura.mostrarDetalle(int.Parse(this.txtNumeroFactura.Text));
     }
 }
 private void consultarFacturaTabla()
 {
     if (this.txtNumeroFactura.Text == string.Empty)
     {
         this.tablaFactura.DataSource = NegocioFactura.consultarFacturaTabla(0);
     }
     else
     {
         this.tablaFactura.DataSource = NegocioFactura.consultarFacturaTabla(int.Parse(this.txtNumeroFactura.Text));
     }
 }
Ejemplo n.º 6
0
        private void contarRegistros()
        {
            this.tabla_aux.DataSource = NegocioFactura.numeroFactura();

            if (this.tabla_aux.Rows.Count != 0)
            {
                int var = Convert.ToInt32(this.tabla_aux.Rows[0].Cells[0].Value) + 1;
                this.lblNumeroFacturaVenta.Text = Convert.ToString(var);
            }

            else
            {
                this.limpiarCampos();
            }
        }
 private void mostrarFactura()
 {
     this.tablaFactura.DataSource = NegocioFactura.mostrarFacturas();
 }