private void vpListadoAnimales_Load(object sender, EventArgs e)
        {
            try
            {
                Animal_Negocio     animal_Negocio = new Animal_Negocio();
                rptListadoAnimales reporte        = new rptListadoAnimales();

                reporte.SetDataSource(animal_Negocio.RecuperarDTPorTambo(idtambo));
                crvAnimales.ReportSource = reporte;
                crvAnimales.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ocurrió un error", MessageBoxButtons.OK);
            }
        }
        private void vpListadoSanidad_Load(object sender, EventArgs e)
        {
            try
            {
                Animal_Negocio    animal_Negocio = new Animal_Negocio();
                rptListadoSanidad reporte        = new rptListadoSanidad();

                reporte.SetDataSource(animal_Negocio.RecuperarDTPorTambo(Principal.Tambo.Id_tambo));
                reporte.SetDatabaseLogon("abcd", "123456");
                crv.ReportSource = reporte;
                crv.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ocurrió un error", MessageBoxButtons.OK);
            }
        }
Beispiel #3
0
        private void vpEventos_Load(object sender, EventArgs e)
        {
            try
            {
                Animal_Negocio animalNegocio = new Animal_Negocio();
                rptEventos     reporte       = new rptEventos();

                if (this.opcioncombo == "Vacas en celo")
                {
                    reporte.SetDataSource(animalNegocio.RecuperarDTVacasEnCeloPorTambo(idtambo));
                    crvEventos.ReportSource = reporte;
                    crvEventos.Refresh();
                }
                else if (this.opcioncombo == "Animales enfermos")
                {
                    reporte.SetDataSource(animalNegocio.RecuperarDTAnimalesEnfermosPorTambo(idtambo));
                    crvEventos.ReportSource = reporte;
                    crvEventos.Refresh();
                }
                else if (this.opcioncombo == "Vacas con parto en los últimos 21 días")
                {
                    reporte.SetDataSource(animalNegocio.RecuperarDTVacasConPartoPorTambo(idtambo));
                    crvEventos.ReportSource = reporte;
                    crvEventos.Refresh();
                }
                else if (this.opcioncombo == "Vacas servidas en los últimos 21 días")
                {
                    reporte.SetDataSource(animalNegocio.RecuperarDTVacasServidasPorTambo(idtambo));
                    crvEventos.ReportSource = reporte;
                    crvEventos.Refresh();
                }
                else if (this.opcioncombo == "vacio")
                {
                    reporte.SetDataSource(animalNegocio.RecuperarDTPorTambo(idtambo));
                    crvEventos.ReportSource = reporte;
                    crvEventos.Refresh();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ocurrió un error", MessageBoxButtons.OK);
            }
        }