Пример #1
0
        //NUEVO PRODUCTO
        public bool AgregarBolson(string nombre, string unidad, string tipo, long cantidad, float precioCompra)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("INSERT INTO Bolson (bolsonNombre, bolsonUnidad, bolsonTipo, bolsonCantidad, bolsonPrecioCompra) VALUES ('" + nombre + "', '" + unidad + "', '" + tipo + "', " + cantidad + ", '" + precioCompra + "')"));
            //return consulta;
        }
Пример #2
0
        public int CrearPedido(int mesa)
        {
            ConexionGeneral CG = new ConexionGeneral();

            CG.Ejecutor("INSERT INTO Pedido (idCliente, tipo, mesa, idEmpleado) VALUES (0, 0," + mesa + ", 0)");
            string pedidoString = CG.ValorUnico("SELECT idPedido FROM Pedido ORDER BY idPedido DESC LIMIT 1 ");
            int    pedidoNum    = int.Parse(pedidoString);

            return(pedidoNum);
        }
Пример #3
0
        /// ///////////////////////////////////////////////////////////////////////////////

        //ELIMINAR FACTURA

        //Eliminar factura
        public bool FacturaEliminar(int idFactura)
        {
            ConexionGeneral CG    = new ConexionGeneral();
            bool            exito = false;

            if (CG.Ejecutor("DELETE FROM FacturaProducto WHERE facturaID = " + idFactura + ""))
            {
                if (CG.Ejecutor("DELETE FROM Factura WHERE facturaID = " + idFactura + ""))
                {
                    exito = true;
                    MessageBox.Show("Factura eliminada");
                }
                else
                {
                    MessageBox.Show("Hubo un error al eliminar la factura");
                }
            }

            return(exito);
        }
Пример #4
0
        //Edita los datos de una factura
        public void FacturaEditar(int id, string nombre, string fecha, string descuento, string total)
        {
            int             descuentoEntero = int.Parse(descuento);
            int             totalEntero     = int.Parse(total);
            DataSet         DDSS            = new DataSet();
            ConexionGeneral CG = new ConexionGeneral();

            if (CG.Ejecutor("UPDATE Factura SET 'facturaNombre' = '" + nombre + "', 'facturaFecha' = '" + fecha + "', 'facturaDescuento' = " + descuentoEntero + ", 'facturaTotal' = " + totalEntero + "  WHERE facturaID = " + id + ""))
            {
            }
        }
Пример #5
0
        // //////////////////////////////////////////////////////////////////////////////////////


        //VALIDADORES

        //Validar producto a agregar a la factura
        public void ProductoAgregar(int facturaID, string productoID, string productoCantidad, string precioUnitario)
        {
            ConexionGeneral CG = new ConexionGeneral();
            //int factID = int.Parse(facturaID);
            int prodID    = int.Parse(productoID);
            int prodCant  = int.Parse(productoCantidad);
            int precioUni = int.Parse(precioUnitario);

            if (CG.Ejecutor("INSERT INTO FacturaProducto (facturaID, productoID, productoCantidad,  productoPrecioUnitario) VALUES (" + facturaID + ", " + prodID + ", " + prodCant + ", " + precioUni + ")"))
            {
                //MessageBox.Show("Factura Creada");
            }
        }
Пример #6
0
        // /////////////////////////////////////////////////////////////
        // FACTURA CREAR



        public void FacturaCrear(string nombre, string fecha, string descuento, string facturaTotal)
        {
            int             descuentoEntero = 0;
            ConexionGeneral CG = new ConexionGeneral();

            if (descuento == "")
            {
                descuentoEntero = 0;
            }
            else
            {
                descuentoEntero = int.Parse(descuento);
            }

            int total = Int32.Parse(facturaTotal);

            if (CG.Ejecutor("INSERT INTO Factura (facturaNombre, facturaFecha, facturaDescuento,  facturaTotal) VALUES ('" + nombre + "', '" + fecha + "', " + descuentoEntero + ", " + total + ")"))
            {
                //MessageBox.Show("Factura Creada");
            }
        }
Пример #7
0
        public bool AgregarItem(string nombre, string descripcion, float precio, int cantidad)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("INSERT INTO ItemStock ( nombre,descripcion,cantidad,precio ) VALUES ( '" + nombre + "', '" + descripcion + "','" + cantidad + "','" + precio + "')"));
        }
