Package clips.delegate.directory.filtered

Examples of clips.delegate.directory.filtered.DirectoryServiceItem$ChildServiceItems


       
        ArrayList<DirectoryServiceItem> list = new ArrayList<DirectoryServiceItem>();
        SelectorEditableExceptional<DangerServiceData> dsChunk = current.getDangerServices();
        for (int i = 0; i < dsChunk.size(); i++) {
            DangerServiceData dangerService = dsChunk.get(i);
            DirectoryServiceItem service = dangerService.getService();
            serviceList.add(service);
            String serv = "";
            serv += service + (!dangerService.getSpeciality().isNullItem() ? " " + dangerService.getSpeciality() : "");

            if (!servMap.containsKey(service)){
View Full Code Here


            //создание списка хмлшег
            try {
                if (xmlMap == null) {
                    xmlMap = new HashMap<Integer, CheckupXMLData>();
                    for (int i = 0; i < serviceList.size(); i++) {
                        DirectoryServiceItem service = serviceList.get(i);
                        DirectoryCheckupTypeItem checkupTypeItem = service.getCheckUpType();
                        if (checkupTypeItem != null && checkupTypeItem.getID() != 0) {
                            xmlMap.put(service.getID(), new CheckupXMLData(checkupTypeItem));
                        }
                    }
                }
            } catch (JDOMException ex) {
                MessageBox.showError(MessageBox.E_INVALID_XML_STRING);
View Full Code Here

        serviceMap = new HashMap<String, DirectoryServiceItem>();
        serviceList = new ArrayList<DirectoryServiceItem>();

        SelectorEditableExceptional<DirectoryServiceItem> servItems = dirService.getItems();
        for (int i = 0; i < servItems.size(); i++) {
            DirectoryServiceItem item = servItems.get(i);
            if (item.getID() != 0 && !item.getCode().trim().isEmpty()
                    && item.getGroup().getID() == ServiceGroup.SERVICE_GROUP_VISIT) {
                serviceMap.put(item.getCode().trim(), item);
                serviceList.add(item);
            }
        }

        modelService = new DelegateComboboxModel(jComboService, false) {

            @Override
            public boolean isSelectionVisible(){
              return true;
            }

            @Override
            public Object getElementAtImp(int index) throws ClipsException {
                return serviceList.get(index);
            }

            @Override
            public int getSizeImp() throws ClipsException {
                return serviceList.size();
            }

            @Override
            public Object getSelectedItemImp() throws ClipsException {
                return selectedService;
            }

            @Override
            public void setSelectedItemImp(Object anItem) throws ClipsException {
                selectedService = (DirectoryServiceItem) anItem;
                if (selectedService == null || tfServiceCode.getText().equals(selectedService.getCode())) {
                    return;
                }
                inputedServCode = selectedService.getCode();
                tfServiceCode.setText(inputedServCode);
            }
        };

        modelServiceCode = new TextFieldModel(tfServiceCode) {

            @Override
            protected void setModelTextChecked(String text) throws ClipsException, ParseException, NumberFormatException {
                selectedService = serviceMap.get(text);
                jComboService.setSelectedItem(selectedService);
            }

            @Override
            protected String getModelTextChecked() throws ClipsException {
                return inputedServCode;
            }
        };
        modelServiceCode.setModelText("");

        //Код типа приема

        resetCollFuncList(selectedColl);

        modelCollFunc = new DelegateComboboxModel(jComboSpec, false) {

            @Override
            public boolean isSelectionVisible(){
              return true;
            }

            @Override
            public boolean isEnabled() {
                return collFuncList.size() > 1;
            }

            @Override
            public Object getElementAtImp(int index) throws ClipsException {
                return collFuncList.get(index);
            }

            @Override
            public int getSizeImp() throws ClipsException {
                return collFuncList.size();
            }

            @Override
            public Object getSelectedItemImp() throws ClipsException {
                return selectedCollFunc;
            }

            @Override
            public void setSelectedItemImp(Object anItem) throws ClipsException {
                selectedCollFunc = (DCFI) anItem;
                if (selectedCollFunc == null) {
                    jPanel2.remove(panUet);
                    tfUet.setText("1");
                    return;
                }
                inputedSpecCode = selectedCollFunc.getItem().getReceptionType().getExtKey();
                if (!tfSpecCode.getText().equals(inputedSpecCode)) {
                    tfSpecCode.setText(inputedSpecCode);
                }
               
                if (inputedSpecCode.contains("29")) {
                    jPanel2.add(panUet, BorderLayout.SOUTH);
                }
                else {
                    jPanel2.remove(panUet);
                    tfUet.setText("1");
                }
                DialogQuickInput.this.validate();
                DialogQuickInput.this.pack();
                DialogQuickInput.this.repaint();
            }
        };

        modelSpecCode = new TextFieldModel(tfSpecCode) {

            @Override
            protected boolean isEnabled() {
                return collFuncList.size() > 1;
            }

            @Override
            protected void setModelTextChecked(String text) throws ClipsException, ParseException, NumberFormatException {
                selectedCollFunc = collFuncMap.get(text);
                modelCollFunc.setSelectedItemImp(selectedCollFunc);
                modelCollFunc.contentStateChanged();
            }

            @Override
            protected String getModelTextChecked() throws ClipsException {
                return inputedSpecCode;
            }
        };
        tfSpecCode.setDocument(modelSpecCode);
        tfSpecCode.setText(inputedSpecCode);

        for (int i = 0; i < dirPlace.getItems().size(); i++) {
            DirectoryServicingPlaceItem item = dirPlace.getItems().get(i);
            if (item.getTitle().trim().toUpperCase().startsWith("ПОЛИ")) {
                selectedPlace = item;
                break;
            }
        }
        modelPlace = new DelegateComboboxModel(jComboPlace, false) {
View Full Code Here

            DirectoryDialogService dds = new DirectoryDialogService(false, null);
            dds.setVisible(true);
            if (dds.getDlgResult() == DirectoryDialogService.DLG_OK) {
                Selector ii = dds.getSelectedItems();
                if (ii.size() > 0) {
                    DirectoryServiceItem item = (DirectoryServiceItem) ii.get(0);
                    tfService.setText(item.toString());
                    directionLocal.setService(item);
                }
            }
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
View Full Code Here

  }//GEN-LAST:event_btRenderServiceActionPerformed

    public void setScreenFields() throws ClipsException {
        //Заголовок
        try {
            DirectoryServiceItem service = serRenLocal.getService();
            labService.setText(service.toString());
        } catch (ClipsException ex) {
            labService.setText("Информация недоступна");
            labService.setToolTipText(MessageBox.parseException(ex));
        }
        //Тип приема
View Full Code Here

        return COLCOUNT;
    }

    @Override
    public Object getValueAt(int row, int col) {
        DirectoryServiceItem service = serviceList.get(row);

        Float p = null;
        Float m = null;
        Float d = null;
        float rest = 0;
        if (scData != null) {
            p = scData.getPrice(service);
            m = scData.getMoney(service);
            d = scData.getDiscount(service);
        }

        switch (col) {
            case COL_SERVICE: {
                return service;
            }
            case COL_PRICE: {
                if (p != null) {
                    return String.format("%.2f", ((float) p) / 100);
                } else {
                    return "";
                }
            }
            case COL_MONEY: {
                if (m != null) {
                    return String.format("%.2f", ((float) m) / 100);
                } else {
                    return "";
                }
            }
            case COL_REST: {
                if (p != null && m != null) {
                    rest = ((float) (p - m)) / 100;
                    return String.format("%.2f", rest < 0 ? 0 : rest);
                } else {
                    return "";
                }
            }
            case COL_DISCOUNT: {
                Integer forceDiscount = forceDiscountMap.get(service.getID());
                if (forceDiscount != null) {
                    return forceDiscount + "%";
                } else if (scData != null && d!= null) {
                    return d + "%";
                } else {
                    return "";
                }
            }
            case COL_REST_DISCOUNT: {
                if (scData == null || p == null || m ==null || d == null) {
                    return "";
                }
                Integer forceDiscount = forceDiscountMap.get(service.getID());
                if (forceDiscount != null) {
                    rest = (p - m) * (1 - (float) forceDiscount / 100) / 100;
                } else {
                    rest = (p - m) * (1 - d / 100) / 100;
                }
View Full Code Here

        TableModelServiceList tmsl = null;
        if (table.getModel() instanceof TableModelServiceList) {
            tmsl = (TableModelServiceList) table.getModel();
                   
            if (column == TableModelServiceList.COL_DISCOUNT) {
                DirectoryServiceItem service = tmsl.getService(row);
                Integer forceDiscount = forceDiscountMap.get(service.getID());
                if (forceDiscount != null) {
                    render().setBackground(DefaultColors.FIELD_TO_INPUT);
                    render().setText(value.toString() + " (вруч.)");
                }
            }
View Full Code Here


        Float sum = null;
        float a;
        for (int i = 0; i < serviceList.size(); i++) {
            DirectoryServiceItem service = serviceList.get(i);
            Float p = selectedSCData.getPrice(service);
            Float m = selectedSCData.getMoney(service);
            Float d = selectedSCData.getDiscount(service);

            if (p!=null && m!= null && d!= null){
View Full Code Here

                return;
            }
            if (treeServices.getLastSelectedPathComponent().getClass() ==
                    DirectoryServiceItem.class) {
                //Добавление услуги
                DirectoryServiceItem service = (DirectoryServiceItem) treeServices.getLastSelectedPathComponent();
                packetService = null;
                if (serviceList.contains(service)) {
                    return;
                }
                serviceList.add(service);
                if (serviceList.size() > 0) {
                    mode = MODE_SERVICE_ONLY;
                }
            } else if (treeServices.getLastSelectedPathComponent().getClass() ==
                    DirectoryPacketTemplateItem.class) {
                //Добавление группы услуг
                packetService = (DirectoryPacketTemplateItem) treeServices.getLastSelectedPathComponent();
                for (int i = 0; i < packetService.getPacketItemCount(); i++) {
                    DirectoryServiceItem service = packetService.getPacketItem(i).getService();
                    serviceList.add(service);
                }
                if (serviceList.size() > 0) {
                    mode = MODE_NOTHING;
                } else {
View Full Code Here

}//GEN-LAST:event_treeServicesMouseMoved

private void tableServiceListMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableServiceListMouseMoved
    int row = tableServiceList.rowAtPoint(evt.getPoint());
    if (row > -1) {
        DirectoryServiceItem service = serviceList.get(row);
        if (service != null) {
            tableServiceList.setToolTipText(service.getTitle());
        }
        else {
            tableServiceList.setToolTipText(null);
        }
    }
View Full Code Here

TOP

Related Classes of clips.delegate.directory.filtered.DirectoryServiceItem$ChildServiceItems

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.