Example #1
0
def insertPlane():
    modelCode = request.form.get('modelCode')
    constructionDay = request.form.get('constructionDay')
    Model = PlaneModel.SelectPlaneModelsID(modelCode)
    plane = Plane("NULL", Model, constructionDay)
    plane.InsertPlane()
    return redirect('/plane')
Example #2
0
def editPlane():
    idPlane = request.form.get('idPlane')
    modelCode = request.form.get('modelCode')
    constructionDay = request.form.get('constructionDay')
    Model = PlaneModel.SelectPlaneModelsID(modelCode)
    plane = Plane.SelectPlaneID(idPlane)
    plane.UpdatePlane(Model, constructionDay)
    return redirect('/plane')
 def GetFlight(dic):
     Database = DB()
     planeCursor = Database.run("SELECT * FROM Plane WHERE idPlane = %s;",
                                str(dic["idPlane"]))
     planeDict = planeCursor.fetchone()
     tmpPlane = ClassPlane.GetPlane(planeDict)
     Plane = ClassPlane(tmpPlane[0], tmpPlane[1], tmpPlane[2])
     return dic["idFlight"], dic["departure"], dic["arrival"], Plane, dic["flightDepartureDatetime"],\
            dic["flightArrivalDatetime"], dic["percentDiscount"]
Example #4
0
def insertFlight():
    departure = request.form.get('departure')
    arrival = request.form.get('arrival')
    idPlane = request.form.get('idPlane')
    flightDepartureDatetime = request.form.get('flightDepartureDatetime')
    flightArrivalDatetime = request.form.get('flightArrivalDatetime')
    percentDiscount = request.form.get('percentDiscount')
    plane = Plane.SelectPlaneID(idPlane)
    flight = Flight("NULL", departure, arrival, plane, flightDepartureDatetime,
                    flightArrivalDatetime, percentDiscount)
    flight.InsertFlight()
    return redirect('/flight')
Example #5
0
def editFlight():
    idFlight = request.form.get('idFlight')
    departure = request.form.get('departure')
    arrival = request.form.get('arrival')
    idPlane = request.form.get('idPlane')
    flightDepartureDatetime = request.form.get('flightDepartureDatetime')
    flightArrivalDatetime = request.form.get('flightArrivalDatetime')
    percentDiscount = request.form.get('percentDiscount')
    plane = Plane.SelectPlaneID(idPlane)
    flight = Flight.SelectFlightsID(idFlight)
    flight.UpdateFlight(departure, arrival, plane, flightDepartureDatetime,
                        flightArrivalDatetime, percentDiscount)
    return redirect('/flight')
Example #6
0
def deltePlane():
    idPlane = request.args.get('idPlane')
    Plane.DeletePlane(idPlane)
    return redirect('/plane')
Example #7
0
def plane():
    listaPlane = Plane.SelectPlanes()
    return render_template('Plane.html', listaPlane=listaPlane)