Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryEnterpriseItem


private void btDelEnterpriseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btDelEnterpriseActionPerformed
    try {
        if (treeEnterprises.getLastSelectedPathComponent() == treeEnterprises.getModel().getRoot() || treeEnterprises.getLastSelectedPathComponent() == null) {
            return;
        }
        DirectoryEnterpriseItem item = (DirectoryEnterpriseItem) treeEnterprises.getLastSelectedPathComponent();
        if (item.getItems().size() > 0) {
            int answer = MessageBox.showConfirmYesNo(MessageBox.C_DELETE_CHIELD_OBJECTS);
            if (answer == MessageBox.ANSWER_NO) {
                return;
            }
        }
View Full Code Here


private void deleteEnterprise(DirectoryEnterpriseItem enterpriseItem) throws ClipsException {
    ClipsException hasException = null;
   
    SelectorEditableExceptional<DirectoryEnterpriseItem> iie = enterpriseItem.getItems();
    for (int i = iie.size() - 1; i > -1; i--) {
        DirectoryEnterpriseItem item = iie.get(i);
        try {
            deleteEnterprise(item);
        } catch (ClipsException ex) {
            hasException = ex;
        }
    }
    DirectoryEnterpriseItem parent = enterpriseItem.getParent();

    if (parent == null) {
        iie = enterprises.getItems();
    }
    else {
        iie = parent.getItems();
    }
    if (hasException == null) {
        iie.remove(enterpriseItem);
    } else {
        throw hasException;
View Full Code Here

    }

    @Override
    public boolean readyForPrint() {
        if (treeEnterprises.getLastSelectedPathComponent() instanceof DirectoryEnterpriseItem) {
            DirectoryEnterpriseItem item = (DirectoryEnterpriseItem) treeEnterprises.getLastSelectedPathComponent();
            return item.getID() != 0;
        }
        return false;
    }
View Full Code Here

            if (readyForPrint()) {
                HashMap<String, Object> data = new LinkedHashMap<String, Object>();
                String title = "Сведения о предприятии: " + enterprise.getTitle();
               
                String group = "";
                DirectoryEnterpriseItem parent = enterprise;
                ArrayList<String> titles = new ArrayList<String>();
                while (parent != null) {
                    titles.add(parent.getTitle() + "\n");               
                    parent = parent.getParent();
                }               
                int k = titles.size() - 1;
                for (int i = k; i > -1; i--) {
                    String iS  = titles.get(i);
                    for (int j = i; j < k; j++) {
View Full Code Here

            extraFields.put("pacient_phones", getTelephones());
        }

        ArrayList<String> jobDates = new ArrayList<String>();
        ArrayList<String> jobEnterprises = new ArrayList<String>();
        DirectoryEnterpriseItem ent;
        Date date;
        String entData;

        for (JobLocal job : getJobList()) {
            ent = job.getEnterprise();
            entData = "";
            if (ent != null && ent.getID() != 0) {
                entData += ent.getTitle();
                Address ad = ent.getAddress();
                if (address != null) {
                    entData += "  " + ad.toStringShort();
                }
            }
            jobEnterprises.add(entData);
            date = job.getBegin();
            jobDates.add(Converter.dateToString(date, "dd.MM.yy"));
        }
        extraFields.put("job_dates", jobDates);
        extraFields.put("job_enterprises", jobEnterprises);

        JobLocal jobLocal = getLastJob();
        if (jobLocal != null) {
            DirectoryEnterpriseItem enter = jobLocal.getEnterprise();
            DirectoryProfessionItem prof = jobLocal.getProfession();
            DirectoryAppointmentItem app = jobLocal.getAppointment();
            extraFields.put("job_enterprise", enter != null && enter.getID() != 0 ? enter.getTitle() : "");
            extraFields.put("job_profession", prof != null && prof.getID() != 0 ? prof.getTitle() : "");
            extraFields.put("job_appointment", app != null && app.getID() != 0 ? app.getTitle() : "");
            //todo поле иждивенец откуда брать?
        }
View Full Code Here

    /**
     * Прорисовывает предприятие и его адрес.
     */
    private void setScreenEnterprise() throws ClipsException {
        DirectoryEnterpriseItem ent = jobLocal.getEnterprise();
        String s = "Предприятие не выбрано";
        if (ent != null) {
            StringBuffer ss = new StringBuffer("<HTML>" + ent.getFullTitle(true));   // Взяли инфу о всей иерархической цепочке предприятий
                /*
             * Вся дальнейшая фигня всего лишь для того чтобы
             * в HTMLке в каждой строчке добавлять пробелы - в первой 2,
             * во второй 4 и т.д.
             */
            int pos = 0;                                    //последняя позиция тега <p>
            int k = 0;                                      //счетчик отступов
            while (ss.indexOf("<p>", pos + 1) != -1) {
                pos = ss.indexOf("<p>", pos + 1);
                for (int j = 1; j <= k * 2; j++) {
                    ss.insert(pos + 3, "&nbsp ");             //типа пробел
                }
                k++;
                pos++;
            }
            s = ss + "<p color = green>Адрес</p>";
            s += "<p color = green>" + ent.getAddress().toString() + "</p>" + "</html>";
        }
        lblAdressEnt.setText(s);
        resetDangersList();
    }
View Full Code Here

                jobLocal.getEnterprise(), "\\", directoryEnterprise);
        dlg.setAlwaysOnTop(true);
        dlg.setVisible(true);
        if (dlg.getDlgResult() == ModalDialog.DLG_OK) {
            Selector items = dlg.getSelectedItems();
            DirectoryEnterpriseItem enterprice = (DirectoryEnterpriseItem) items.get(0);
            jobLocal.setEnterprise(enterprice);
            setScreenEnterprise();
        }
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
View Full Code Here

        data.put("client", client.toString());
        data.put("clientSex", client.getSex().toString());
        data.put("clientBD", Converter.dateToString(client.getBorn()));
        data.put("clientAddress", client.getAddress().toString());

        DirectoryEnterpriseItem ent = getEnterprise();

        data.put("clientJob", ent == null ? "" : ent.getTitle());
       
        data.put("diagnosis", getDiagnosisClose().getMkb().getTitle());
        data.put("diseaseCode", getDiagnosisClose().getMkb().getDiseaseCode());
        Date dateFrom = getDateOpen().getTime();
        Date dateTill = getDateToWork().getTime();
View Full Code Here

    else{
      ClientLocal      clolClient = new ClientLocal(getOpener().getDetails().getClient(), null);
      data.put("collaborator", clolClient.getSurname().getTitle());
    }

        DirectoryEnterpriseItem ent = getEnterprise();

        data.put("clientJob", ent == null ? getOtherDirection() : ent.getTitle());

    data.put("prev_sick_list_id", getPreviousSicklist() == null? null: getPreviousSicklist().getSerial());
    data.put("day_month_open", dateFrom.get(GregorianCalendar.DAY_OF_MONTH) + " " + DateTimeUtils.monthToString(dateFrom.get(GregorianCalendar.MONTH)));
    String      yearOp = "" + dateFrom.get(GregorianCalendar.YEAR);
    data.put("year_open", yearOp.substring(yearOp.length() - 2));
View Full Code Here

    public Object getValueAt(int r, int c) {
        JobLocal jobLocal = jobList.get(r);       
        try {
            switch (c) {
                case COL_JOB: {   //предприятие, на котором работал
                    DirectoryEnterpriseItem enterprise = jobLocal.getEnterprise();
                    return enterprise.getFullTitle(false);
                }
                case COL_PROFESSION: {
                    return jobLocal.getProfession();
                }
                case COL_BEGIN: {
View Full Code Here

TOP

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

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.