Search in sources :

Example 6 with CustomerGenerator

use of eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator in project dwoss by gg-net.

the class AddressUpdateTryout method main.

public static void main(String[] args) {
    CustomerGenerator gen = new CustomerGenerator();
    Address address = gen.makeAddress();
    JButton close = new JButton("Schliessen");
    close.addActionListener(e -> Ui.closeWindowOf(close));
    JButton editButton = new JButton("Edit");
    editButton.addActionListener(ev -> {
        if (address.getViolationMessage() != null) {
            System.out.println("Address ViolationMessages: " + address.getViolationMessage());
        }
        Ui.exec(() -> {
            Ui.build().fxml().eval(() -> address, AddressUpdateController.class).opt().ifPresent(System.out::println);
        });
    });
    JButton addButton = new JButton("Add");
    addButton.addActionListener(ev -> {
        Ui.exec(() -> {
            Ui.build().fxml().eval(() -> new Address(), AddressUpdateController.class).opt().ifPresent(System.out::println);
        });
    });
    JPanel p = new JPanel();
    p.add(editButton);
    p.add(addButton);
    p.add(close);
    UiCore.startSwing(() -> p);
}
Also used : JPanel(javax.swing.JPanel) Address(eu.ggnet.dwoss.customer.ee.entity.Address) JButton(javax.swing.JButton) CustomerGenerator(eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator)

Example 7 with CustomerGenerator

use of eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator in project dwoss by gg-net.

the class CustomerEnhanceTryout method main.

public static void main(String[] args) {
    CustomerGenerator gen = new CustomerGenerator();
    JButton close = new JButton("Schliessen");
    close.addActionListener(e -> Ui.closeWindowOf(close));
    JButton firmenKundenButton = new JButton("Lade FirmenKunde");
    firmenKundenButton.addActionListener(ev -> {
        Customer customer = gen.makeCustomer();
        customer.getContacts().clear();
        customer.getCompanies().add(gen.makeCompany());
        customer.getCompanies().add(gen.makeCompany());
        customer.getCompanies().add(gen.makeCompany());
        customer.getCompanies().add(gen.makeCompany());
        customer.setSource(Source.ONEADO);
        customer.setKeyAccounter("Herr Meier");
        customer.getFlags().add(CustomerFlag.ITC_CUSTOMER);
        customer.getFlags().add(CustomerFlag.CS_UPDATE_CANDIDATE);
        customer.getAdditionalCustomerIds().put(ExternalSystem.SAGE, "testsage");
        if (customer.getViolationMessage() != null) {
            Ui.exec(() -> {
                Ui.build().alert("customer is invalid" + customer.getViolationMessage());
            });
            return;
        }
        customer.getAddressLabels().add(new AddressLabel(gen.makeCompany(), null, gen.makeAddress(), AddressType.SHIPPING));
        Ui.exec(() -> {
            Ui.build().fxml().eval(() -> customer, CustomerEnhanceController.class).opt().ifPresent(System.out::println);
        });
    });
    JButton endKundenButton = new JButton("Lade Endkunde");
    endKundenButton.addActionListener(ev -> {
        Customer customer = gen.makeCustomer();
        customer.getCompanies().clear();
        customer.getContacts().add(gen.makeContact());
        customer.getContacts().add(gen.makeContact());
        customer.getContacts().add(gen.makeContact());
        customer.getContacts().add(gen.makeContact());
        customer.setSource(Source.ONEADO);
        customer.getFlags().add(CustomerFlag.ITC_CUSTOMER);
        customer.getFlags().add(CustomerFlag.CS_UPDATE_CANDIDATE);
        customer.getAdditionalCustomerIds().put(ExternalSystem.SAGE, "testsage");
        if (customer.getViolationMessage() != null) {
            Ui.exec(() -> {
                Ui.build().alert("customer is invalid" + customer.getViolationMessage());
            });
            return;
        }
        Ui.exec(() -> {
            Ui.build().fxml().eval(() -> customer, CustomerEnhanceController.class).opt().ifPresent(System.out::println);
        });
    });
    JPanel p = new JPanel();
    p.add(endKundenButton);
    p.add(firmenKundenButton);
    p.add(close);
    UiCore.startSwing(() -> p);
}
Also used : JPanel(javax.swing.JPanel) Customer(eu.ggnet.dwoss.customer.ee.entity.Customer) AddressLabel(eu.ggnet.dwoss.customer.ee.entity.projection.AddressLabel) JButton(javax.swing.JButton) CustomerGenerator(eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator)

Example 8 with CustomerGenerator

use of eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator in project dwoss by gg-net.

the class MandatorMetaDataTryOut method randomTryOut.

private static void randomTryOut() {
    CustomerGenerator gen = new CustomerGenerator();
    MandatorMetadata mData = gen.makeMandatorMetadata();
    Ui.exec(() -> {
        Ui.build().fxml().eval(() -> mData, MandatorMetaDataController.class);
    });
}
Also used : MandatorMetadata(eu.ggnet.dwoss.customer.ee.entity.MandatorMetadata) CustomerGenerator(eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator)

Example 9 with CustomerGenerator

use of eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator in project dwoss by gg-net.

the class CustomerExporterTryout method main.

public static void main(String[] args) throws IOException, InterruptedException {
    CustomerGenerator gen = new CustomerGenerator();
    FileJacket fj = CustomerExporterOperation.toXls(IntStream.range(0, 40).mapToObj(i -> gen.makeOldCustomer()).collect(Collectors.toList()));
    Desktop.getDesktop().open(fj.toTemporaryFile());
    Thread.sleep(6000);
}
Also used : CustomerGenerator(eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator) FileJacket(eu.ggnet.dwoss.util.FileJacket)

Aggregations

CustomerGenerator (eu.ggnet.dwoss.customer.ee.assist.gen.CustomerGenerator)9 JButton (javax.swing.JButton)5 JPanel (javax.swing.JPanel)5 Customer (eu.ggnet.dwoss.customer.ee.entity.Customer)3 MandatorMetadata (eu.ggnet.dwoss.customer.ee.entity.MandatorMetadata)3 DefaultCustomerSalesdata (eu.ggnet.dwoss.mandator.api.value.DefaultCustomerSalesdata)2 Address (eu.ggnet.dwoss.customer.ee.entity.Address)1 Company (eu.ggnet.dwoss.customer.ee.entity.Company)1 Contact (eu.ggnet.dwoss.customer.ee.entity.Contact)1 AddressLabel (eu.ggnet.dwoss.customer.ee.entity.projection.AddressLabel)1 OldCustomer (eu.ggnet.dwoss.customer.ee.priv.OldCustomer)1 FileJacket (eu.ggnet.dwoss.util.FileJacket)1 Random (java.util.Random)1 InvalidationListener (javafx.beans.InvalidationListener)1 Scene (javafx.scene.Scene)1 BorderPane (javafx.scene.layout.BorderPane)1 WebView (javafx.scene.web.WebView)1