use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class SpecListPanel method main.
// End of variables declaration//GEN-END:variables
public static void main(String[] args) {
SpecListController controller;
ProductProcessorStub stub = new ProductProcessorStub();
controller = new SpecListController(stub.getSpecAgentStub());
OkCancelDialog<SpecListPanel> panel = new OkCancelDialog<>("blub", new SpecListPanel(controller));
panel.setVisible(true);
System.exit(0);
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class SalesProductChooserCask method main.
// End of variables declaration//GEN-END:variables
public static void main(String[] args) {
SalesProduct salesProduct1 = new SalesProduct("AS.ASASD.ASD", "Test SalesProduct", 10D, 1, "SalesProduct Test Descritpion");
SalesProduct salesProduct2 = new SalesProduct("AS.1234.ASD", "Test SalesProduct2", 1D, 2, "SalesProduct Test Descritpion2");
List<SalesProduct> products = new ArrayList<>();
products.add(salesProduct1);
products.add(salesProduct2);
SalesProductChooserCask view = new SalesProductChooserCask(products);
OkCancelDialog<SalesProductChooserCask> dialog = new OkCancelDialog<>("Sample", view);
dialog.setVisible(true);
System.out.println(view.getProduct());
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class CreditMemoAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Calendar release = Calendar.getInstance();
release.setTime(doc.getHistory().getRelease());
Calendar beforeOneYear = Calendar.getInstance();
beforeOneYear.set(Calendar.YEAR, Calendar.getInstance().get(Calendar.YEAR) - 1);
if (beforeOneYear.after(release) && JOptionPane.CANCEL_OPTION == JOptionPane.showConfirmDialog(parent, "Der Vorgang ist über ein Jahr alt und die Garantie ist abgelaufen!\nMöchten sie fortfahren?", "Garantie Warnung", JOptionPane.OK_CANCEL_OPTION)) {
return;
}
List<AfterInvoicePosition> creditPositions = new ArrayList<>();
for (Position position : doc.getPositions().values()) {
if (position.getType() != PositionType.COMMENT)
creditPositions.add(new AfterInvoicePosition(position));
}
CreditMemoView view = new CreditMemoView(creditPositions);
OkCancelDialog<CreditMemoView> dialog = new OkCancelDialog<>("Test", view);
dialog.setLocationRelativeTo(parent);
dialog.setVisible(true);
if (dialog.getCloseType() == CloseType.OK) {
doc.removeAllPositions();
for (Position position : view.getPositions()) {
doc.append(position);
}
doc.setType(DocumentType.CREDIT_MEMO);
doc.setDirective(Directive.BALANCE_REPAYMENT);
Document d = Dl.remote().lookup(RedTapeWorker.class).update(doc, view.getStockLocation(), Dl.local().lookup(Guardian.class).getUsername());
controller.reloadSelectionOnStateChange(d.getDossier());
}
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class DefaultStateTransitionAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
// Invoice
if (((RedTapeStateTransition) transition).getHints().contains(RedTapeStateTransition.Hint.CREATES_INVOICE)) {
int confirmInvoice = JOptionPane.showOptionDialog(parent, "Eine Rechnung wird unwiederruflich erstellt. Möchten Sie fortfahren?", "Rechnungserstellung", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
if (confirmInvoice == JOptionPane.CANCEL_OPTION)
return;
}
// Cancel
if (((RedTapeStateTransition) transition).equals(RedTapeStateTransitions.CANCEL)) {
int confirmInvoice = JOptionPane.showOptionDialog(parent, "Der Vorgang wird storniert.\nMöchten Sie fortfahren?", "Abbrechen des Vorganges", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
if (confirmInvoice == JOptionPane.NO_OPTION)
return;
}
if (((RedTapeStateTransition) transition).getHints().contains(RedTapeStateTransition.Hint.ADDS_SETTLEMENT)) {
SettlementViewCask view = new SettlementViewCask();
OkCancelDialog<SettlementViewCask> dialog = new OkCancelDialog<>(parent, "Zahlung hinterlegen", view);
dialog.setVisible(true);
if (dialog.getCloseType() == CloseType.OK) {
for (Document.Settlement settlement : view.getSettlements()) {
cdoc.getDocument().add(settlement);
}
} else {
return;
}
}
if (((RedTapeStateTransition) transition).getHints().contains(RedTapeStateTransition.Hint.UNIT_LEAVES_STOCK)) {
for (Position p : cdoc.getDocument().getPositions(PositionType.PRODUCT_BATCH).values()) {
// TODO not the best but fastest solution for now, this must be changed later
if (StringUtils.isBlank(p.getRefurbishedId())) {
if (JOptionPane.showConfirmDialog(parent, "Der Vorgang enthält Neuware, wurden alle Seriennummern erfasst?", "Bitte verifizieren", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION)
return;
}
}
}
Optional.of(Dl.remote().lookup(RedTapeWorker.class).stateChange(cdoc, transition, Dl.local().lookup(Guardian.class).getUsername())).filter(Ui.failure()::handle).map(Reply::getPayload).map(Document::getDossier).ifPresent(d -> controller.reloadSelectionOnStateChange(d));
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class SalesProductUpdateCask method main.
// End of variables declaration//GEN-END:variables
public static void main(String[] args) {
SalesProduct product = new SalesProduct("none", "none", 0d, 0, "none");
SalesProductUpdateCask cask = new SalesProductUpdateCask(product);
OkCancelDialog<SalesProductUpdateCask> ocd = new OkCancelDialog<>("ProductBatchUpdateCask", cask);
ocd.setVisible(true);
SalesProduct finished = ocd.getSubContainer().salesProduct;
System.out.println(finished);
}
Aggregations