Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ControladorSocio         CSocio = new ControladorSocio();
            List <ModelSocioPersona> lista  = null;

            if (cbxActivo.Checked && cbxMenor.Checked && cbxVitalicio.Checked)
            {
                lista = CSocio.TraerSocioReporte();
            }
            else
            {
                lista = CSocio.TraerSocioReporte()
                        .AsEnumerable()
                        .Where(b => (cbxActivo.Checked? true: b.CategoriaSocio != EnumCategoriaSocio.Activo))
                        .Where(b => (cbxMenor.Checked ? true : b.CategoriaSocio != EnumCategoriaSocio.Menor))
                        .Where(b => (cbxVitalicio.Checked ? true : b.CategoriaSocio != EnumCategoriaSocio.Vitalicio))

                        .ToList()
                ;
            }

            ReportDataSource dt  = new ReportDataSource("DataSet1", lista);
            string           dir = "ProjectGimnasiaYEsgrima.Utils.ReporteSocio.rdlc";

            new InterfazGenerarReporte(dt, dir).ShowDialog();
        }