Exemplo n.º 1
0
 def update_category(self):
     if self.category.get() != '':
         category = self.category.get()
         iid = self.iid
         col = [
             'name',
         ]
         query = fn.updateBD('category', col)
         parameters = (category, iid)
         fn.run_query(query, parameters)
         messagebox.showinfo(title='Exito',
                             message='La categoria ha sido actualizada')
         self.master.destroy()
Exemplo n.º 2
0
    def update_bank_acount(self):
        iid = self.tree.item(self.tree.selection())['text']
        col = ['name', 'cbu', 'balance']
        query = fn.updateBD('bankacount', iid, col)

        num = self.number.get()
        cbu = self.cbu.get()
        balance = self.balance.get()

        parameters = (num, cbu, balance, iid)
        fn.run_query(query, parameters)

        self.get_bank_acount()
        self.disable_edit()
Exemplo n.º 3
0
    def update_expense(self):
        if self.name.get() != '' and self.category.get() != '':
            name = self.name.get()
            iid= fn.get_id('expenses', name)
            category = fn.get_id('category', self.category.get())
            col = ['name', 'id_category']
            query = fn.updateBD('expenses', col)
            parameters = [name, category, iid]

            fn.run_query(query, parameters)
            messagebox.showinfo(title = 'Éxito', message = 'La subcategoria a sido actualizada con exito', parent = self.master)
            self.close_edit_expenses()
        else:
            messagebox.showwarning(title = 'Atención!!!', message = 'Las entradas no pueden estar vacias')
Exemplo n.º 4
0
    def update_card(self):
        name = self.name.get()
        deadline = self.deadline.get()
        duedate = self.duedate.get()
        balance = self.balance.get()

        if name != '' and deadline != '' and duedate != '' and balance != '':
            iid = fn.get_id('creditcards', name)
            col = ['name', 'deadline', 'duedate', 'balance']
            query = fn.updateBD('creditcards', col)
            parameters = (name, deadline, duedate, balance, iid)
            fn.run_query(query, parameters)
            self.close_edit_card()
        else:
            messagebox.showerror(title='Error',
                                 message='No puede haber ningun dato vacio')
Exemplo n.º 5
0
    def update_cards(self):
        if fn.validateDateFormat(
                self.deadline.get()) and fn.validateDateFormat(
                    self.duedate.get()):
            iid = self.item('id')
            col = ['name', 'deadline', 'duedate', 'balance']
            query = fn.updateBD('creditcards', col)

            name = self.name.get()
            deadline = self.deadline.get()
            duedate = self.duedate.get()
            balance = self.balance.get()

            parameters = (name, deadline, duedate, balance, iid)
            fn.run_query(query, parameters)

            self.get_cards()
            # self.tree.selection_remove()
            self.disable_edit()
        else:
            messagebox.showerror(
                title='formato invalido',
                message='La fecha debe tener el formato aaaa-mm-dd')