Пример #1
0
 public void generateinvoice()
 {
     try
     {
         //    Int32 AB = 0;
         //    foreach (ListViewItem I in LvPagos.Items)
         //    {
         //        AB += int.Parse(I.SubItems[3].Text);
         //        String resultado = AB.ToString();
         //    }
         //    int rest = Convert.ToInt32(txtcantidad.Text) * AB;
         DatosReporte datos = new DatosReporte();
         datos.nombreCompleto = cmbCliente.Text;
         datos.NombreArticulo = txtArticulo.Text;
         datos.telefono       = lvtel.Text;
         datos.direccion      = lvDireccion.Text;
         datos.comentario     = lvcomment.Text;
         //datos.total = AB;
         //datos.Precio = AB;
         datos.Precio         = Convert.ToDouble(txtPrecio.Text);
         datos.subtotal       = Convert.ToDouble(txtPrecio.Text) * Convert.ToDouble(txtcantidad.Text);
         datos.iva            = Convert.ToDouble(txtPrecio.Text) * Convert.ToDouble(txtiva.Text) / 100;
         datos.totalArticulos = Convert.ToInt32(txtcantidad.Text);
         datos.total          = datos.iva + datos.subtotal;
         datos.fechaPago      = dtpFechaPago.Text;
         FormReporte fr = new FormReporte();
         //fr.datosReportes.Add(datos);
         fr.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "MTtech", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 public List <DatosReporte> CargarSeleccionados()
 {
     foreach (var item in LvPagos.SelectedItems.Cast <ListViewItem>())
     {
         DatosReporte informeAgenda = new DatosReporte();
         informeAgenda.idCliente      = int.Parse(item.SubItems[0].Text.ToString());
         informeAgenda.nombreCompleto = item.SubItems[1].Text.ToString();
         //informeAgenda.telefono = item.SubItems[2].Text.ToString();
         //informeAgenda.direccion = item.SubItems[3].Text.ToString();
         informeAgenda.comentario = item.SubItems[2].Text.ToString();
         //informeAgenda.NombreArticulo = item.SubItems[3].Text.ToString();
         //informeAgenda.iva = double.Parse(item.SubItems[6].Text.ToString());
         //informeAgenda.Precio = double.Parse(item.SubItems[4].Text.ToString());
         informeAgenda.fechaPago = item.SubItems[3].Text.ToString();
         //informeAgenda.total = double.Parse(item.SubItems[9].Text.ToString());
         //informeAgenda.subtotal = double.Parse(item.SubItems[10].Text.ToString());
         //informeAgenda.totalArticulos = int.Parse(item.SubItems[11].Text.ToString());
         lista.Add(informeAgenda);
     }
     return(lista);
 }