Пример #8
0
        //MODIFICAR PRODUCTO
        public bool ModificarBolson(int bolsonId, string nombre, string unidad, string tipo, long cantidad, float precioCompra)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("UPDATE Bolson SET  bolsonNombre = '" + nombre + "', bolsonUnidad = '" + unidad + "', bolsonTipo = '" + tipo + "', bolsonCantidad = " + cantidad + ", bolsonPrecioCompra = " + precioCompra + " where bolsonId = " + bolsonId + ""));
        }
Пример #9
0
        public bool ModificarItem(int codItem, string nombre, string descripcion, float precio, int cantidad)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("UPDATE ItemStock SET nombre = '" + nombre + "',descripcion = '" + descripcion + "', precio = " + precio + " ,cantidad = " + cantidad + " where codItem = " + codItem));
        }
Пример #10
0
        //Se ejecuta al editar los productos de una factura. Elimina todos los productos de la factura para que se carguen los nuevos
        public void EditarEliminarProductosFactura(int idFactura)
        {
            ConexionGeneral CG = new ConexionGeneral();

            CG.Ejecutor("DELETE FROM FacturaProducto WHERE facturaID = " + idFactura + "");
        }
Пример #11
0
        public void MesaVaciar(int numMesa)
        {
            ConexionGeneral CG = new ConexionGeneral();

            CG.Ejecutor("UPDATE Mesa SET estadoMesa = 0, pedidoMesa = 0 WHERE idMesa = " + numMesa + "");
        }
Пример #12
0
        public bool AgregarFactura(int codPedido, int totalFact, string fecha)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("INSERT INTO Factura ( codPedido, totalFact, fecha) VALUES (" + codPedido + "," + totalFact + ", '" + fecha + "')"));
        }
Пример #13
0
        public bool ModificarItem(int StockId, string codigo, string producto, string categoria, float precioCompra, int cantidad)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("UPDATE Stock SET codigo = '" + codigo + "',producto = '" + producto + "',categoria = '" + categoria + "', precioCompra = " + precioCompra + " ,cantidad = " + cantidad + " where StockId = " + StockId));
        }
Пример #14
0
        public bool ModificarEmpleado(int idEmpleado, int dni, string nombre, string direccion, int horas, int vHs, int sueldo)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("UPDATE Empleado SET dni = " + dni + ",nombre = '" + nombre + "',direccion = '" + direccion + "', horas = " + horas + ", Xhs = " + vHs + ",sueldo = " + sueldo + "  where idEmpleado = " + idEmpleado));
        }
Пример #15
0
        public bool EliminarItem(int codItem)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("DELETE from ItemStock where codItem = " + codItem));
        }
Пример #16
0
        //ELIMINAR PRODUCTO
        public bool EliminarBolson(int bolsonId)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("DELETE from Bolson where bolsonId = " + bolsonId + ""));
        }
Пример #17
0
        public void PedidoItemCrear(int Itemcod, int cantidad, int precio, int idPedido)
        {
            ConexionGeneral CG = new ConexionGeneral();

            CG.Ejecutor("INSERT INTO PedidoItem (codItem, cantidad, precio, idPedido) VALUES (" + Itemcod + ", " + cantidad + ", " + precio + "," + idPedido + ")");
        }
Пример #18
0
        public bool NuevoEmpleado(int dni, string nombre, string direccion, int horas, int vHs, int sueldo)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("INSERT INTO Empleado ( dni, nombre, direccion, horas, Xhs, sueldo) VALUES ( " + dni + ", '" + nombre + "','" + direccion + "', " + horas + ", " + vHs + ", " + sueldo + ")"));
        }
Пример #19
0
        public void MesaOcupar(int numMesa, int numPedido)
        {
            ConexionGeneral CG = new ConexionGeneral();

            CG.Ejecutor("UPDATE Mesa SET estadoMesa = 1, pedidoMesa = " + numPedido + " WHERE idMesa = " + numMesa + "");
        }
Пример #20
0
        public bool EliminarEmpleado(int idEmpleado)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("DELETE from Empleado where idEmpleado = " + idEmpleado));
        }
Пример #21
0
        public bool AgregarItem(string producto, string codigo, string categoria, string descripcion, string comentario, float precioCompra, int cantidad)
        {
            ConexionGeneral CG = new ConexionGeneral();

            return(CG.Ejecutor("INSERT INTO Stock ( producto, codigo, categoria, descripcion, comentario, precioCompra, cantidad) VALUES ( '" + producto + "', '" + codigo + "','" + categoria + "','" + descripcion + "', '" + comentario + "'," + precioCompra + "," + cantidad + ")"));
        }