Search in sources :

Example 1 with InvoiceAddressLabelWithNullableShippingAddressLabel

use of eu.ggnet.dwoss.customer.ui.neo.PreferedAddressLabelsController.InvoiceAddressLabelWithNullableShippingAddressLabel in project dwoss by gg-net.

the class PreferedAddressLabelsController method handleSaveButtonAction.

@FXML
private void handleSaveButtonAction(ActionEvent event) {
    Company invoiceLabelCompany = invoiceAddressCompanyListView.getSelectionModel().getSelectedItem();
    Contact invoiceLabelContact = invoiceAddressContactListView.getSelectionModel().getSelectedItem();
    Address invoiceLabelAddress = invoiceAddressAddressListView.getSelectionModel().getSelectedItem();
    AddressLabel invoiceLabel = new AddressLabel(invoiceLabelCompany, invoiceLabelContact, invoiceLabelAddress, AddressType.INVOICE);
    Address shippingAddress = shippingAddressAddressListView.getSelectionModel().getSelectedItem();
    Company shippingLabelCompany = shippingAddressCompanyListView.getSelectionModel().getSelectedItem();
    Contact shippingLabelContact = shippingAddressContactListView.getSelectionModel().getSelectedItem();
    AddressLabel shippingLabel;
    if (shippingAddress == null || (shippingLabelCompany == null && shippingLabelContact == null))
        shippingLabel = null;
    else
        shippingLabel = new AddressLabel(shippingLabelCompany, invoiceLabelContact, shippingAddress, SHIPPING);
    this.resultAdressLabel = new InvoiceAddressLabelWithNullableShippingAddressLabel(shippingLabel, invoiceLabel);
    Ui.closeWindowOf(saveButton);
}
Also used : AddressLabel(eu.ggnet.dwoss.customer.ee.entity.projection.AddressLabel) InvoiceAddressLabelWithNullableShippingAddressLabel(eu.ggnet.dwoss.customer.ui.neo.PreferedAddressLabelsController.InvoiceAddressLabelWithNullableShippingAddressLabel) InvoiceAddressLabelWithNullableShippingAddressLabel(eu.ggnet.dwoss.customer.ui.neo.PreferedAddressLabelsController.InvoiceAddressLabelWithNullableShippingAddressLabel) FXML(javafx.fxml.FXML)

Aggregations

AddressLabel (eu.ggnet.dwoss.customer.ee.entity.projection.AddressLabel)1 InvoiceAddressLabelWithNullableShippingAddressLabel (eu.ggnet.dwoss.customer.ui.neo.PreferedAddressLabelsController.InvoiceAddressLabelWithNullableShippingAddressLabel)1 FXML (javafx.fxml.FXML)1