Пример #1
0
    def get_ent_jur_list(self):

        #DB CONNECTION
        db = MyDB()
        #Execute la requete SQL
        get_all_legal_entities_query = "SELECT *FROM EntiteJuridique;"

        try:
            db.query(get_all_legal_entities_query,[])
            db.commit()
        except:
            db.rollback()
        #On obtient une matrice
        legal_entities_data = db.db_fetchall()

        # Liste d'entite Juridique
        data_ent_jur = ListEntJur(legal_entities_data)
        
        return data_ent_jur
Пример #2
0
    def get_location_list(self):

        #DB CONNECTION
        db = MyDB()
        #Execute la requete SQL
        get_all_location_query = "SELECT * FROM Location;"

        try:
            db.query(get_all_location_query,[])

            db.commit()
        except:
            db.rollback()
        #On obtient une matrice
        location_data = db.db_fetchall()

        # Liste d'entite Juridique
        data_location = ListLocationFromFetch(location_data)
        
        return data_location
Пример #3
0
    def check_login(self, *args):
        user_login = self.login_box.text
        user_password = self.password_box.text


        # DB CONNECTION
        db = MyDB()

        login_query = "SELECT * FROM utilisateur WHERE login =%s AND password = %s"

        parameters_query =[user_login,user_password]

        try:
            db.query(login_query,parameters_query)
            db.commit()
        except:
            db.rollback()

        login_data = db.db_fetchall()

        if login_data:

            user_logged = User(user_login)
            self.dispatch('on_right_id')


        else:
            self.login_box.focus = True
            self.remove_widget(self.pan_screen)
            self.error_box.text = "Wrong credentials"
            # create an animation object. This object could be stored
            # and reused each call or reused across different widgets.
            # += is a sequential step, while &= is in parallel
            animation = Animation(x=(0), t='out_bounce')

            # apply the animation on the button, passed in the "instance" argument
            # Notice that default 'click' animation (changing the button
            # color while the mouse is down) is unchanged.
            animation.start(self.login_area)
Пример #4
0
    def get_module_available(self):

                ###################Looking into Module#####################

        #DB CONNECTION

        db = MyDB()

        modules_query = """SELECT m.intitule, o.intitule
                        FROM module AS m , outil AS o, utilisateur AS u, utilisateuroutil AS uo
                        WHERE u.login =%s AND uo.idUtilisateur = u.idUtilisateur
                        AND uo.idOutil = o.idOutil AND o.idModule = m.idModule"""

        user_logged = User()
        parameters_query =[user_logged.login]
        try:
            db.query(modules_query,parameters_query)
            db.commit()
        except:
            db.rollback()
            
        modules_data = db.db_fetchall()

        return modules_data