Esempio n. 1
0
 private void dataProd_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (this.accion.Equals(6))
     {
         try
         {
             DialogResult dialogo = MessageBox.Show("Decea Quitar el producto de la Factura", "ELIMINAR", MessageBoxButtons.YesNo, MessageBoxIcon.Stop);
             if (dialogo == DialogResult.Yes)
             {
                 int i = dataProd.CurrentRow.Index;
                 this.Hide();
                 form.Confirmar actu = new form.Confirmar();
                 actu.Id     = this.id;
                 actu.Nombre = this.nombre;
                 actu.Rol    = this.rol;
                 /*producto*/
                 actu.Accion    = this.accion;
                 actu.ProducId  = Convert.ToInt32(dataProd.Rows[i].Cells[0].Value.ToString());
                 actu.SubTotal  = Convert.ToDouble(txtSub.Text);
                 actu.TotalProd = Convert.ToDouble(dataProd.Rows[i].Cells[6].Value.ToString());
                 actu.IdFact1   = this.idFact;
                 actu.Show();
             }
             else
             {
                 return;
             }
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex);
         }
     }
 }
Esempio n. 2
0
        private void dataventas_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int i;

            i = dataventas.CurrentRow.Index;

            try {
                DialogResult dialogo = MessageBox.Show("Decea Quitar el producto de la Factura", "ELIMINAR", MessageBoxButtons.YesNo, MessageBoxIcon.Stop);
                if (dialogo == DialogResult.Yes)
                {
                    Codigo.RemoveAt(i);
                    nombreProducto.RemoveAt(i);
                    precioVenta.RemoveAt(i);
                    descuento.RemoveAt(i);
                    cantidad.RemoveAt(i);

                    Double tt = totalproducto[i];
                    Console.WriteLine("total eliminado" + tt);

                    totalproducto.RemoveAt(i);
                    subTotal = subTotal - tt;
                    Console.WriteLine("total eliminado" + subTotal);

                    Iva   = subTotal * (13 / 100);
                    Total = subTotal + Iva;
                    idproducto.RemoveAt(i);

                    this.Hide();
                    form.Confirmar act = new form.Confirmar();
                    act.Id            = this.id;
                    act.Rol           = this.Rol;
                    act.Nombre        = this.nombre;
                    act.IdCliente     = this.idCliente;
                    act.NombreCliente = this.nombreCliente;
                    act.Documento     = this.documento;
                    act.Direccion1    = this.Direccion;
                    act.Telefono1     = this.Telefono;
                    act.Tipo          = this.tipo;
                    /*el detalle*/
                    act.NumeroFact = this.numeroFact;
                    /*---*/
                    act.SubTotal = this.subTotal;
                    act.Iva1     = this.Iva;
                    act.Total1   = this.Total;
                    /*----------------*/
                    act.Idproducto     = this.idproducto;
                    act.Codigo1        = this.Codigo;
                    act.NombreProducto = this.nombreProducto;
                    act.Cantidad       = this.cantidad;
                    act.Descuento      = this.descuento;
                    act.Totalproducto  = this.totalproducto;
                    act.PrecioVenta    = this.precioVenta;
                    act.Show();
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex) {
                Console.WriteLine(ex);
            }
        }