Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            ControladorEmpleado         CEmpleado = new ControladorEmpleado();
            List <ModelEmpleadoPersona> lista     = null;

            if (cbxDirectivo.Checked && cbxSecretaria.Checked && cbxProfesor.Checked && cbxMantenimiento.Checked)
            {
                lista = CEmpleado.TraerEmpleadoReporte();
            }
            else
            {
                lista = CEmpleado.TraerEmpleadoReporte()
                        .AsEnumerable()
                        .Where(b => (cbxDirectivo.Checked? true: b.TipoEmpleado != EnumTipoEmpleado.Directivo))
                        .Where(b => (cbxMantenimiento.Checked ? true : b.TipoEmpleado != EnumTipoEmpleado.Mantenimiento))
                        .Where(b => (cbxProfesor.Checked ? true : b.TipoEmpleado != EnumTipoEmpleado.Profesor))
                        .Where(b => (cbxSecretaria.Checked ? true : b.TipoEmpleado != EnumTipoEmpleado.Secretaria))

                        .ToList()
                ;
            }

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

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