Search in sources :

Example 1 with Addresses

use of eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses in project dwoss by gg-net.

the class DossierCreateAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    Ui.exec(() -> {
        Dossier dos = Dl.remote().lookup(RedTapeWorker.class).create(customer.getId(), dispatch, Dl.local().lookup(Guardian.class).getUsername());
        // This is safe, as a create will return exactly one document.
        Document doc = dos.getDocuments().iterator().next();
        Addresses addresses = Dl.remote().lookup(RedTapeWorker.class).requestAdressesByCustomer(customer.getId());
        doc.setInvoiceAddress(addresses.getInvoice());
        doc.setShippingAddress(addresses.getShipping());
        Ui.exec(() -> {
            Ui.build().parent(controller.getView()).swing().eval(() -> {
                DocumentUpdateView docView = new DocumentUpdateView(doc);
                docView.setController(new DocumentUpdateController(docView, doc));
                docView.setCustomerValues(customer.getId());
                return OkCancelWrap.vetoResult(docView);
            }).opt().filter(r -> handleFailure(r, doc)).map(Reply::getPayload).ifPresent(this::handleSuccesses);
        });
    });
}
Also used : Addresses(eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses) DocumentUpdateController(eu.ggnet.dwoss.redtapext.ui.cao.document.DocumentUpdateController) DocumentUpdateView(eu.ggnet.dwoss.redtapext.ui.cao.document.DocumentUpdateView) Dossier(eu.ggnet.dwoss.redtape.ee.entity.Dossier) RedTapeWorker(eu.ggnet.dwoss.redtapext.ee.RedTapeWorker) Document(eu.ggnet.dwoss.redtape.ee.entity.Document)

Example 2 with Addresses

use of eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses in project dwoss by gg-net.

the class DocumentUpdateController method resetAddressesToCustomerData.

public void resetAddressesToCustomerData() {
    if (view.getCustomerId() <= 0) {
        JOptionPane.showMessageDialog(view, "Ein Kunde muss ausgewählt sein.");
        return;
    }
    Addresses addresses = Dl.remote().lookup(RedTapeWorker.class).requestAdressesByCustomer(view.getCustomerId());
    document.setInvoiceAddress(addresses.getInvoice());
    document.setShippingAddress(addresses.getShipping());
    view.refreshAddressArea();
}
Also used : Addresses(eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses) RedTapeWorker(eu.ggnet.dwoss.redtapext.ee.RedTapeWorker)

Example 3 with Addresses

use of eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses in project dwoss by gg-net.

the class DocumentSupporterFlagIT method changeInvoiceAddress.

private void changeInvoiceAddress(Document doc) {
    cgo.scrambleAddress(customerId, AddressType.INVOICE);
    Addresses addresses = redTapeWorker.requestAdressesByCustomer(customerId);
    doc.setInvoiceAddress(addresses.getInvoice());
}
Also used : Addresses(eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses)

Aggregations

Addresses (eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses)3 RedTapeWorker (eu.ggnet.dwoss.redtapext.ee.RedTapeWorker)2 Document (eu.ggnet.dwoss.redtape.ee.entity.Document)1 Dossier (eu.ggnet.dwoss.redtape.ee.entity.Dossier)1 DocumentUpdateController (eu.ggnet.dwoss.redtapext.ui.cao.document.DocumentUpdateController)1 DocumentUpdateView (eu.ggnet.dwoss.redtapext.ui.cao.document.DocumentUpdateView)1