Exemplo n.º 1
0
 private void ImprimirBo_Click(object sender, EventArgs e)
 {
     nombre = Utils.ReturName(GetId());
     if (ProductosLV.Items.Count != 0)
     {
         FacturaInsert();
         _detallefacturahelper.AddDetails(UpdateList(FacturaInsert().Idfactura));
         FPrintFactura obj = new FPrintFactura(ProductosLV, _total, _Iva, _neto, nombre);
         obj.ShowDialog();
         ProductosLV.Items.Clear();
     }
     else
     {
         MessageBox.Show("Debe añadir uno o varios productos \n antes de generar factura", "No se añadió ningun producto", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 2
0
        private void ReImprimir()
        {
            var     factura = _detallehelper.GetDetails();
            decimal total   = 0m;
            double  iva     = 0;
            decimal neto    = 0m;
            string  nombre  = string.Empty;

            foreach (var item in factura)
            {
                if (item.Idfactura.Equals(int.Parse(idtxt.Text)))
                {
                    total  = item.IdfacturaNavigation.Totalsiniva;
                    iva    = item.IdfacturaNavigation.Iva;
                    neto   = item.IdfacturaNavigation.Totalmasiva;
                    nombre = item.IdfacturaNavigation.Nombreusuario;
                    break;
                }
            }
            FPrintFactura obj = new FPrintFactura(DetallesLv, total, iva, neto, nombre);

            obj.ShowDialog();
        }