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);
}
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);
}
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);
});
}
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);
}
Aggregations