/// <summary>
        /// Evento que genera el reporte de concentrado de las ventas.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <creo>Juan Alberto Hernández Negrete</creo>
        /// <fecha_creo>2014 05 22 09:50 Hrs.</fecha_creo>
        /// <modifico></modifico>
        /// <fecha_modifico></fecha_modifico>
        /// <causa_modificacion></causa_modificacion>
        private void Btn_Exportar_PDF_Click(object sender, EventArgs e)
        {
            Cls_Rpt_Ventas_Negocio Obj_Rpt_Ventas = new Cls_Rpt_Ventas_Negocio(); //Variable que utilizaremos para realizar peticiones a la clase de datos.
            DataSet Ds_Resultados_Busqueda        = null;                         //Variable que utilizaremos para almacenar los resultados de la búsqueda.

            try
            {
                //  realiza la consulta de la informacion
                Ds_Resultados_Busqueda = Consultar_DsReporte();

                Generar_Reporte(ref Ds_Resultados_Busqueda, MDI_Frm_Apl_Principal.Ruta_Plantilla_Crystal + "Cr_Rpt_Folios_Cancelados.rpt");
            }
            catch (Exception Ex)
            {
                MessageBox.Show(this, Ex.Message, "Error - Método: [Btn_Consultar_Click]", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        /// <summary>
        /// Método que realiza la carga de productos registrados por catálogo.
        /// </summary>
        /// <creo>Juan Alberto Hernández Negrete</creo>
        /// <fecha_creo>2014 05 21 13:16 Hrs.</fecha_creo>
        /// <modifico></modifico>
        /// <fecha_modifico></fecha_modifico>
        /// <causa_modificacion></causa_modificacion>
        private void Cargar_Productos()
        {
            Cls_Rpt_Ventas_Negocio Obj_Rpt_Ventas = new Cls_Rpt_Ventas_Negocio(); //Variable de negocios que utilizaremos para realizar peticiones a la clase de datos.
            DataTable Dt_Resultados_Busqueda      = null;                         //Variable donde se almacenaran los resultados de la búsqueda.

            try
            {
                Dt_Resultados_Busqueda              = Obj_Rpt_Ventas.Consultar_Productos(); //Ejecutamos la consulta de productos.
                KCmb_Tarifa_Productos.DataSource    = Dt_Resultados_Busqueda;               //Cargamos el listado de productos.
                KCmb_Tarifa_Productos.ValueMember   = Cat_Productos.Campo_Producto_Id;
                KCmb_Tarifa_Productos.DisplayMember = Cat_Productos.Campo_Nombre;
            }
            catch (Exception Ex)
            {
                MessageBox.Show(this, Ex.Message, "Error - Método: [Cargar_Productos]", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// Método que carga los lugares donde se pueden registrar las ventas.
        /// </summary>
        /// <creo>Juan Alberto Hernández Negrete</creo>
        /// <fecha_creo>2014 05 21 13:33 Hrs.</fecha_creo>
        /// <modifico></modifico>
        /// <fecha_modifico></fecha_modifico>
        /// <causa_modificacion></causa_modificacion>
        private DataSet Consultar_DsReporte()
        {
            Cls_Rpt_Ventas_Negocio Obj_Rpt_Ventas = new Cls_Rpt_Ventas_Negocio();//Variable que utilizaremos para realizar peticiones a la clase de datos.
            DataSet Ds_Reporte         = new DataSet();
            String  Leyenda_Encabezado = "";

            try
            {
                //Establecemos los filtros para realizar la búsqueda.
                if (KDtp_Fecha_Inicio.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Inicio = new DateTime(KDtp_Fecha_Inicio.Value.Year
                                                                 , KDtp_Fecha_Inicio.Value.Month
                                                                 , KDtp_Fecha_Inicio.Value.Day, 0, 0, 0);

                    Leyenda_Encabezado += "Periodo: Del " + Obj_Rpt_Ventas.P_Fecha_Inicio.ToString("dd")
                                          + " de " + Cls_Metodos_Generales.Convertir_Mes_Numerico_A_Equivalente_Texto(Convert.ToInt32(Obj_Rpt_Ventas.P_Fecha_Inicio.ToString("MM")))
                                          + " de " + Obj_Rpt_Ventas.P_Fecha_Inicio.ToString("yyyy");
                }


                if (KDtp_Fecha_Termino.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Termino = new DateTime(KDtp_Fecha_Termino.Value.Year
                                                                  , KDtp_Fecha_Termino.Value.Month
                                                                  , KDtp_Fecha_Termino.Value.Day, 23, 59, 59);

                    Leyenda_Encabezado += " al " + Obj_Rpt_Ventas.P_Fecha_Termino.ToString("dd")
                                          + " de " + Cls_Metodos_Generales.Convertir_Mes_Numerico_A_Equivalente_Texto(Convert.ToInt32(Obj_Rpt_Ventas.P_Fecha_Termino.ToString("MM")))
                                          + " de " + Obj_Rpt_Ventas.P_Fecha_Termino.ToString("yyyy");
                }


                //  producto
                //if (KCmb_Tarifa_Productos.SelectedValue is object)
                //{
                //    if (!string.IsNullOrEmpty(KCmb_Tarifa_Productos.SelectedValue.ToString()))
                //        Obj_Rpt_Ventas.P_Producto_ID = KCmb_Tarifa_Productos.SelectedValue.ToString();
                //}

                //  turno
                if (KCmb_Turnos.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Turnos.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Turno_ID = KCmb_Turnos.SelectedValue.ToString();
                        Leyenda_Encabezado       += ", Turno: " + KCmb_Turnos.Text;
                    }
                }

                //  caja
                if (KCmb_Caja.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Caja.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Caja_ID = KCmb_Caja.SelectedValue.ToString();
                        Leyenda_Encabezado      += ", No. caja: " + KCmb_Caja.Text;
                    }
                }

                //  lugar de la venta
                if (KCmb_Lugar_Venta.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Lugar_Venta.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Tipo_Movimiento = KCmb_Lugar_Venta.Text;

                        Leyenda_Encabezado += ", Lugar de la venta: ";

                        if (KCmb_Lugar_Venta.Text.ToString() == "No Caja")
                        {
                            Leyenda_Encabezado += " Numero de caja";
                        }
                        else
                        {
                            Leyenda_Encabezado += "" + KCmb_Lugar_Venta.Text.ToString();
                        }
                    }
                }

                //  filtro para el numero de venta
                if (!String.IsNullOrEmpty(Txt_No_Venta.Text))
                {
                    Obj_Rpt_Ventas.P_No_Venta = Txt_No_Venta.Text;
                    Leyenda_Encabezado       += ", No. de la venta: " + Txt_No_Venta.Text;
                }

                Obj_Rpt_Ventas.P_Tipo = Leyenda_Encabezado;

                //  generacion de la consulta
                Ds_Reporte = Obj_Rpt_Ventas.Rpt_Folios_Cancelados();
            }
            catch (Exception Ex)
            {
                throw new Exception("Error: (Consultar_DsReporte). Descripción: " + Ex.Message);
            }

            return(Ds_Reporte);
        }
예제 #4
0
        /// <summary>
        /// Nombre: Btn_Consultar_Click
        ///
        /// Descripción: Método que ejecuta la consulta de los tipos de movimientos [Ventas - Recolecciones - Arqueos]
        ///
        /// Usuario Creo: Juan Alberto Hernández Negrete.
        /// Fecha Creo: 27 Noviembre 2013 18:36 Hrs.
        /// Usuario Modifico:
        /// Fecha Modifico:
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_Consultar_Click(object sender, EventArgs e)
        {
            Cls_Rpt_Ventas_Negocio Obj_Rpt_Ventas = new Cls_Rpt_Ventas_Negocio(); //Variable que utilizaremos para realizar peticiones a la clase de datos.
            DataTable Dt_Resultados_Busqueda      = null;                         //Variable que utilizaremos para almacenar los resultados de la búsqueda.
            Boolean   Periodo6Meses = false;

            try
            {
                Grid_Resultados_Busqueda.DataSource = null;

                //Establecemos los filtros para realizar la búsqueda.
                if (Dtp_Fecha_Inicio.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Inicio = new DateTime(Dtp_Fecha_Inicio.Value.Year
                                                                 , Dtp_Fecha_Inicio.Value.Month
                                                                 , Dtp_Fecha_Inicio.Value.Day, 0, 0, 0);
                }
                else
                {
                    MessageBox.Show("Debe Seleccionar una Fecha de Inicio", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (Dtp_Fecha_Termino.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Termino = new DateTime(Dtp_Fecha_Termino.Value.Year
                                                                  , Dtp_Fecha_Termino.Value.Month
                                                                  , Dtp_Fecha_Termino.Value.Day, 23, 59, 59);
                }
                else
                {
                    MessageBox.Show("Debe Seleccionar una Fecha de Término", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (Cmb_Producto.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(Cmb_Producto.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Producto_ID = Cmb_Producto.SelectedValue.ToString();
                    }
                }

                if (Cmb_Cajas.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(Cmb_Cajas.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Caja_ID = Cmb_Cajas.SelectedValue.ToString();
                    }
                }

                if (Cmb_Turnos.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(Cmb_Turnos.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Turno_ID = Cmb_Turnos.SelectedValue.ToString();
                    }
                }

                if (Cmb_Lugar_Venta.Text is object)
                {
                    if (Cmb_Lugar_Venta.Text != "SELECCIONE")
                    {
                        Obj_Rpt_Ventas.P_Lugar_Venta = Cmb_Lugar_Venta.Text;
                    }
                }

                if (!string.IsNullOrEmpty(Txt_Folio_Venta.Text))
                {
                    Obj_Rpt_Ventas.P_Folio_Venta = Txt_Folio_Venta.Text;
                }

                if (Cmb_Museo.SelectedIndex > 0)
                {
                    Obj_Rpt_Ventas.P_Museo = Cmb_Museo.Text == "MUSEO MOMIAS" ? "00001" : "00002";
                }

                Periodo6Meses = CalcularPeriodo6Meses(Obj_Rpt_Ventas.P_Fecha_Inicio, Obj_Rpt_Ventas.P_Fecha_Termino);

                if (Periodo6Meses)
                {
                    Dt_Resultados_Busqueda = Obj_Rpt_Ventas.Rpt_Ventas().Tables["Padre"];

                    if (Dt_Resultados_Busqueda is DataTable)
                    {
                        if (Dt_Resultados_Busqueda.Rows.Count > 0)
                        {
                            Grid_Resultados_Busqueda.DataSource = Dt_Resultados_Busqueda;
                        }
                        else
                        {
                            Grid_Resultados_Busqueda.DataSource = new DataTable();
                        }
                    }
                    else
                    {
                        Grid_Resultados_Busqueda.DataSource = new DataTable();
                    }
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(this, Ex.Message, "Error - Método: [Btn_Consultar_Click]", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        /// <summary>
        /// Evento que genera el reporte de concentrado de las ventas.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <creo>Juan Alberto Hernández Negrete</creo>
        /// <fecha_creo>2014 05 22 09:50 Hrs.</fecha_creo>
        /// <modifico></modifico>
        /// <fecha_modifico></fecha_modifico>
        /// <causa_modificacion></causa_modificacion>
        private void Btn_Exportar_PDF_Click(object sender, EventArgs e)
        {
            Cls_Rpt_Ventas_Negocio Obj_Rpt_Ventas = new Cls_Rpt_Ventas_Negocio(); //Variable que utilizaremos para realizar peticiones a la clase de datos.
            DataSet Ds_Resultados_Busqueda        = null;                         //Variable que utilizaremos para almacenar los resultados de la búsqueda.

            try
            {
                //Establecemos los filtros para realizar la búsqueda.
                if (KDtp_Fecha_Inicio.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Inicio = new DateTime(KDtp_Fecha_Inicio.Value.Year
                                                                 , KDtp_Fecha_Inicio.Value.Month
                                                                 , KDtp_Fecha_Inicio.Value.Day, 0, 0, 0);
                }

                if (KDtp_Fecha_Termino.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Termino = new DateTime(KDtp_Fecha_Termino.Value.Year
                                                                  , KDtp_Fecha_Termino.Value.Month
                                                                  , KDtp_Fecha_Termino.Value.Day, 23, 59, 59);
                }

                if (KCmb_Tarifa_Productos.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Tarifa_Productos.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Producto_ID = KCmb_Tarifa_Productos.SelectedValue.ToString();
                    }
                }

                if (KCmb_Caja.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Caja.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Caja_ID = KCmb_Caja.SelectedValue.ToString();
                    }
                }

                if (KCmb_Turnos.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Turnos.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Turno_ID = KCmb_Turnos.SelectedValue.ToString();
                    }
                }

                if (KCmb_Lugar_Venta.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Lugar_Venta.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Tipo_Movimiento = KCmb_Lugar_Venta.Text;
                    }
                }

                if (KCmb_Lugar_Venta.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Lugar_Venta.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Lugar_Venta = KCmb_Lugar_Venta.SelectedValue.ToString();
                    }
                }

                if (KCmb_Estatus.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Estatus.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Estatus = KCmb_Estatus.SelectedValue.ToString();
                    }
                }

                if (!String.IsNullOrEmpty(Txt_Folio_Acceso.Text))
                {
                    Obj_Rpt_Ventas.P_Folio_Acceso = String.Format("{0:0000000000}", Convert.ToDouble(Txt_Folio_Acceso.Text));
                }

                Ds_Resultados_Busqueda = Obj_Rpt_Ventas.Rpt_Ventas_Internet();
                Generar_Reporte(ref Ds_Resultados_Busqueda, MDI_Frm_Apl_Principal.Ruta_Plantilla_Crystal + "Cr_Rpt_Ventas_Internet.rpt");
            }
            catch (Exception Ex)
            {
                MessageBox.Show(this, Ex.Message, "Error - Método: [Btn_Consultar_Click]", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #6
0
        /// <summary>
        /// Evento que realiza la búsqueda de las ventas.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <creo>Juan Alberto Hernández Negrete</creo>
        /// <fecha_creo>2014 05 22 09:50 Hrs.</fecha_creo>
        /// <modifico></modifico>
        /// <fecha_modifico></fecha_modifico>
        /// <causa_modificacion></causa_modificacion>
        private void Btn_Consultar_Click(object sender, EventArgs e)
        {
            Cls_Rpt_Ventas_Negocio Obj_Rpt_Ventas = new Cls_Rpt_Ventas_Negocio(); //Variable que utilizaremos para realizar peticiones a la clase de datos.
            DataSet Ds_Resultados_Busqueda        = null;                         //Variable que utilizaremos para almacenar los resultados de la búsqueda.
            Boolean Periodo6Meses = false;


            try
            {
                Grid_Resultado.DataSource = null;

                //Establecemos los filtros para realizar la búsqueda.
                if (KDtp_Fecha_Inicio.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Inicio = new DateTime(KDtp_Fecha_Inicio.Value.Year
                                                                 , KDtp_Fecha_Inicio.Value.Month
                                                                 , KDtp_Fecha_Inicio.Value.Day, 0, 0, 0);
                }

                if (KDtp_Fecha_Termino.Checked)
                {
                    Obj_Rpt_Ventas.P_Fecha_Termino = new DateTime(KDtp_Fecha_Termino.Value.Year
                                                                  , KDtp_Fecha_Termino.Value.Month
                                                                  , KDtp_Fecha_Termino.Value.Day, 23, 59, 59);
                }

                if (KCmb_Tarifa_Productos.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Tarifa_Productos.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Producto_ID = KCmb_Tarifa_Productos.SelectedValue.ToString();
                    }
                }

                if (KCmb_Caja.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Caja.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Caja_ID = KCmb_Caja.SelectedValue.ToString();
                    }
                }

                if (KCmb_Turnos.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Turnos.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Turno_ID = KCmb_Turnos.SelectedValue.ToString();
                    }
                }

                if (KCmb_Lugar_Venta.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Lugar_Venta.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Tipo_Movimiento = KCmb_Lugar_Venta.Text;
                    }
                }

                if (KCmb_Lugar_Venta.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Lugar_Venta.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Lugar_Venta = KCmb_Lugar_Venta.SelectedValue.ToString();
                    }
                }

                if (KCmb_Estatus.SelectedValue is object)
                {
                    if (!string.IsNullOrEmpty(KCmb_Estatus.SelectedValue.ToString()))
                    {
                        Obj_Rpt_Ventas.P_Estatus = KCmb_Estatus.SelectedValue.ToString();
                    }
                }

                if (!String.IsNullOrEmpty(Txt_Folio_Acceso.Text))
                {
                    Obj_Rpt_Ventas.P_Folio_Acceso = Txt_Folio_Acceso.Text;
                }

                Periodo6Meses = CalcularPeriodo6Meses(Obj_Rpt_Ventas.P_Fecha_Inicio, Obj_Rpt_Ventas.P_Fecha_Termino);

                if (Periodo6Meses)
                {
                    Ds_Resultados_Busqueda = Obj_Rpt_Ventas.Rpt_Ventas_Internet();

                    if (Ds_Resultados_Busqueda.Tables["Detalle_Ventas"] is DataTable)
                    {
                        if (Ds_Resultados_Busqueda.Tables["Detalle_Ventas"].Rows.Count > 0)
                        {
                            Grid_Resultado.DataSource = Ds_Resultados_Busqueda.Tables["Detalle_Ventas"];
                        }
                        else
                        {
                            Grid_Resultado.DataSource = new DataTable();
                        }
                    }
                    else
                    {
                        Grid_Resultado.DataSource = new DataTable();
                    }
                }

                //Formato_Tabla(Grid_Resultado);//Modificamos el formato de la tabla de resultados de la búsqueda.
            }
            catch (Exception Ex)
            {
                MessageBox.Show(this, Ex.Message, "Error - Método: [Btn_Consultar_Click]", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }