Example #1
0
        public static DataTable ventas_diarias(string fecha)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select concat('T',v.idventa_ticket) as ticket, vt.correlativo, vt.fecha, vt.monto_total
from ventas v, ventas_tickets vt
where v.idventa_ticket = vt.idventa_ticket and v.fecha >= '" + fecha + @" 00:00:00' and v.fecha <= '" + fecha + @" 23:60:00'
union
select concat('F', v.idventa_factura) as ticket, vf.numero_factura, vf.fecha, vf.monto_total
 from ventas v, ventas_factura vf
 where v.idventa_factura = vf.idventa and v.fecha >= '" + fecha + " 00:00:00' and v.fecha <= '" + fecha + @" 23:60:00'
     ; ";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
        private void guardar()
        {
            if (!validar())
            {
                if (!validarExistencias())
                {
                    proveedor = new conexiones_BD.clases.proveedores(txtCodigo.Text, txtProveedor.Text,
                                                                     txtDui.Text, txtNit.Text, txtNcr.Text, txtDireccion.Text, txtTelefono.Text, txtCorreo.Text);
                    List <conexiones_BD.clases.cuentas_proveedores> cuen = new List <conexiones_BD.clases.cuentas_proveedores>();
                    foreach (DataGridViewRow fila in tablacuentas.Rows)
                    {
                        cuen.Add(new conexiones_BD.clases.cuentas_proveedores("0", fila.Cells[4].Value.ToString(), fila.Cells[2].Value.ToString()));
                    }

                    op = new conexiones_BD.operaciones();
                    if (op.transaccionCuentas_proveedores(cuen, proveedor) > 0)
                    {
                        MessageBox.Show("El proveedor se ingreso correctamente", "Exíto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        vaciarDatos();
                        cargarTablas();
                    }
                    else
                    {
                        MessageBox.Show("No se puedo ingresar el proveedor", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Example #3
0
        public static DataTable CARGAR_TABLA_PRODUCTOS()
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select sp.idsucursal_producto as idSp, p.idproducto as idP ,p.cod_producto as codP,p.nom_producto as nombreP,
                        c.idcategoria as idC, c.nombre_categoria as nombreC, m.idmarca as idM, m.nombre as nombreM,
                        s.idsucursal as idS, s.numero_de_sucursal as numeroS, e.idestante as idE, e.nombre as nombreE,
                        p.fecha_ingreso as fechaI, ucc.idutilidad_compra as idUtiM, ucc.nombre as UtiM, ucc.porcentaje as PUtiM,
                        uc.idutilidad_compra as idUtiD, uc.nombre as UtiD, uc.porcentaje as PUtiD,
                        sp.precio_compraM as precioCM, sp.precio_compra as precioCD, sp.precio_ventaM as precioVM, sp.precio_venta as precioVD, sp.existencias as exis, sp.kardex
                        from sucursales_productos sp, sucursales s, productos p, utilidades_compras uc, utilidades_compras ucc ,estantes e, categorias c, marcas m
                        where sp.idsucursal=s.idsucursal 
                        and sp.idproducto=p.idproducto 
                        and sp.idutilidadDetalles=uc.idutilidad_compra 
                        and sp.idutilidadMayoreo=ucc.idutilidad_compra
                        and sp.idestante=e.idestante
                        and p.idcategoria=c.idcategoria
                        and p.idmarca=m.idmarca
                        ;";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #4
0
        private bool cerrandoCaja()
        {
            DateTime fecha_hora;

            fecha_hora   = DateTime.Now;
            caja.Fecha_c = fecha_hora.ToString("yyyy-MM-dd hh:mm:ss");
            caja.Estado  = "2";
            cortes_diarios cd = new cortes_diarios(total,
                                                   datos.Rows[0][2].ToString(),
                                                   datos.Rows[0][6].ToString(),
                                                   sesion.Datos[6],
                                                   datos.Rows[0][4].ToString(),
                                                   idcaja,
                                                   datos.Rows[0][0].ToString(),
                                                   datos.Rows[0][1].ToString(),
                                                   datos.Rows[0][5].ToString(),
                                                   datos.Rows[0][3].ToString()
                                                   );

            cortes_sucursales cs = new cortes_sucursales(sesion.DatosRegistro[1],
                                                         "", fecha_hora.ToString("yyyy-MM-dd hh:mm:ss"));

            conexiones_BD.operaciones op = new conexiones_BD.operaciones();

            if (op.transaccionCajasCortes(caja, cd, cs) > 0)
            {
                return(true);
            }
            else
            {
                MessageBox.Show("No pudimos cerrar la caja", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }
        private void agregarCodigo()
        {
            string estado = "";

            if (chkActi.Checked && !chkDesac.Checked)
            {
                estado = "1";
            }
            else if (!chkActi.Checked && chkDesac.Checked)
            {
                estado = "2";
            }

            conexiones_BD.clases.codigos           c  = new conexiones_BD.clases.codigos(txtCodigo.Text, estado);
            conexiones_BD.clases.productos_codigos pc = new conexiones_BD.clases.productos_codigos(idproducto, "");
            conexiones_BD.operaciones op = new conexiones_BD.operaciones();

            if (op.EjecutartransaccionCodigosProduc(c, pc) > 0)
            {
                cargartabla();
                txtCodigo.Text  = "";
                chkActi.Checked = true;
                Listo           = true;
            }
            else
            {
                MessageBox.Show("No se pudo ingresar el codigo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #6
0
        public static DataTable anulacion_ticket(string idventa)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select vt.correlativo, v.fecha, concat(c.nombre_cliente,' ',c.apellidos_cliente) as nom, p.nom_producto, pre.nombre_presentacion,
                        dvt.cantidad_paquete, dvt.precio_venta, dvt.total, vt.monto_total_neto, vt.efectivo, vt.cambio, u.usuario, fp.nombre_pago
                        from ventas v, ventas_tickets vt, detalles_ventas_ticket dvt, sucursales_productos sp, presentaciones_productos pp,
                        clientes c, productos p, presentaciones pre, usuarios u, formas_pagos fp
                        where v.idventa_ticket = vt.idventa_ticket
                        and vt.idcliente = c.idcliente
                        and dvt.idventa_ticket = vt.idventa_ticket
                        and vt.idusuario = u.idusuario
                        and vt.idforma_pago = fp.idforma_pago
                        and dvt.idsucursal_producto = sp.idsucursal_producto
                        and dvt.idpresentacion_producto = pp.idpresentacion_producto
                        and sp.idproducto = p.idproducto
                        and pp.idpresentacion = pre.idpresentacion
                        and v.idventa = '" + idventa + @"'
                        ;
            ";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #7
0
        private void guardarEmpleados()
        {
            if (!validar())
            {
                if (!validandoExistencias())
                {
                    emple = new conexiones_BD.clases.empleados(
                        txtNombre.Text,
                        txtApellidos.Text,
                        txtDui.Text,
                        txtNit.Text,
                        listaGenero.SelectedIndex.ToString(),
                        listaCargo.SelectedValue.ToString(),
                        txtTelefono.Text,
                        txtCorreo.Text);

                    emp_suc = new conexiones_BD.clases.empleados_sucursales(listaSucursales.SelectedValue.ToString(), "0");

                    op = new conexiones_BD.operaciones();
                    if (op.transaccionEmpleados_sucursales(emple, emp_suc) > 0)
                    {
                        MessageBox.Show("El empleado se guardo con exito", "Exíto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        vaciarDatos();
                        cargarTablas();
                        txtNombre.Focus();
                    }
                    else
                    {
                        MessageBox.Show("El empleado no se guardo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
        private void desactivarCodigos()
        {
            string estado = "";

            if (chkActi.Checked && !chkDesac.Checked)
            {
                estado = "1";
            }
            else if (!chkActi.Checked && chkDesac.Checked)
            {
                estado = "2";
            }
            conexiones_BD.clases.codigos c  = new conexiones_BD.clases.codigos(idcodigo, txtCodigo.Text, estado);
            conexiones_BD.operaciones    op = new conexiones_BD.operaciones();
            Console.WriteLine(c.sentenciaModi());
            if (op.actualizar(c.sentenciaModi().ToString()) > 0)
            {
                this.cargartabla();
                modificar       = false;
                txtCodigo.Text  = "";
                chkActi.Checked = true;
                listo           = true;
            }
            else
            {
                MessageBox.Show("No se pudo modificar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #9
0
        private bool anulando()
        {
            utilitarios.maneja_fechas fe = new utilitarios.maneja_fechas();


            bool anulado = false;

            conexiones_BD.clases.ventas.tickets     anu   = new conexiones_BD.clases.ventas.tickets(listaDocu.SelectedValue.ToString(), "2");
            conexiones_BD.clases.ventas.anulaciones anula = new conexiones_BD.clases.ventas.anulaciones(listaDocu.SelectedValue.ToString(),
                                                                                                        txtJustificacion.Text,
                                                                                                        listaVendedor.SelectedValue.ToString(),
                                                                                                        fe.fechaMysql(fec)
                                                                                                        );
            conexiones_BD.operaciones op = new conexiones_BD.operaciones();
            if (op.transaccionAnulacionVentaTic(anu, anula, modificaExistencias(conexiones_BD.clases.productos.EXISTENCIAS_PRODUCTOS_X_IDVENTA(listaDocu.SelectedValue.ToString()))) > 0)
            {
                MessageBox.Show("Ticket anulado con éxito", "éxito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                anulado = true;
            }
            else
            {
                MessageBox.Show("Se produjo algun error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                anulado = false;
            }

            return(anulado);
        }
Example #10
0
        private void enviandoTraslado()
        {
            utilitarios.maneja_fechas fech = new maneja_fechas();
            conexiones_BD.clases.traslados.traslado tras = new conexiones_BD.clases.traslados.traslado(
                listaSucurSalida.SelectedValue.ToString(),
                listaSucurLlegada.SelectedValue.ToString(),
                txtObservaciones.Text, fech.fechaMysql(fechaActual),
                fech.fechaMysql(fechaActual), "2", txtCorrelativo.Text);

            conexiones_BD.operaciones op = new conexiones_BD.operaciones();

            if (op.transaccionEnvioTraslado(tras, retornoProductos()) > 0)
            {
                enviantroTrasladoXinternet(tras, retornoProductos());
                MessageBox.Show("El traslado se ingreso éxitosamente", "Éxito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                listaSucurLlegada.SelectedIndex = -1;
                tabla_articulos.Rows.Clear();
                txtObservaciones.Text = "";
                fechaActual.Value     = DateTime.Now;
                txtCorrelativo.Text   = guardarCorrelativo(correSiguiente.ToString(), idcorrelativo.ToString(), correSiguiente.ToString());
            }
            else
            {
                MessageBox.Show("El traslado no se ingreso", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #11
0
        public static DataTable CARGAR_TABLA_PRODUCTOS_VENT()
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select pp.idsucursal_producto as idsp ,pr.cod_producto as codigo, pr.nom_producto as nombre, count(*) as cantipre, concat(pr.cod_producto,' < -|-> ',pr.nom_producto) as productoCod,
                        pp.precio, sp.existencias, p.nombre_presentacion as prese, pp.idpresentacion_producto as prepro, u.porcentaje as ud, uu.porcentaje as um,
                        pp.tipo, u.idutilidad_compra as idud, uu.idutilidad_compra as idum
                        from presentaciones_productos pp, sucursales_productos sp, presentaciones p, productos pr, utilidades_compras u, utilidades_compras uu
                        where pp.idsucursal_producto = sp.idsucursal_producto and pp.idpresentacion = p.idpresentacion and sp.idproducto = pr.idproducto
                        and sp.idutilidadDetalles = u.idutilidad_compra and sp.idutilidadMayoreo = uu.idutilidad_compra
                        group by pr.nom_producto
                        ; ";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
        private void guardandoGrupos()
        {
            if (validar())
            {
            }
            else
            {
                if (validarExistencias())
                {
                }
                else
                {
                    conexiones_BD.operaciones   op    = new conexiones_BD.operaciones();
                    conexiones_BD.clases.grupos grupo = new conexiones_BD.clases.grupos(txtGrupo.Text, txtDescripcion.Text);

                    if (op.transaccionPermisos_grupos(permiso, grupo) > 0)
                    {
                        MessageBox.Show("Los registros se ingresaron correctamente", "Exíto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        tabla = new utilitarios.cargar_tablas(tablaGrupos, txtBuscar, conexiones_BD.clases.grupos.datosTabla(), "nombre", lblRegistros);
                        vaciarTexbox();
                        tabla.cargar();
                    }
                    else
                    {
                        MessageBox.Show("Los registros no se ingresaron", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Example #13
0
        public static DataTable ventas_diarias(string fecha, string idsu)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select concat(v.fecha) as ticket, vt.correlativo, vt.fecha, vt.monto_total
                from ventas v, ventas_tickets vt
                where v.num_ticket = vt.correlativo and v.fecha >= '" + fecha + @" 00:00:00' and v.fecha <= '" + fecha + @" 23:59:59' and v.idsucursal='" + idsu + @"' and v.anulacion=1
                union
                select concat(v.fecha) as ticket, vf.numero_factura, vf.fecha, vf.monto_total
                 from ventas v, ventas_factura vf
                 where v.num_factura = vf.numero_factura and v.fecha >= '" + fecha + " 00:00:00' and v.fecha <= '" + fecha + @" 23:59:59' and v.idsucursal='" + idsu + @"'and v.anulacion=1
                     ; ";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
        public static DataTable detalle_proTic(string id)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select dvt.cantidad_paquete, p.nombre_presentacion, 
pr.nom_producto,  pp.precio, dvt.total, vt.fecha, vt.correlativo, vt.monto_total_neto, 
vt.efectivo, vt.cambio, ci.contenido, concat(cll.nombre_cliente,' ',cll.apellidos_cliente) as nombre,
cll.direccion, corr.inicio, corr.final, vt.idcorrelativo, pr.cod_producto, sp.kardex
from ventas v, ventas_tickets vt, detalles_ventas_ticket dvt, presentaciones_productos pp, sucursales_productos sp, presentaciones p,
productos pr, citas ci, clientes cll, correlativos_ticket corr
where v.idventa_ticket = vt.idventa_ticket
and dvt.idventa_ticket = vt.idventa_ticket
and dvt.idpresentacion_producto = pp.idpresentacion_producto
and pp.idsucursal_producto = sp.idsucursal_producto
and sp.idproducto = pr.idproducto
and pp.idpresentacion = p.idpresentacion
and dvt.idventa_ticket = '" + id + "' and vt.idcita=ci.idcita and vt.idcliente=cll.idcliente and vt.idcorrelativo = corr.idcorrelativo_ticket; ";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #15
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            utilitarios.maneja_fechas fe = new utilitarios.maneja_fechas();
            if (!validar())
            {
                pro = new conexiones_BD.clases.productos(
                    txtCodigo.Text,
                    txtnombreP.Text.ToUpper(),
                    fe.fechaMysql(fecha),
                    "60",
                    "53");

                sp = new conexiones_BD.clases.sucursales_productos(
                    sesion.DatosRegistro[1],
                    "0",
                    "2",
                    "4",
                    "1",
                    "1000",
                    precio.Value.ToString(),
                    "0.0",
                    "0.0",
                    "0.0",
                    "1");

                op = new conexiones_BD.operaciones();
                if (op.transaccionProductos_Presentaciones_Proveedores(generaProveedores(), generaPresentaciones(), pro, sp) > 0)
                {
                    MessageBox.Show("El producto se ingreso", "Exíto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ingresado = true;

                    xm._AñadirProductos(txtCodigo.Text, txtnombreP.Text.ToUpper(), fe.fechaMysql(fecha), "60", "53", Convert.ToInt16(sesion.DatosRegistro[0]));
                    xm._AñadirSucursal_productos(sesion.DatosRegistro[1],
                                                 "0",
                                                 "2",
                                                 "4",
                                                 "1",
                                                 "1000",
                                                 precio.Value.ToString(),
                                                 "0.0",
                                                 "0.0",
                                                 "0.0",
                                                 "1",
                                                 txtCodigo.Text, Convert.ToInt16(sesion.DatosRegistro[0]));
                    xm._AñadirProvedores_productos("2", "0", txtCodigo.Text, Convert.ToInt16(sesion.DatosRegistro[0]));
                    xm._AñadirPrese_prod("0", "1", "1", precio.Value.ToString(), "2", "2", txtCodigo.Text, Convert.ToInt16(sesion.DatosRegistro[0]));


                    this.Close();
                }
                else
                {
                    MessageBox.Show("El producto no se pudo ingresar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void btnIngresaTodos_Click(object sender, EventArgs e)
        {
            int con  = tabla_productos.RowCount;
            int cont = 0;

            if (tabla_productos.RowCount != 0)
            {
                xm._crearXml2("producto", transferencias_internet.nuevos_ingresos.rutas_sucursales(Convert.ToInt16(sesion.DatosRegistro[0])) + "productos.xml");
                foreach (DataGridViewRow fila in tabla_productos.Rows)
                {
                    if (!validarExistencias(fila.Cells[1].Value.ToString(), fila.Cells[0].Value.ToString()))
                    {
                        conexiones_BD.clases.productos pr = new conexiones_BD.clases.productos(
                            fila.Cells[0].Value.ToString(),
                            fila.Cells[1].Value.ToString(),
                            fila.Cells[2].Value.ToString(),
                            fila.Cells[3].Value.ToString(),
                            fila.Cells[4].Value.ToString()
                            );


                        conexiones_BD.operaciones op = new conexiones_BD.operaciones();
                        int res = op.transaccionProductos_Presentaciones_Proveedores(xm.Proveedores_productos(fila.Cells[0].Value.ToString()),
                                                                                     xm.Presentaciones_productos(fila.Cells[0].Value.ToString()),
                                                                                     pr, xm.sucp(fila.Cells[0].Value.ToString()));

                        if (res > 0)
                        {
                            xm.Borrar(fila.Cells[0].Value.ToString(), "producto");
                            xm.Borrar(fila.Cells[0].Value.ToString(), "sucursal_producto");
                            xm.Borrar(fila.Cells[0].Value.ToString(), "proveedor_producto");
                            xm.Borrar(fila.Cells[0].Value.ToString(), "presentacion_pro");
                            cont++;
                        }
                    }
                }

                if (con == cont)
                {
                    MessageBox.Show("Productos ingresados exitosamente a la base", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    tabla_productos.DataSource = null;
                }
                else
                {
                    cargarProductos();
                }
            }
        }
Example #17
0
        public static DataTable detalleventasXclientes(int id, string fechai, string fechaf)
        {
            DataTable Datos = new DataTable();

            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.comprasXcliente(fechai, fechaf, id);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #18
0
        private DataTable cargarDatos()
        {
            DataTable datos = new DataTable();

            conexiones_BD.operaciones op = new conexiones_BD.operaciones();
            op.Conexion_remota = conexion_remota;
            if (op.probarConexion2())
            {
                datos = conexiones_BD.clases.productos.CARGAR_TABLA_PRODUCTOS_VENT(conexion_remota);
            }
            else
            {
                MessageBox.Show("No hay conexión con el servidor", "Error de conexión", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(datos);
        }
Example #19
0
        public static DataTable estadisticasTodosClientes(string fechai, string fechaf)
        {
            DataTable Datos = new DataTable();

            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.estadisticasXTodos(fechai, fechaf);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #20
0
        private void modifica()
        {
            utilitarios.maneja_fechas fe = new utilitarios.maneja_fechas();
            string kar = "2";

            if (!validar())
            {
                if (!validarExistencias())
                {
                    if (chkKardex.Checked)
                    {
                        kar = "1";
                    }
                    sp = new conexiones_BD.clases.sucursales_productos(
                        this.idsucusal_producto,
                        listaSucursal.SelectedValue.ToString(),
                        this.idproducto,
                        listaMayoreo.SelectedValue.ToString(),
                        listaUtilidadDetalle.SelectedValue.ToString(),
                        listaEstante.SelectedValue.ToString(),
                        existencias.Value.ToString(),
                        precioVD.Value.ToString(),
                        precioCD.Value.ToString(),
                        precioVM.Value.ToString(),
                        precioCM.Value.ToString(),
                        kar);

                    pro = new conexiones_BD.clases.productos(
                        txtCodigo.Text,
                        txtnombreP.Text.ToUpper(),
                        fe.fechaMysql(fecha),
                        listaCategoria.SelectedValue.ToString(),
                        listaMarca.SelectedValue.ToString(),
                        this.idproducto);

                    op = new conexiones_BD.operaciones();
                    if (op.EjecutartransaccionModificarProducto(sp, pro) > 0)
                    {
                        cargarTablas();
                        MessageBox.Show("Se actualizo con exíto", "Exíto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        vaciar();
                        habilitar(false);
                    }
                }
            }
        }
Example #21
0
        public static DataTable datosTabla(string nombre)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = "select * from cajas where estado=1 and nombre_equipo='" + nombre + "';";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #22
0
        public static DataTable TODO_LOS_UNIDADES()
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select * from unidades;";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
        public static DataTable datosTabla(string idsucursal)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = "select * from correlativos_ticket where idsucursal='" + idsucursal + "' and activos=1;";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #24
0
        public static DataTable datosTabla()
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = "select * from tipos_gastos;";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #25
0
        private void enviandoTraslado()
        {
            DataTable existencia = conexiones_BD.clases.traslados.traslado.exitsenciaCorrelativo(tabla_traslados.CurrentRow.Cells[6].Value.ToString());

            utilitarios.maneja_fechas fech = new utilitarios.maneja_fechas();
            conexiones_BD.clases.traslados.traslado tras = new conexiones_BD.clases.traslados.traslado(
                tabla_traslados.CurrentRow.Cells[0].Value.ToString(),
                tabla_traslados.CurrentRow.Cells[1].Value.ToString(),
                tabla_traslados.CurrentRow.Cells[2].Value.ToString(),
                tabla_traslados.CurrentRow.Cells[3].Value.ToString(),
                tabla_traslados.CurrentRow.Cells[4].Value.ToString(), "1",
                tabla_traslados.CurrentRow.Cells[6].Value.ToString());

            conexiones_BD.operaciones op = new conexiones_BD.operaciones();
            actualizandoPresentaciones_productos();

            if (existencia.Rows.Count != 0)
            {
                if (op.transaccionRecepcionTraslado2(existencia.Rows[0][0].ToString(), retornoProductos(), registro) > 0)
                {
                    MessageBox.Show("El traslado se actualizo éxitosamente", "Éxito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    registro.Clear();
                    quitandoPresentaciones_detalles();
                }
                else
                {
                    MessageBox.Show("El traslado no se actualizo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                if (op.transaccionRecepcionTraslado(tras, retornoProductos(), registro) > 0)
                {
                    MessageBox.Show("El traslado se ingreso éxitosamente", "Éxito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    registro.Clear();
                    quitandoPresentaciones_detalles();
                }
                else
                {
                    MessageBox.Show("El traslado no se ingreso", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Example #26
0
        public static DataTable datosTabla(bool cr)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = "select * from categorias where estado=1 order by nombre_categoria;";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            oOperacion.Conexion_remota = cr;
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #27
0
        public static DataTable ventasXcliente(string id, string fechai, string fechaf)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Console.WriteLine(fechai + " " + fechaf);
            Consulta = @"select sumasVentas(" + id + ",'" + fechai + "','" + fechaf + "');";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #28
0
        public static DataTable datosTabla(bool cr)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = "select * from proveedores;";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            oOperacion.Conexion_remota = cr;
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #29
0
        public static DataTable datosTablaCorrelativo(string idsuc, string nombre)
        {
            DataTable Datos = new DataTable();
            String    Consulta;

            Consulta = @"select ct.idcorrelativo_ticket as idc, s.numero_de_sucursal as nus, ct.numero_siguiente as ns, ct.final as f, ct.activos as act, ct.nombre_equipo as nom_equi
from correlativos_ticket ct, sucursales s
where s.idsucursal=" + idsuc + " and ct.nombre_equipo='" + nombre + "' and ct.activos=1;";
            conexiones_BD.operaciones oOperacion = new conexiones_BD.operaciones();
            try
            {
                Datos = oOperacion.Consultar(Consulta);
            }
            catch
            {
                Datos = new DataTable();
            }

            return(Datos);
        }
Example #30
0
        private void colocandoDatos()
        {
            conexiones_BD.operaciones op = new conexiones_BD.operaciones();
            datos = op.datoscaja(Convert.ToInt32(idcaja));


            if (datos.Rows.Count > 0)
            {
                lblinicial.Text       = "$" + efectivoI;
                lblVentaT.Text        = "$" + datos.Rows[0][0].ToString();
                lblVentaF.Text        = "$" + datos.Rows[0][1].ToString();
                lblAnulacion.Text     = "$" + datos.Rows[0][2].ToString();
                lblAnula_Compras.Text = "$" + datos.Rows[0][3].ToString();
                lblGastoOpe.Text      = "$" + datos.Rows[0][4].ToString();
                lblCompra.Text        = "$" + datos.Rows[0][5].ToString();
                calculandoTotal();
                lblTota.Text  = "$" + total;
                lblGanan.Text = "$" + datos.Rows[0][6].ToString();
            }
        }