@Override public void remove(ar.com.dcsys.data.person.MailChange change) { mailChangesManager.remove( change, new Receiver<String>() { @Override public void onSuccess(String t) { updateMailsFromPerson(); } @Override public void onFailure(Throwable t) { showMessage(t.getMessage()); } }); }
@Override public void persist() { final String mailChangeText = view.getMail(); final String mailChangeTextRepeat = view.getMailRepeat(); if (mailChangeText == null && (mailChangeText.trim().equals(""))) { showMessage("Error: El email no puede estar vacio"); return; } if (!mailChangeText.equals(mailChangeTextRepeat.trim())) { showMessage("Error: Los emails no coinciden"); return; } if (loggedPerson == null) { showMessage("No se ha podido encontrar la persona logueada en el sistema"); return; } Mail mail = personFactory.mail().as(); mail.setMail(mailChangeText); ar.com.dcsys.data.person.MailChange mailChange = personFactory.mailChange().as(); mailChange.setMail(mail); mailChange.setConfirmed(false); mailChange.setToken(null); mailChangesManager.persist( mailChange, loggedPerson, new Receiver<String>() { @Override public void onSuccess(String mailChangeId) { updateMailsFromPerson(); } @Override public void onFailure(Throwable t) { showMessage(t.getMessage()); } }); }