reformat
This commit is contained in:
parent
d411b7e1d1
commit
640640cab0
@ -1,14 +1,17 @@
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
from src.c.Main import Main
|
from src.c.Main import Main
|
||||||
import sqlite3
|
|
||||||
|
|
||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
class connexionBDD :
|
|
||||||
|
class connexionBDD:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
self.__conn = sqlite3.connect("BD.sql3")
|
self.__conn = sqlite3.connect("BD.sql3")
|
||||||
self.__cur = self.__conn.cursor()
|
self.__cur = self.__conn.cursor()
|
||||||
except Exception as e :
|
except Exception as e:
|
||||||
pass # later
|
pass # later
|
||||||
|
|
||||||
def seDeconnecter(self):
|
def seDeconnecter(self):
|
||||||
@ -19,7 +22,7 @@ class connexionBDD :
|
|||||||
try:
|
try:
|
||||||
r = self.__cur.execute(req)
|
r = self.__cur.execute(req)
|
||||||
self.__conn.commit()
|
self.__conn.commit()
|
||||||
except Exception as e :
|
except Exception as e:
|
||||||
pass # later
|
pass # later
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@ -27,6 +30,7 @@ class connexionBDD :
|
|||||||
def lastId(self):
|
def lastId(self):
|
||||||
return self.__cur.lastrowid
|
return self.__cur.lastrowid
|
||||||
|
|
||||||
|
|
||||||
conn = connexionBDD
|
conn = connexionBDD
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -9,6 +9,7 @@ class Acces:
|
|||||||
"""
|
"""
|
||||||
Controleur Acces
|
Controleur Acces
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__parking = Parking()
|
self.__parking = Parking()
|
||||||
self.__camera = Camera()
|
self.__camera = Camera()
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from src.c.Teleporteur import Teleporteur
|
from src.c.Teleporteur import Teleporteur
|
||||||
from src.m.Placement import Placement
|
from src.m.Placement import Placement
|
||||||
from src.m.Client import Client
|
from src.m.Client import Client
|
||||||
from src.m.TypeAbonnement import TypeAbonnement
|
from src.m.TypeAbonnement import TypeAbonnement
|
||||||
from src.v.Camera import Camera
|
from src.v.Camera import Camera
|
||||||
from PyQt4 import QtGui
|
|
||||||
from src.v.MyQWidget import MyQWidget
|
from src.v.MyQWidget import MyQWidget
|
||||||
from src.v.Ui_Borne import Ui_Borne
|
from src.v.Ui_Borne import Ui_Borne
|
||||||
|
|
||||||
|
|
||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
|
|
||||||
@ -13,6 +16,7 @@ class Borne:
|
|||||||
"""
|
"""
|
||||||
Controleur de la vue de la borne permettant l'accès au parking
|
Controleur de la vue de la borne permettant l'accès au parking
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, main, parking):
|
def __init__(self, main, parking):
|
||||||
self.__parking = parking
|
self.__parking = parking
|
||||||
self.__main = main
|
self.__main = main
|
||||||
@ -32,7 +36,7 @@ class Borne:
|
|||||||
self.__ui.btn_recuperer.clicked.connect(self.recuperer)
|
self.__ui.btn_recuperer.clicked.connect(self.recuperer)
|
||||||
|
|
||||||
|
|
||||||
#Validator
|
# Validator
|
||||||
|
|
||||||
|
|
||||||
self.__ui.nomParking = parking.nom
|
self.__ui.nomParking = parking.nom
|
||||||
@ -40,7 +44,6 @@ class Borne:
|
|||||||
self.showWindow()
|
self.showWindow()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def nonVoiture(self):
|
def nonVoiture(self):
|
||||||
"""
|
"""
|
||||||
Met en etat initial de départ sans voiture
|
Met en etat initial de départ sans voiture
|
||||||
@ -71,11 +74,11 @@ class Borne:
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
self.__c = Client.get(self.__ui.lineEdit_id.text())
|
self.__c = Client.get(self.__ui.lineEdit_id.text())
|
||||||
if self.__c != None :
|
if self.__c != None:
|
||||||
self.__ui.label_aff.setText("Bonjour " + str(self.__c.nom)+ " " + str(self.__c.prenom))
|
self.__ui.label_aff.setText("Bonjour " + str(self.__c.nom) + " " + str(self.__c.prenom))
|
||||||
#self.__ui.labIdClient.setText(str(self.__c))
|
# self.__ui.labIdClient.setText(str(self.__c))
|
||||||
self.__ui.box_id.setDisabled(True)
|
self.__ui.box_id.setDisabled(True)
|
||||||
else :
|
else:
|
||||||
self.__ui.label_aff.setText("Echec identification")
|
self.__ui.label_aff.setText("Echec identification")
|
||||||
self.__ui.labIdClient.setText("Non identifier")
|
self.__ui.labIdClient.setText("Non identifier")
|
||||||
|
|
||||||
@ -84,19 +87,19 @@ class Borne:
|
|||||||
Gestion validation formaulaire d'abonnement
|
Gestion validation formaulaire d'abonnement
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if self.__c != None :
|
if self.__c != None:
|
||||||
self.__c.maj(self.__ui.nomLineEdit,
|
self.__c.maj(self.__ui.nomLineEdit,
|
||||||
self.__ui.prenomLineEdit,
|
self.__ui.prenomLineEdit,
|
||||||
"",
|
"",
|
||||||
TypeAbonnement.SUPER_ABONNE)
|
TypeAbonnement.SUPER_ABONNE)
|
||||||
self.__ui.label_aff.setText("Mise a jour de votre abonnement effectué")
|
self.__ui.label_aff.setText("Mise a jour de votre abonnement effectué")
|
||||||
else:
|
else:
|
||||||
if self.__ui.checkBox.isEnabled() :
|
if self.__ui.checkBox.isEnabled():
|
||||||
self.__c = Client(self.__ui.nomLineEdit,
|
self.__c = Client(self.__ui.nomLineEdit,
|
||||||
self.__ui.prenomLineEdit,
|
self.__ui.prenomLineEdit,
|
||||||
"",
|
"",
|
||||||
TypeAbonnement.SUPER_ABONNE)
|
TypeAbonnement.SUPER_ABONNE)
|
||||||
else :
|
else:
|
||||||
self.__c = Client(self.__ui.nomLineEdit,
|
self.__c = Client(self.__ui.nomLineEdit,
|
||||||
self.__ui.prenomLineEdit,
|
self.__ui.prenomLineEdit,
|
||||||
"",
|
"",
|
||||||
@ -111,11 +114,11 @@ class Borne:
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if self.__c is None:
|
if self.__c is None:
|
||||||
id = Teleporteur.teleporterVoiture(self.v_actuel,self.__parking.recherchePlace(self.v_actuel))
|
id = Teleporteur.teleporterVoiture(self.v_actuel, self.__parking.recherchePlace(self.v_actuel))
|
||||||
self.__ui.label_aff.setText("Votre num ticket est : " + id)
|
self.__ui.label_aff.setText("Votre num ticket est : " + id)
|
||||||
else:
|
else:
|
||||||
if self.__c.abonnement != TypeAbonnement.SUPER_ABONNE :
|
if self.__c.abonnement != TypeAbonnement.SUPER_ABONNE:
|
||||||
Teleporteur.teleporterVoiture(self.v_actuel,self.__parking.recherchePlace(self.v_actuel))
|
Teleporteur.teleporterVoiture(self.v_actuel, self.__parking.recherchePlace(self.v_actuel))
|
||||||
else:
|
else:
|
||||||
Teleporteur.teleporterVoirureSuperAbonne(self.v_actuel)
|
Teleporteur.teleporterVoirureSuperAbonne(self.v_actuel)
|
||||||
|
|
||||||
@ -133,7 +136,6 @@ class Borne:
|
|||||||
self.__ui.label_aff.setText("Bonne journée")
|
self.__ui.label_aff.setText("Bonne journée")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def showWindow(self):
|
def showWindow(self):
|
||||||
"""
|
"""
|
||||||
Gestion affichage de la vue borne
|
Gestion affichage de la vue borne
|
||||||
|
@ -13,6 +13,7 @@ class CreaParking:
|
|||||||
"""
|
"""
|
||||||
Controleur de cretion de parking
|
Controleur de cretion de parking
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, main):
|
def __init__(self, main):
|
||||||
self._main = main
|
self._main = main
|
||||||
self._main.activity("Debut Creation Parking", self._main.lvl.INFO)
|
self._main.activity("Debut Creation Parking", self._main.lvl.INFO)
|
||||||
@ -27,7 +28,7 @@ class CreaParking:
|
|||||||
self._ui.btn_valider.clicked.connect(self.valider)
|
self._ui.btn_valider.clicked.connect(self.valider)
|
||||||
self._ui.btn_annuler.clicked.connect(self.annuler)
|
self._ui.btn_annuler.clicked.connect(self.annuler)
|
||||||
|
|
||||||
#Validator
|
# Validator
|
||||||
#self._ui.lineEdit_nbNiv.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]*')))
|
#self._ui.lineEdit_nbNiv.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]*')))
|
||||||
|
|
||||||
self._ui.tableWidget.insertRow(self._ui.tableWidget.rowCount())
|
self._ui.tableWidget.insertRow(self._ui.tableWidget.rowCount())
|
||||||
@ -74,7 +75,7 @@ class CreaParking:
|
|||||||
Gestion validation de formulaire de creation de parking.
|
Gestion validation de formulaire de creation de parking.
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
#try:
|
# try:
|
||||||
l = ListeTypePlace()
|
l = ListeTypePlace()
|
||||||
for i in range(0, self._ui.tableWidget.rowCount()):
|
for i in range(0, self._ui.tableWidget.rowCount()):
|
||||||
l.add(int(self._ui.tableWidget.item(i, 0).text()), int(self._ui.tableWidget.item(i, 1).text()),
|
l.add(int(self._ui.tableWidget.item(i, 0).text()), int(self._ui.tableWidget.item(i, 1).text()),
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
from src.c.Borne import Borne
|
|
||||||
|
|
||||||
|
from src.c.Borne import Borne
|
||||||
from src.c.DetailsPlaces import DetailsPlaces
|
from src.c.DetailsPlaces import DetailsPlaces
|
||||||
from src.c.log.log import Log
|
from src.c.log.log import Log
|
||||||
from src.c.log.log import lvl
|
from src.c.log.log import lvl
|
||||||
@ -29,7 +29,7 @@ class Main:
|
|||||||
self.__ui.setupUi(self.__view)
|
self.__ui.setupUi(self.__view)
|
||||||
|
|
||||||
|
|
||||||
#connect
|
# connect
|
||||||
self.__ui.comboBox.currentIndexChanged['QString'].connect(self.selectParking)
|
self.__ui.comboBox.currentIndexChanged['QString'].connect(self.selectParking)
|
||||||
self.__ui.btn_creer.clicked.connect(self.creerParking)
|
self.__ui.btn_creer.clicked.connect(self.creerParking)
|
||||||
self.__ui.btn_supprimer.clicked.connect(self.rmParking)
|
self.__ui.btn_supprimer.clicked.connect(self.rmParking)
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
from src.m.connexionBDD import connexionBDD
|
from src.m.connexionBDD import connexionBDD
|
||||||
|
|
||||||
|
|
||||||
class Abonnement:
|
class Abonnement:
|
||||||
def __init__(self, libelle, prix, estPackGar):
|
def __init__(self, libelle, prix, estPackGar):
|
||||||
self.libelle = libelle
|
self.libelle = libelle
|
||||||
self.prix = prix
|
self.prix = prix
|
||||||
self.estPackGar = estPackGar
|
self.estPackGar = estPackGar
|
||||||
|
|
||||||
def addContrat(self, contrat):
|
def addContrat(self, contrat):
|
||||||
connexion = connexionBDD()
|
connexion = connexionBDD()
|
||||||
# indId= connexion.cur.execute("SELECT abonnement.idAbonnement FROM abonnement WHERE libelle = ? AND prix = ? AND estPackGar=?;"(self.libelle, self.prix, self.estPackGar))
|
# indId= connexion.cur.execute("SELECT abonnement.idAbonnement FROM abonnement WHERE libelle = ? AND prix = ? AND estPackGar=?;"(self.libelle, self.prix, self.estPackGar))
|
||||||
|
@ -6,12 +6,12 @@ __author__ = 'sidya'
|
|||||||
|
|
||||||
|
|
||||||
class Client():
|
class Client():
|
||||||
|
|
||||||
clients = []
|
clients = []
|
||||||
|
|
||||||
def __init__(self, nom, prenom, adresse, typeAbonnement):
|
def __init__(self, nom, prenom, adresse, typeAbonnement):
|
||||||
while True :
|
while True:
|
||||||
id =''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(random.randint(1,10)))
|
id = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in
|
||||||
|
range(random.randint(1, 10)))
|
||||||
if Client.get(id) is None:
|
if Client.get(id) is None:
|
||||||
break
|
break
|
||||||
self.__id = id
|
self.__id = id
|
||||||
@ -63,9 +63,10 @@ class Client():
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def saveAll(connection):
|
def saveAll(connection):
|
||||||
cur = connection.cursor()
|
cur = connection.cursor()
|
||||||
#reset table Client
|
# reset table Client
|
||||||
cur.execute("DROP TABLE IF EXISTS Client")
|
cur.execute("DROP TABLE IF EXISTS Client")
|
||||||
cur.execute("""create table Client (num varchar(10) PRIMARY KEY, nom varchar(30), prenom varchar(30), adr varchar(50), abo int(1))""")
|
cur.execute(
|
||||||
|
"""create table Client (num varchar(10) PRIMARY KEY, nom varchar(30), prenom varchar(30), adr varchar(50), abo int(1))""")
|
||||||
# insert clients
|
# insert clients
|
||||||
for c in Client.tous:
|
for c in Client.tous:
|
||||||
cur.execute("insert into Client values (?, ?, ?, ?, ?)", (c.id, c.nom, c.prenom, c.adr, c.abonnement))
|
cur.execute("insert into Client values (?, ?, ?, ?, ?)", (c.id, c.nom, c.prenom, c.adr, c.abonnement))
|
||||||
@ -78,8 +79,9 @@ class Client():
|
|||||||
self.__typeAbonnement = typeAbonnement
|
self.__typeAbonnement = typeAbonnement
|
||||||
self.__adresse = adresse
|
self.__adresse = adresse
|
||||||
|
|
||||||
def __str__( self ):
|
def __str__(self):
|
||||||
return "( " + self.__id +", " + self.__nom+", " + self.__prenom+", " + self.__adresse +", " + str(self.__typeAbonnement) +" )"
|
return "( " + self.__id + ", " + self.__nom + ", " + self.__prenom + ", " + self.__adresse + ", " + str(
|
||||||
|
self.__typeAbonnement) + " )"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
class connexionBDD :
|
|
||||||
|
class connexionBDD:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
self.__conn = sqlite3.connect("BD.sql3")
|
self.__conn = sqlite3.connect("BD.sql3")
|
||||||
self.__cur = self.__conn.cursor()
|
self.__cur = self.__conn.cursor()
|
||||||
except Exception as e :
|
except Exception as e:
|
||||||
pass # later
|
pass # later
|
||||||
|
|
||||||
def seDeconnecter(self):
|
def seDeconnecter(self):
|
||||||
@ -16,7 +17,7 @@ class connexionBDD :
|
|||||||
try:
|
try:
|
||||||
r = self.__cur.execute(req)
|
r = self.__cur.execute(req)
|
||||||
self.__conn.commit()
|
self.__conn.commit()
|
||||||
except Exception as e :
|
except Exception as e:
|
||||||
pass # later
|
pass # later
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
from src.m.connexionBDD import connexionBDD
|
from src.m.connexionBDD import connexionBDD
|
||||||
|
|
||||||
|
|
||||||
class Contrat:
|
class Contrat:
|
||||||
def __init__(self, dateDebut, dateFin):
|
def __init__(self, dateDebut, dateFin):
|
||||||
self.dateDebut = dateDebut
|
self.dateDebut = dateDebut
|
||||||
self.dateFin = dateFin
|
self.dateFin = dateFin
|
||||||
|
|
||||||
def enregistrerContrat(self):
|
def enregistrerContrat(self):
|
||||||
connection = connexionBDD()
|
connection = connexionBDD()
|
||||||
connection.cur.execute("INSERT INTO contrat (idContrat,dateDebut,dateFin, estEncours) VALUES (NULL,?,?,1);",( self.dateDebut, self.dateFin,1) )
|
connection.cur.execute("INSERT INTO contrat (idContrat,dateDebut,dateFin, estEncours) VALUES (NULL,?,?,1);",
|
||||||
|
( self.dateDebut, self.dateFin, 1))
|
||||||
connection.seDeconnecter()
|
connection.seDeconnecter()
|
||||||
|
|
||||||
def rompreContrat(self, idCLient):
|
def rompreContrat(self, idCLient):
|
||||||
connection = connexionBDD()
|
connection = connexionBDD()
|
||||||
indContrat =connection.cur.execute("SELECT Contrat.idContrat FROM contrat where idClient =? AND dateDebut = ? AND dateFin=? ;"(idCLient, self.dateDebut, self.dateFin))
|
indContrat = connection.cur.execute(
|
||||||
idContrat= int(''.join(map(str,indContrat)))
|
"SELECT Contrat.idContrat FROM contrat where idClient =? AND dateDebut = ? AND dateFin=? ;"(idCLient,
|
||||||
connection.cur.execute("Update contrat where idContrat=? set estEnCours =0;",( idContrat) )
|
self.dateDebut,
|
||||||
|
self.dateFin))
|
||||||
|
idContrat = int(''.join(map(str, indContrat)))
|
||||||
|
connection.cur.execute("Update contrat where idContrat=? set estEnCours =0;", ( idContrat))
|
||||||
connection.seDeconnecter()
|
connection.seDeconnecter()
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
from src.m.Service import Service
|
from src.m.Service import Service
|
||||||
from src.m.connexionBDD import connexionBDD
|
from src.m.connexionBDD import connexionBDD
|
||||||
|
|
||||||
|
|
||||||
class Entretien(Service):
|
class Entretien(Service):
|
||||||
def __init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport, categorie, idClient):
|
def __init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport,
|
||||||
super(Service, self).__init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport, categorie)
|
categorie, idClient):
|
||||||
|
super(Service, self).__init__(self, jourService, moisService, anneeService, jourDemande, moisDemande,
|
||||||
|
anneeDemande, rapport, categorie)
|
||||||
self.categorie = 2
|
self.categorie = 2
|
||||||
self.etat = 0
|
self.etat = 0
|
||||||
self.idService=self.enregistrerService(self,idClient,self.categorie,self.etat)
|
self.idService = self.enregistrerService(self, idClient, self.categorie, self.etat)
|
||||||
def effectuerEntretien(self):
|
|
||||||
|
|
||||||
|
def effectuerEntretien(self):
|
||||||
self.etat = 1
|
self.etat = 1
|
||||||
connexion = connexionBDD()
|
connexion = connexionBDD()
|
||||||
connexion.cur.execute("UPDATE service SET etat= 1 WHERE idService = ?", (self.idService))
|
connexion.cur.execute("UPDATE service SET etat= 1 WHERE idService = ?", (self.idService))
|
||||||
|
@ -2,6 +2,7 @@ from src.m.TypePlace import TypePlace
|
|||||||
|
|
||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
|
|
||||||
class ListeTypePlace:
|
class ListeTypePlace:
|
||||||
"""
|
"""
|
||||||
Classe qui permet de définir une liste de type de place par niveau pour la création d'un parking
|
Classe qui permet de définir une liste de type de place par niveau pour la création d'un parking
|
||||||
|
@ -1,17 +1,23 @@
|
|||||||
|
import calendar
|
||||||
|
|
||||||
from src.m.Service import Service
|
from src.m.Service import Service
|
||||||
from src.m.connexionBDD import connexionBDD
|
from src.m.connexionBDD import connexionBDD
|
||||||
import calendar
|
|
||||||
|
|
||||||
class Livraison(Service):
|
class Livraison(Service):
|
||||||
def __init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport, categorie, idClient):
|
def __init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport,
|
||||||
super(Service, self).__init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport, categorie)
|
categorie, idClient):
|
||||||
|
super(Service, self).__init__(self, jourService, moisService, anneeService, jourDemande, moisDemande,
|
||||||
|
anneeDemande, rapport, categorie)
|
||||||
self.categorie = 3
|
self.categorie = 3
|
||||||
self.etat = 0
|
self.etat = 0
|
||||||
#3.Obtenir l'idVoiturier: en recherchant celui qui est disponible le jour en question
|
# 3.Obtenir l'idVoiturier: en recherchant celui qui est disponible le jour en question
|
||||||
self.idService=self.enregistrerService(self, idClient, self.categorie, self.etat)
|
self.idService = self.enregistrerService(self, idClient, self.categorie, self.etat)
|
||||||
jour= calendar.weekday(self.dateService._day, self.dateService._month, self.dateService._year)
|
jour = calendar.weekday(self.dateService._day, self.dateService._month, self.dateService._year)
|
||||||
connexion = connexionBDD()
|
connexion = connexionBDD()
|
||||||
indiceVoiturier= connexion.cur.execute("SELECT voiturier.idVoiturier FROM voiturier WHERE voiturier.joursDisponible = ?; ", (jour) )
|
indiceVoiturier = connexion.cur.execute(
|
||||||
idVoiturier = int(''.join(map(str,indiceVoiturier )))
|
"SELECT voiturier.idVoiturier FROM voiturier WHERE voiturier.joursDisponible = ?; ", (jour))
|
||||||
|
idVoiturier = int(''.join(map(str, indiceVoiturier)))
|
||||||
connexion.cur.execute("UPDATE service SET idVoiturier= ? WHERE idService = ?", (idVoiturier, self.idService))
|
connexion.cur.execute("UPDATE service SET idVoiturier= ? WHERE idService = ?", (idVoiturier, self.idService))
|
||||||
connexion.seDeconnecter()
|
connexion.seDeconnecter()
|
||||||
|
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
from src.m.Service import Service
|
from src.m.Service import Service
|
||||||
from src.m.connexionBDD import connexionBDD
|
from src.m.connexionBDD import connexionBDD
|
||||||
|
|
||||||
|
|
||||||
class Maintenance(Service):
|
class Maintenance(Service):
|
||||||
def __init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport, categorie, idClient):
|
def __init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport,
|
||||||
super(Service, self).__init__(self, jourService, moisService, anneeService, jourDemande, moisDemande, anneeDemande, rapport, categorie)
|
categorie, idClient):
|
||||||
|
super(Service, self).__init__(self, jourService, moisService, anneeService, jourDemande, moisDemande,
|
||||||
|
anneeDemande, rapport, categorie)
|
||||||
self.categorie = 1
|
self.categorie = 1
|
||||||
self.etat = 0
|
self.etat = 0
|
||||||
self.idService=self.enregistrerService(self, idClient, self.categorie, self.etat)
|
self.idService = self.enregistrerService(self, idClient, self.categorie, self.etat)
|
||||||
|
|
||||||
def effectuerMaintenance(self):
|
def effectuerMaintenance(self):
|
||||||
self.etat = 1
|
self.etat = 1
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
|
|
||||||
from src.m.Place import Place
|
from src.m.Place import Place
|
||||||
|
|
||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
|
|
||||||
class Parking:
|
class Parking:
|
||||||
"""
|
"""
|
||||||
Definie un parking
|
Definie un parking
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, typePlaces, nom):
|
def __init__(self, typePlaces, nom):
|
||||||
"""
|
"""
|
||||||
Creer objet parking
|
Creer objet parking
|
||||||
@ -50,7 +51,7 @@ class Parking:
|
|||||||
"""
|
"""
|
||||||
place = None
|
place = None
|
||||||
for p in self.__Places:
|
for p in self.__Places:
|
||||||
if p.estLibre and p.dimValide(voiture.getHauteur, voiture.getLongueur) :
|
if p.estLibre and p.dimValide(voiture.getHauteur, voiture.getLongueur):
|
||||||
pass
|
pass
|
||||||
place = p
|
place = p
|
||||||
break
|
break
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
import datetime
|
|
||||||
import random
|
|
||||||
import string
|
|
||||||
|
|
||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
|
|
||||||
@ -9,7 +5,8 @@ class Place:
|
|||||||
"""
|
"""
|
||||||
Representation d'une place
|
Representation d'une place
|
||||||
"""
|
"""
|
||||||
def __init__(self, numero, niveau, longueur,hauteur):
|
|
||||||
|
def __init__(self, numero, niveau, longueur, hauteur):
|
||||||
"""
|
"""
|
||||||
Creer une place.
|
Creer une place.
|
||||||
Les dimensions doivent etre données en cm (longueur, hauteur)
|
Les dimensions doivent etre données en cm (longueur, hauteur)
|
||||||
|
@ -4,17 +4,20 @@ import string
|
|||||||
|
|
||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
|
|
||||||
class Placement:
|
class Placement:
|
||||||
placements = []
|
placements = []
|
||||||
def __init__(self,voiture, place):
|
|
||||||
|
def __init__(self, voiture, place):
|
||||||
"""
|
"""
|
||||||
Creer un placement
|
Creer un placement
|
||||||
:param voiture: Voiture
|
:param voiture: Voiture
|
||||||
:param place: Place
|
:param place: Place
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
while True :
|
while True:
|
||||||
id =''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(random.randint(1,10)))
|
id = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in
|
||||||
|
range(random.randint(1, 10)))
|
||||||
if Placement.get(id) is None:
|
if Placement.get(id) is None:
|
||||||
break
|
break
|
||||||
self.__id = id
|
self.__id = id
|
||||||
|
@ -24,7 +24,7 @@ class Service:
|
|||||||
connection = connexionBDD()
|
connection = connexionBDD()
|
||||||
# 1.obtenir id service (fonction max de sqlite ne marche pas bien...elle ne prend en compte que le premier chiffre. Ex: max(56,9)= 9... )
|
# 1.obtenir id service (fonction max de sqlite ne marche pas bien...elle ne prend en compte que le premier chiffre. Ex: max(56,9)= 9... )
|
||||||
connection.cur.execute("SELECT count(service.idSercice) FROM service;")
|
connection.cur.execute("SELECT count(service.idSercice) FROM service;")
|
||||||
#entrée dans la base de donnée
|
# entrée dans la base de donnée
|
||||||
indiceidSer = connection.cur.execute("SELECT count(service.idService) FROM service;")
|
indiceidSer = connection.cur.execute("SELECT count(service.idService) FROM service;")
|
||||||
idService = int(''.join(map(str, indiceidSer))) + 1
|
idService = int(''.join(map(str, indiceidSer))) + 1
|
||||||
#2. obtenir l'idClient: définir une variable globale lors de l'execution du "jeu"
|
#2. obtenir l'idClient: définir une variable globale lors de l'execution du "jeu"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
class TypeAbonnement :
|
|
||||||
|
class TypeAbonnement:
|
||||||
ABONNE = 0
|
ABONNE = 0
|
||||||
SUPER_ABONNE = 1
|
SUPER_ABONNE = 1
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
|
|
||||||
class TypePlace:
|
class TypePlace:
|
||||||
"""
|
"""
|
||||||
Classe qui permet de définir un type de place
|
Classe qui permet de définir un type de place
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, h, l, nb):
|
def __init__(self, h, l, nb):
|
||||||
self.__hauteur = h
|
self.__hauteur = h
|
||||||
self.__longueur = l
|
self.__longueur = l
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
class Voiture():
|
class Voiture():
|
||||||
def __init__(self, longueur, hauteur, imma):
|
def __init__(self, longueur, hauteur, imma):
|
||||||
self._hauteur = hauteur
|
self._hauteur = hauteur
|
||||||
@ -23,6 +21,6 @@ class Voiture():
|
|||||||
def estDansParking(self):
|
def estDansParking(self):
|
||||||
return self._estDansParking == True
|
return self._estDansParking == True
|
||||||
|
|
||||||
#def addPlacement(self, placement):
|
# def addPlacement(self, placement):
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,23 +1,28 @@
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from src.m.connexionBDD import connexionBDD
|
from src.m.connexionBDD import connexionBDD
|
||||||
|
|
||||||
|
|
||||||
class Voiturier:
|
class Voiturier:
|
||||||
def __init__(self, id, nom, prenom):
|
def __init__(self, id, nom, prenom):
|
||||||
self.numero= id
|
self.numero = id
|
||||||
self.nom = nom
|
self.nom = nom
|
||||||
self.prenom = prenom
|
self.prenom = prenom
|
||||||
|
|
||||||
def enregistrerVoiturier(self, nom, prenom, dateEmbauche):
|
def enregistrerVoiturier(self, nom, prenom, dateEmbauche):
|
||||||
connexion = connexionBDD()
|
connexion = connexionBDD()
|
||||||
#entrée dans la base de donnée
|
# entrée dans la base de donnée
|
||||||
indiceidVoiturier= connexion.cur.execute("SELECT count(voiturier.idVoiturier) FROM voiturier;")+1
|
indiceidVoiturier = connexion.cur.execute("SELECT count(voiturier.idVoiturier) FROM voiturier;") + 1
|
||||||
idVoiturier = int(''.join(map(str,indiceidVoiturier))) +1
|
idVoiturier = int(''.join(map(str, indiceidVoiturier))) + 1
|
||||||
connexion.cur.execute("INSERT INTO voiturier (idVoiturier,nom, prenom, dateEmbauche) VALUES (?,?,?,?);",(self.idVoiturier,nom, prenom, dateEmbauche) )
|
connexion.cur.execute("INSERT INTO voiturier (idVoiturier,nom, prenom, dateEmbauche) VALUES (?,?,?,?);",
|
||||||
|
(self.idVoiturier, nom, prenom, dateEmbauche))
|
||||||
connexion.seDeconnecter()
|
connexion.seDeconnecter()
|
||||||
|
|
||||||
def livrerVoiture(self):
|
def livrerVoiture(self):
|
||||||
dateJour = time.strptime()
|
dateJour = time.strptime()
|
||||||
connexion = connexionBDD()
|
connexion = connexionBDD()
|
||||||
indiceLivraison= connexion.cur.execute("SELECT count(voiturier.idVoiturier) FROM voiturier;")
|
indiceLivraison = connexion.cur.execute("SELECT count(voiturier.idVoiturier) FROM voiturier;")
|
||||||
idLivraison= int(''.join(map(str,indiceLivraison))) +1
|
idLivraison = int(''.join(map(str, indiceLivraison))) + 1
|
||||||
connexion.cur.execute("INSERT INTO livraison (idLivraison,dateLivraison, idVoiturier) VALUES (?,?,?,?);",(idLivraison, dateJour, self.idVoiturier) )
|
connexion.cur.execute("INSERT INTO livraison (idLivraison,dateLivraison, idVoiturier) VALUES (?,?,?,?);",
|
||||||
|
(idLivraison, dateJour, self.idVoiturier))
|
||||||
connexion.seDeconnecter()
|
connexion.seDeconnecter()
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
|
|
||||||
class connexionBDD:
|
class connexionBDD:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.chemin = "BDDprojetPython.sq3"
|
self.chemin = "BDDprojetPython.sq3"
|
||||||
self.conn =sqlite3.connect(self.chemin)
|
self.conn = sqlite3.connect(self.chemin)
|
||||||
self.cur =self.conn.cursor()
|
self.cur = self.conn.cursor()
|
||||||
|
|
||||||
def seDeconnecter(self):
|
def seDeconnecter(self):
|
||||||
self.cur.close()
|
self.cur.close()
|
||||||
self.conn.close()
|
self.conn.close()
|
@ -1,11 +1,11 @@
|
|||||||
__author__ = 'nadiel'
|
__author__ = 'nadiel'
|
||||||
|
|
||||||
import nose
|
|
||||||
class testClient :
|
class testClient:
|
||||||
#def testsAbonner:
|
# def testsAbonner:
|
||||||
|
|
||||||
def testnouvelleVoiture(self):
|
def testnouvelleVoiture(self):
|
||||||
assert()
|
assert ()
|
||||||
#v = Voiture()
|
#v = Voiture()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
class testService:
|
class testService:
|
||||||
"""Fonction qui vérifie si la date insérée cest dans un format correcte (année est égale à l'année courante, 01≤jour≤31 et 01≤mois≤12); renvoie une erreur sinon"""
|
"""Fonction qui vérifie si la date insérée cest dans un format correcte (année est égale à l'année courante, 01≤jour≤31 et 01≤mois≤12); renvoie une erreur sinon"""
|
||||||
def testFormatDate(self, jourInsere, moisInsere, anneeInsere):
|
|
||||||
|
|
||||||
|
def testFormatDate(self, jourInsere, moisInsere, anneeInsere):
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from src.m.Voiture import Voiture
|
from src.m.Voiture import Voiture
|
||||||
|
|
||||||
|
|
||||||
__author__ = 'sidya'
|
__author__ = 'sidya'
|
||||||
|
|
||||||
|
|
||||||
class Camera:
|
class Camera:
|
||||||
@classmethod
|
@classmethod
|
||||||
def donnerVoiture(self):
|
def donnerVoiture(self):
|
||||||
v = Voiture(random.randint(150,300),random.randint(100,200), ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(random.randint(1,10))))
|
v = Voiture(random.randint(150, 300), random.randint(100, 200), ''.join(
|
||||||
|
random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in
|
||||||
|
range(random.randint(1, 10))))
|
||||||
return v
|
return v
|
||||||
|
@ -17,12 +17,14 @@ except AttributeError:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||||
|
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QtGui.QApplication.translate(context, text, disambig)
|
return QtGui.QApplication.translate(context, text, disambig)
|
||||||
|
|
||||||
|
|
||||||
class Ui_Borne(object):
|
class Ui_Borne(object):
|
||||||
def setupUi(self, Borne):
|
def setupUi(self, Borne):
|
||||||
Borne.setObjectName(_fromUtf8("Borne"))
|
Borne.setObjectName(_fromUtf8("Borne"))
|
||||||
@ -151,7 +153,8 @@ class Ui_Borne(object):
|
|||||||
self.box_recup.setTitle(_translate("Borne", "Récuperer", None))
|
self.box_recup.setTitle(_translate("Borne", "Récuperer", None))
|
||||||
self.numeroTicketLabel.setText(_translate("Borne", "Numero Ticket :", None))
|
self.numeroTicketLabel.setText(_translate("Borne", "Numero Ticket :", None))
|
||||||
self.btn_recuperer.setText(_translate("Borne", "Récupérer Véhicule", None))
|
self.btn_recuperer.setText(_translate("Borne", "Récupérer Véhicule", None))
|
||||||
self.label_aff.setText(_translate("Borne", "<html><head/><body><p align=\"center\">TextLabel</p></body></html>", None))
|
self.label_aff.setText(
|
||||||
|
_translate("Borne", "<html><head/><body><p align=\"center\">TextLabel</p></body></html>", None))
|
||||||
self.box_garer.setTitle(_translate("Borne", "Se garer", None))
|
self.box_garer.setTitle(_translate("Borne", "Se garer", None))
|
||||||
self.btn_garer.setText(_translate("Borne", "Garer Véhicule", None))
|
self.btn_garer.setText(_translate("Borne", "Garer Véhicule", None))
|
||||||
self.btn_annuler.setText(_translate("Borne", "Annuler", None))
|
self.btn_annuler.setText(_translate("Borne", "Annuler", None))
|
||||||
|
@ -17,12 +17,14 @@ except AttributeError:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||||
|
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QtGui.QApplication.translate(context, text, disambig)
|
return QtGui.QApplication.translate(context, text, disambig)
|
||||||
|
|
||||||
|
|
||||||
class Ui_MainWindow(object):
|
class Ui_MainWindow(object):
|
||||||
def setupUi(self, MainWindow):
|
def setupUi(self, MainWindow):
|
||||||
MainWindow.setObjectName(_fromUtf8("MainWindow"))
|
MainWindow.setObjectName(_fromUtf8("MainWindow"))
|
||||||
|
Reference in New Issue
Block a user