コード例 #1
0
from app import app
import mysql.connector

from mysql.connector.errors import Error
from flask import render_template, request, redirect, url_for, session
from app.services import db
from app.controllers import login
from app.controllers import logout
from app.controllers import home

connection = db.db_connection()


@app.route('/clientes')
def cliente_inicio():
    if 'loggedin' in session:
        return render_template('clientes.html',
                               username=session['username'],
                               loggedin=session['loggedin'],
                               breadcrumb='Clientes',
                               page_header='Menu de Navegação')
    return redirect(url_for('login'))


@app.route('/cliente', methods=['GET', 'POST'])
def cliente():
    if 'loggedin' in session:
        clientes = listaCliente()
        return render_template('clientes.html',
                               clientes=clientes,
                               username=session['username'],
コード例 #2
0
def AtualizarEstoque(idVenda):
    connection = db.db_connection()
    cursor = connection.cursor()
    cursor.callproc('AtualizaEstoque',[idVenda])
    connection.commit()
    print('executou')