private void button1_Click(object sender, EventArgs e)
        {
            if (TxtProducto.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar la cantidad del Producto");
                TxtProducto.Focus();
                return;
            }
            if (TxtPrecio.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingresar el Precio del Producto");
                TxtPrecio.Focus();
                return;
            }



            double prod, prec, impto, tot, totisv;


            prod = Convert.ToDouble(TxtProducto.Text);
            prec = Convert.ToDouble(TxtPrecio.Text);


            tot    = prod * prec;
            impto  = tot * 0.15;
            totisv = tot + impto;

            TxtTotal.Text    = tot.ToString();
            TxtImpto.Text    = impto.ToString();
            TxtTotalISV.Text = totisv.ToString();
        }
        private void BtnQuitar_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvDetalleF.Rows.Count > 0)
                {
                    if (MessageBox.Show("¿Desea quitar este registro de la lista? ", "Quitar Concepto de lista", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        dgvDetalleF.Rows.RemoveAt(dgvDetalleF.CurrentRow.Index);
                        double can = 0.00;
                        double it  = 0.00;
                        foreach (DataGridViewRow row in dgvDetalleF.Rows)
                        {
                            can += Convert.ToDouble(row.Cells["Precio_Producto"].Value);
                            it  += Convert.ToDouble(row.Cells["Generales"].Value);
                        }
                        double t = can + it;
                        LblTotaApagar.Text = t.ToString();
                        TxtCantidad.Clear();
                        TxtProducto.Clear();
                    }
                }
                else
                {
                    MessageBox.Show("Debe seleccionar un registro de la lista", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

            catch (Exception)
            {
                throw;
            }
        }
        private void BnGuardar_Click(object sender, EventArgs e)
        {
            if (TxtProducto.Text == "" || TxtProducto.Text == null)
            {
                MessageBox.Show("Debe ingresar los nombres y apellidos", "ALTO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                TxtProducto.Focus();
                return;
            }



            DialogResult rta = MessageBox.Show("¿Esta seguro de  ingresar el registro?",
                                               "CONFIRMAR", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (rta == DialogResult.No)
            {
                return;
            }

            CADProducto Guardar = new CADProducto();

            Guardar.InsertProducto(TxtProducto.Text.ToUpper());
            LlenarProducto = new ClassDgvLlenarProduto();
            LlenarProducto.TraerProducto(DgvDatos);

            MessageBox.Show("Registro guardado correctamente.",
                            "CONFIRMAR", MessageBoxButtons.OK, MessageBoxIcon.Information);

            TxtProducto.Text = null;
        }
Exemple #4
0
 public void LimpiarTextBox()
 {
     TxtIdProductp.Clear();
     TxtProducto.Clear();
     TxtPrecio.Clear();
     TxtEstadoProdutc.Clear();
 }
 private void button2_Click(object sender, EventArgs e)
 {
     TxtImpto.Clear();
     TxtPrecio.Clear();
     TxtProducto.Clear();
     TxtTotal.Clear();
     TxtTotalISV.Clear();
 }
Exemple #6
0
        private void BtnLimpiar_Click(object sender, EventArgs e)
        {
            foreach (TextBox txt in this.Controls.OfType <TextBox>())
            {
                txt.Clear();

                TxtProducto.Focus();
            }
        }
Exemple #7
0
 private void BtnLimpiar_Click(object sender, EventArgs e)
 {
     TxtCantidad.Clear();
     TxtDescto.Clear();
     TxtPagar.Clear();
     TxtPreciou.Clear();
     TxtProducto.Clear();
     TxtSubtotal.Clear();
 }
Exemple #8
0
 public void Limpiar()
 {
     Txcompra.Clear();
     Txdia.Clear();
     Txmes.Clear();
     Txanio.Clear();
     Txcantipro.Clear();
     TxtProducto.Clear();
     Txproveedor.Clear();
 }
Exemple #9
0
 private void ResetPartida()
 {
     producto          = null;
     lote              = null;
     TxtProducto.Text  = "";
     TxtLote.Text      = "";
     TxtCaducidad.Text = "";
     TxtDescrip.Text   = "";
     NCantidad.Value   = 1;
     TxtProducto.Focus();
 }
 private void ResetPartida()
 {
     producto         = null;
     lote             = null;
     TxtProducto.Text = "";
     TxtLote.Text     = "";
     TxtDescrip.Text  = "";
     NCantidad.Value  = 1;
     TxtFechaDoc.Text = DateTime.Now.ToString("dd-MM-yyyy");
     TxtProducto.Focus();
 }
Exemple #11
0
 private void Malla_CellEndEdit(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
     }
     catch (Exception ex)
     {
         Ambiente.Mensaje(ex.Message);
     }
     ActualizaCantidad(int.Parse(Malla.CurrentCell.Value.ToString()), e.RowIndex);
     CalculaTotales();
     TxtProducto.Focus();
 }
        private void BtnIngresar_Click(object sender, EventArgs e)
        {
            if (TxtProducto.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese la Descripción del Producto.");
                TxtProducto.Focus();
                return;
            }

            if (TxtCantidadP.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese La Cantidad de Productos.");
                TxtCantidadP.Focus();
                return;
            }

            if (TxtPrecioU.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese el Precio Unitario.");
                TxtPrecioU.Focus();
                return;
            }

            LsbDescripcion.Items.Add(TxtProducto.Text.Trim());
            LsbCant.Items.Add(TxtCantidadP.Text.Trim());
            LsbPrec.Items.Add(TxtPrecioU.Text.Trim());


            double cant, prec, mont, sumt;

            sumt = 0;

            cant = Convert.ToDouble(TxtCantidadP.Text);
            prec = Convert.ToDouble(TxtPrecioU.Text);

            mont = cant * prec;

            LsbMonto.Text = mont.ToString();
            LsbMonto.Items.Add(mont);

            TxtProducto.Clear();
            TxtCantidadP.Clear();
            TxtPrecioU.Clear();
            TxtProducto.Focus();

            contador++;
            LblDescripcion.Text = "Ingresar La Descripción del Producto # " + contador.ToString() + ": ";

            sumt         += mont;
            TxtPagar.Text = sumt.ToString();
        }
        private void BtnAgregar_Click(object sender, EventArgs e)
        {
            if (TxtCodigo.Text.Trim().Length == 0)
            {
                POO.MsgWarning("El Campo Codigo Es Requerido.");
                TxtCodigo.Focus();
                return;
            }
            if (TxtProducto.Text.Trim().Length == 0)
            {
                POO.MsgWarning("El Campo Decripción Es Requerido.");
                TxtProducto.Focus();
                return;
            }
            if (TxtCantidad.Text.Trim().Length == 0)
            {
                POO.MsgWarning("El Campo Cantidad Es Requerido.");
                TxtCantidad.Focus();
                return;
            }
            if (TxtPrecioU.Text.Trim().Length == 0)
            {
                POO.MsgWarning("El Campo Precio Unitario Es Requerido.");
                TxtPrecioU.Focus();
                return;
            }

            DataGridViewRow fila = new DataGridViewRow();

            fila.CreateCells(DgvFactura);
            fila.Cells[0].Value = TxtCodigo.Text.Trim();
            fila.Cells[1].Value = TxtProducto.Text.Trim();
            fila.Cells[2].Value = TxtCantidad.Text.Trim();
            fila.Cells[3].Value = TxtPrecioU.Text.Trim();

            double prec, cant;

            prec = Convert.ToDouble(TxtPrecioU.Text.Trim());
            cant = Convert.ToDouble(TxtCantidad.Text.Trim());

            fila.Cells[4].Value = POO.precU(prec, cant).ToString();

            DgvFactura.Rows.Add(fila);

            TxtCodigo.Clear();
            TxtProducto.Clear();
            TxtCantidad.Clear();
            TxtPrecioU.Clear();
            TxtCodigo.Focus();
        }
 private void BtnGuardarVenta_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(CbxTipoComprobante.Text))
     {
         MessageBox.Show("Seleccione Tipo de Comprobante", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         CbxTipoComprobante.Focus();
     }
     else if (string.IsNullOrEmpty(TxtSerie.Text))
     {
         MessageBox.Show("Digite Serie del Documento", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtSerie.Focus();
     }
     else if (string.IsNullOrEmpty(TxtNumero.Text))
     {
         MessageBox.Show("Digite Número del Documento", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtNumero.Focus();
     }
     else if (string.IsNullOrEmpty(TxtFechaEmision.Text))
     {
         MessageBox.Show("Ingrese Fecha", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtFechaEmision.Focus();
     }
     else if (string.IsNullOrEmpty(TxtNumeroDocumento.Text))
     {
         MessageBox.Show("Ingrese un Cliente", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtNumeroDocumento.Focus();
     }
     else if (string.IsNullOrEmpty(TxtNombres.Text))
     {
         MessageBox.Show("Cliente Incorrecto", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtNombres.Focus();
     }
     else if (MLVDetalle.Items.Count == 0)
     {
         MessageBox.Show("El detalle no puede estar vacío, agrege items", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtProducto.Focus();
     }
     else
     {
         GuardarVenta();
     }
 }
        private void Malla_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (Malla.CurrentCell.Value == null)
            {
                return;
            }


            if (Malla.CurrentCell.ColumnIndex == 2)
            {
                //Cantidad
                try
                {
                    ActualizaCantidad(int.Parse(Malla.CurrentCell.Value.ToString()), e.RowIndex);
                    ReCargaGrid();
                    TxtProducto.Focus();
                }
                catch (Exception ex)
                {
                    Ambiente.Mensaje(ex.Message);
                }
            }
        }