private void btn_aplicar_filtro_Click(object sender, EventArgs e)
        {
            try
            {
                InformeOrdenCompraBindingSource.DataSource = InformesDAO.GetInformeOrdenesCompra(dtp_fecha_desde.Value.Date, dtp_fecha_hasta.Value.Date);

                string filtro = "";
                if (rbt_todos.Checked == true)
                {
                    filtro += "1=1";
                }
                if (rbt_conDiferencias.Checked == true)
                {
                    filtro += "cantidad <> cantidadRealIngresada";
                }

                if (rbt_sinDif.Checked == true)
                {
                    filtro += "cantidad = cantidadRealIngresada";
                }
                if (txt_proveedor.Text != String.Empty)
                {
                    filtro += " and razonSocial like '" + txt_proveedor.Text + "%'";
                }

                InformeOrdenCompraBindingSource.Filter = filtro;
                this.reportViewer1.LocalReport.SetParameters(new ReportParameter("desde", dtp_fecha_desde.Value.Date.ToString()));
                this.reportViewer1.LocalReport.SetParameters(new ReportParameter("hasta", dtp_fecha_hasta.Value.Date.ToString()));
                this.reportViewer1.RefreshReport();
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            }
        }
 private void EmitirInformeDesviacionesOrdenTrabajo_Load(object sender, EventArgs e)
 {
     try
     {
         OrdenDeTrabajoBindingSource.DataSource = InformesDAO.GetInformeDesviacionOrdenesTrabajo(dtp_fecha_desde.Value.Year);
         this.reportViewer1.RefreshReport();
     }
     catch (ApplicationException ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
     }
 }
 private void EmitirInformeOrdenCompra_Load(object sender, EventArgs e)
 {
     try
     {
         InformeOrdenCompraBindingSource.DataSource = InformesDAO.GetInformeOrdenesCompra(null, null);
         this.reportViewer1.LocalReport.SetParameters(new ReportParameter("desde", "01/01/1900"));
         this.reportViewer1.LocalReport.SetParameters(new ReportParameter("hasta", "01/01/1900"));
         this.reportViewer1.RefreshReport();
     }
     catch (ApplicationException ex)
     {
         MessageBox.Show(ex.Message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
     }
 }
        private void btn_aplicar_filtro_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable tabla = InformesDAO.GetInformeDesviacionOrdenesTrabajo(dtp_fecha_desde.Value.Year);

                if (tabla.Rows.Count > 0)
                {
                    OrdenDeTrabajoBindingSource.DataSource = tabla;
                    this.reportViewer1.RefreshReport();
                }
                else
                {
                    MessageBox.Show("No hay datos disponibles", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                }
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
        private void Emitir_Informe_Productos_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable tabla = InformesDAO.GetInformeProductos();

                if (tabla.Rows.Count > 0)
                {
                    ProductoBindingSource.DataSource = tabla;
                    this.reportViewer1.RefreshReport();
                }
                else
                {
                    MessageBox.Show("No hay datos disponibles", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                }
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #6
0
        private void btn_aplicar_filtro_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable tabla = InformesDAO.GetInformeVentasProducto(dtp_fecha_desde.Value.Date, dtp_fecha_hasta.Value.Date);

                if (tabla.Rows.Count > 0)
                {
                    ProductosBindingSource.DataSource = tabla;

                    this.reportViewer1.LocalReport.SetParameters(new ReportParameter("desde", dtp_fecha_desde.Value.Date.ToShortDateString().ToString()));
                    this.reportViewer1.LocalReport.SetParameters(new ReportParameter("hasta", dtp_fecha_hasta.Value.Date.ToShortDateString().ToString()));
                    this.reportViewer1.RefreshReport();
                }
                else
                {
                    MessageBox.Show("No hay datos disponibles", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                }
            }
            catch (ApplicationException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }