private void SELECTORCLIENTE_Load(object sender, EventArgs e)
 {
     Datos.EstablecerConexion();
     dgv_clientes.DataSource = Datos.EjecutarOrdenSelect("select * from cliente;");
     ruc        = "";
     nomcliente = "";
 }
        private void FCONTENEDOREPORTEMES_Load(object sender, EventArgs e)
        {
            // TODO: esta línea de código carga datos en la tabla 'Conjunto1.DataTable3' Puede moverla o quitarla según sea necesario.
            Datos.EstablecerConexion();
            string total = Datos.EjecutarOrdenSelect("select sum(total) from caja where month(fecha) = " + mes + " and year(fecha)=year(current_date()) and Estado='CERRADO';").Rows[0][0].ToString();

            if (total.ToString().Equals(""))
            {
                MessageBox.Show("SIN VENTAS");
                return;
            }
            // TODO: esta línea de código carga datos en la tabla 'Conjunto1.DataTable1' Puede moverla o quitarla según sea necesario.
            this.DataTable3TableAdapter.Fill(this.Conjunto1.DataTable3);
            try
            {
                ReportParameter p  = new ReportParameter("Mes", mes);
                ReportParameter p2 = new ReportParameter("Anyo", anyo);
                ReportParameter p3 = new ReportParameter("Titulo", "Reporte del Mes de " + mesletra);
                ReportParameter p4 = new ReportParameter("Total", total);


                this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { p, p2, p3, p4 });
            }
            catch (LocalProcessingException re)
            {
                MessageBox.Show(re.Message.ToString());
            }


            this.reportViewer1.RefreshReport();
        }
Пример #3
0
        private void FSELECTORPRODUCTO_Load(object sender, EventArgs e)
        {
            Datos.EstablecerConexion();
            DataTable t1 = Datos.EjecutarOrdenSelect("select dp.codigo_barras,p.nombre,p.caracteristica,p.presentacion,p.precio,dp.stock_individual,m.nombre,c.nombre as categoria from detalle_producto as dp, productos as p, marca as m, categoria as c where dp.id_producto = p.id_producto and p.marca=m.codigo and p.categoria = c.codigo and dp.stock_individual > 0;");

            Datos.CerrarConexion();
            t2 = Datos.EjecutarOrdenSelect("select dp.codigo_barras from detalle_producto as dp, productos as p, bodega as b where dp.id_producto=p.id_producto and p.id_producto = b.producto;");
            for (int i = 0; i < t1.Rows.Count; i++)
            {
                dgv_productos.Rows.Add(t1.Rows[i][0].ToString(), t1.Rows[i][1].ToString(), t1.Rows[i][2].ToString(), t1.Rows[i][3].ToString(), t1.Rows[i][4].ToString(), t1.Rows[i][5].ToString(), t1.Rows[i][6].ToString(), t1.Rows[i][7].ToString());
            }
            //  dataGridView1.DataSource = Datos.EjecutarOrdenSelect("select p.codigo,ubicacion,p.nombre,caracteristica,precio,stock,m.nombre as marca,presentacion from productos as p , marca as m where p.marca = m.codigo;");
        }
Пример #4
0
        private void FCONTENEDORDETALLE_Load(object sender, EventArgs e)
        {
            Datos.EstablecerConexion();
            string dtotal = Datos.EjecutarOrdenSelect("select sum(total) from (select p.nombre,p.caracteristica,CAST(f.fecha_hora as DATE) as fecha,precio,cantidad,d.total from detalle_factura as d , productos as p,factura as f where d.producto=p.id_producto and f.codigo=d.codigo_factura) as tab where CAST(tab.fecha as DATE)=CAST('" + fecha_f + "' as DATE);").Rows[0][0].ToString();

            // MessageBox.Show(dtotal);

            // TODO: esta línea de código carga datos en la tabla 'Conjunto1.DataTable5' Puede moverla o quitarla según sea necesario.
            this.DataTable5TableAdapter.Fill(this.Conjunto1.DataTable5);
            try
            {
                ReportParameter p  = new ReportParameter("ReportFecha", this.fecha_f);
                ReportParameter p2 = new ReportParameter("ParTotal", dtotal);
                this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { p, p2 });
            }
            catch (LocalProcessingException re)
            {
                MessageBox.Show(re.Message.ToString());
            }

            this.reportViewer1.RefreshReport();
        }
Пример #5
0
        private void CONTENEDORREPORTEHOY_Load(object sender, EventArgs e)
        {
            Datos.EstablecerConexion();
            string total = Datos.EjecutarOrdenSelect("SELECT sum(total) FROM `factura` WHERE CAST(fecha_hora as date) = CAST('" + fechat + "' as DATE)").Rows[0][0].ToString();

            // TODO: esta línea de código carga datos en la tabla 'Conjunto1.DataTable1' Puede moverla o quitarla según sea necesario.
            this.DataTable1TableAdapter.Fill(this.Conjunto1.DataTable1);
            try
            {
                ReportParameter p  = new ReportParameter("ParFecha", fechan + " 0:00:00");
                ReportParameter p2 = new ReportParameter("ParFecha2", fechan + " 23:59:59");
                ReportParameter p3 = new ReportParameter("ParTotal", total);

                this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { p, p2, p3 });
            }
            catch (LocalProcessingException re)
            {
                MessageBox.Show(re.Message.ToString());
            }


            this.reportViewer1.RefreshReport();
        }
Пример #6
0
 public form_ventas()
 {
     InitializeComponent();
     tb_codigo_producto.Focus();
     Datos.EstablecerConexion();
 }
Пример #7
0
 public Form1()
 {
     InitializeComponent();
     Datos.EstablecerConexion();
 }
Пример #8
0
 private void FORMREPORTES_Load(object sender, EventArgs e)
 {
     Datos.EstablecerConexion();
     LlenarCombobox();
     cb_mes.SelectedIndex = DateTime.Now.Month - 1;
 }