def Modifier(self, event): if self.IDfamille != None and UTILS_Utilisateurs.VerificationDroitsUtilisateurActuel( "familles_mandats", "modifier") == False: return if len(self.Selection()) == 0: dlg = wx.MessageDialog( self, _(u"Vous n'avez sélectionné aucun mandat à modifier dans la liste !" ), _(u"Erreur de saisie"), wx.OK | wx.ICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() return track = self.Selection()[0] if track.nbrePrelevements > 0: dlg = wx.MessageDialog( self, _(u"Ce mandat a déjà été utilisé pour %d prélèvements. Souhaitez-vous tout de même l'ouvrir ?\n\nAttention, il est déconseillé de modifier un mandat déjà utilisé." ) % track.nbrePrelevements, _(u"Avertissement"), wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_EXCLAMATION) reponse = dlg.ShowModal() dlg.Destroy() if reponse != wx.ID_YES: return from Dlg import DLG_Saisie_mandat dlg = DLG_Saisie_mandat.Dialog(self, IDfamille=track.IDfamille, IDmandat=track.IDmandat) if dlg.ShowModal() == wx.ID_OK: self.MAJ(track.IDmandat) dlg.Destroy()
def Ajouter(self, event): if self.IDfamille != None and UTILS_Utilisateurs.VerificationDroitsUtilisateurActuel( "familles_mandats", "creer") == False: return from Dlg import DLG_Saisie_mandat dlg = DLG_Saisie_mandat.Dialog(self, IDfamille=self.IDfamille, IDmandat=None) if dlg.ShowModal() == wx.ID_OK: IDmandat = dlg.GetIDmandat() self.MAJ(IDmandat) dlg.Destroy()