예제 #1
0
파일: interface.py 프로젝트: PeregHer/IKEO
    def afficher_produits(self):
        for widget in self.frame_menu.winfo_children():
            widget.pack_forget()

        produits_frame = tk.Frame(self.frame_menu, bg=color_ids['Bleu'])
        produits_frame.pack()

        produits_site = Connexion.get_produits()

        produit_label = tk.Label(produits_frame, text="Produits", bg=color_ids['Bleu'], font=(
            'Helvetica', '20', 'underline'))
        sites_label = tk.Label(produits_frame, text="Sites", bg=color_ids['Bleu'], font=(
            'Helvetica', '20', 'underline'))

        produit_label.grid(row=0, column=0, padx=50)
        sites_label.grid(row=0, column=1, padx=50)

        for i, (key, value) in enumerate(produits_site.items(), 1):
            produit = tk.Label(produits_frame, text=key,
                               bg=color_ids['Bleu'], font=('Helvetica', '12'))
            produit.grid(row=i, column=0)

            sites = tk.Label(produits_frame, text=value,
                             bg=color_ids['Bleu'], font=('Helvetica', '12'))
            sites.grid(row=i, column=1)
예제 #2
0
파일: interface.py 프로젝트: PeregHer/IKEO
    def saisir_facture(self):
            for widget in self.frame_menu.winfo_children():
                widget.pack_forget()        
            
            def valider():
                #date du jour                
                Connexion.saisie_facture(self.entree_date.get(), self.entree_client.get(), self.entree_facture.get(), self.entree_produit.get(), self.entree_quantite.get())
                        
            self.entrees_frame = tk.Frame(self.frame_menu, bg=color_ids['Bleu'])
            self.entrees_frame.pack()

            self.facture_frame = tk.Frame(self.frame_menu, bg=color_ids['Bleu'])
            self.facture_frame.pack()

            self.entree_facture = ttk.Combobox(self.entrees_frame, values=list(Connexion.lister_factures()), state="normal")
            self.entree_facture.grid(row = 0 , column = 0, padx=20, pady=30)

            self.entree_client = ttk.Combobox(self.entrees_frame, values=list(Connexion.get_clients()), state="readonly")
            self.entree_client.grid(row = 0 , column = 1, padx=20, pady=30)

            self.entree_produit = ttk.Combobox(self.entrees_frame, values=list(Connexion.get_produits()), state="readonly")
            self.entree_produit.grid(row = 0 , column = 2, padx=20, pady=30)

            self.entree_quantite = tk.Entry(self.entrees_frame, bg='white', width=20, justify='center', font=('Helvetica', '10'))
            self.entree_quantite.grid(row = 0 , column = 3, padx=20, pady=30)
            
            self.entree_date = tk.Entry(self.entrees_frame, bg='white', width=20, justify='center', font=('Helvetica', '10'))
            self.entree_date.grid(row = 0 , column = 4, padx=20, pady=30)
            self.now = datetime.date.today() 
            self.date_facture = self.now.strftime("%Y-%m-%d")
            self.entree_date.insert(0, self.date_facture)

            self.boutton_factures = tk.Button(self.entrees_frame, height=2, width=13, bg=color_ids['Jaune'], bd=0, font=('Helvetica', '11'), text="Valider", command=valider)
            self.boutton_factures.grid(row = 0 , column = 5, padx=20, pady=30)