Exemplo n.º 1
0
        public void ImprimirLista(object unOrigenDatos)
        {
            try
            {
                string          reporte      = null;
                List <contable> listaObjetos = ((IEnumerable <contable>)unOrigenDatos).ToList();
                Proveedores.Colecciones.DetalleContableCl coleccion = new Proveedores.Colecciones.DetalleContableCl();
                coleccion.AddRangeLista(listaObjetos);
                Impresiones dialogo = new Impresiones();
                dialogo.ShowDialog();
                if (dialogo.DialogResult != DialogResult.Cancel)
                {
                    if (dialogo.DialogResult == DialogResult.Yes)
                    {
                        reporte = "ListaContablesRp";
                    }
                    else
                    {
                        reporte = "ContablesRp";
                    }

                    Reportes visorReporte = new Reportes()
                    {
                        Reporte = reporte, FuenteDatos = "DetalleContableCl", Lista = coleccion.ObtenerItems()
                    };
                    visorReporte.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                General.Mensaje(ex.Message);
            }
        }
Exemplo n.º 2
0
 public void ImprimirObjeto(object unContable)
 {
     try
     {
         contable objeto = (contable)unContable;
         Proveedores.Colecciones.DetalleContableCl coleccion = new Proveedores.Colecciones.DetalleContableCl();
         coleccion.AddRange(objeto.fkdetallescontables.ToList());
         Reportes reporte = new Reportes()
         {
             Reporte = "ContablesRp", FuenteDatos = "DetalleContableCl", Lista = coleccion.ObtenerItems()
         };
         reporte.ShowDialog();
     }
     catch (Exception ex)
     {
         General.Mensaje(ex.Message);
     }
 }