Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryPacketTemplateList


        if (dlg.getDlgResult() == ModalDialog.DLG_OK) {
            Selector ii = dlg.getSelectedItems();
            if (ii.size() < 1) {
                return;
            }
            DirectoryPacketTemplateList dir = DirectoryLocator.getDirectory(DirectoryPacketTemplateList.class, false);
            for (int i = 0; i < ii.size(); i ++) {
                DirectoryServiceItem service = (DirectoryServiceItem) ii.get(i);
                //может быть выбранная услуга уже есть в пакете
                boolean isInPacket = false;
                for (int j = 0; j < packet.getPacketItemCount(); j++) {
                    if (packet.getPacketItem(j).getService().getID() == service.getID()) {
                        isInPacket = true;
                        break;
                    }                   
                }
                //если нет в пакете то добавляем
                if (!isInPacket) {
                    PacketTemplateItemDetails d = new PacketTemplateItemDetails();
                    d.id = 0;
                    d.title = service.getTitle();
                    d.service = service.getID();
                    d.defaultDuration = 0;
                    d.discount = 0;
                    d.weight = 0;
                    d.packetTemplate = packet.getID();
                    DirectoryPacketTemplateListItem item = new DirectoryPacketTemplateListItem(d);
                    if (!dir.checkContracts(d)) {
                        if (MessageBox.showConfirmYesNo(MessageBox.C_CONTRACT_SETVICE_NOT_FOUNDED) == MessageBox.ANSWER_NO) {
                            return;
                        }
                    }
                    dir.getItems().append(item);
                }
            }           
            setTable();
        }
    } catch (ClipsException ex) {
View Full Code Here


        ArrayList<DirectoryPacketTemplateListItem> items = new ArrayList<DirectoryPacketTemplateListItem>();
        int[] sel = tabPacketItems.getSelectedRowsSorted();
        for (int i = 0; i < sel.length; i++) {
            items.add(packet.getPacketItem(sel[i]));
        }
        DirectoryPacketTemplateList dir =
                (DirectoryPacketTemplateList) DirectoryLocator.getDirectory(DirectoryPacketTemplateList.class, false);
        for (int i = 0; i < items.size(); i++) {
            DirectoryPacketTemplateListItem item = items.get(i);
            dir.getItems().remove(item);
        }
        setTable();
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
    }   
View Full Code Here

TOP

Related Classes of clips.delegate.directory.complex.DirectoryPacketTemplateList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.