Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryCabinetItem


            if (!it.hasNext()) {
                WeekIndex planWeekIndex = new WeekIndex(weekIndex.getIndex() % sil.getWeekCount());
                it = sil.daySelector(planWeekIndex, dayOfWeek);
            }
           
            DirectoryCabinetItem cabinet = null;
           
            Calendar itemBegin = new GregorianCalendar();
            itemBegin.setTime(item.getBegin());
           
            Calendar itemEnd = new GregorianCalendar();
            itemEnd.setTime(item.getEnd());
           
            Calendar workBegin = new GregorianCalendar();
            Calendar workEnd = new GregorianCalendar();
           
            int year = itemBegin.get(Calendar.YEAR);
            int month = itemBegin.get(Calendar.MONTH);
            int dayy = itemBegin.get(Calendar.DAY_OF_MONTH);
           
            while (it.hasNext()) {
                SheduleIndividualData work = it.next();
               
                workBegin.setTime(work.getBegin());
                workBegin.set(year, month, dayy);
               
                workEnd.setTime(work.getBegin());
                workEnd.add(Calendar.MINUTE, work.getWorkDuration());
                workEnd.set(year, month, dayy);
               
                if ((itemBegin.after(workBegin) || itemBegin.equals(workBegin)) &&
                        (itemEnd.before(workEnd) || itemEnd.equals(workEnd))) {
                    cabinet = work.getCabinet();
                    break;
                }
            }
           
            Calendar tb = GregorianCalendar.getInstance();
            Calendar te = GregorianCalendar.getInstance();
            tb.setTime(item.getBegin());
            te.setTime(item.getEnd());
            String period = String.format("%02d:%02d-%02d:%02d", tb.get(Calendar.HOUR_OF_DAY),
                    tb.get(Calendar.MINUTE), te.get(Calendar.HOUR_OF_DAY), te.get(Calendar.MINUTE));
           
            data.put("period", "Время: " + period);
           
            String services = "";
            List<Integer> srl = item.getLinkedServicesList();
            List<SerRenLocal> clientServices = getServices(item.getClient(am));
            if (srl.size() != 0) {
                for (int i = 0; i < clientServices.size(); i++) {
                    SerRenLocal s = clientServices.get(i);
                    if (srl.contains(s.getID())) {
                        services += "    - " + s.getService().getTitle() + "\n";
                    }
                }
            }
            else {
                services += "    нет привязанных услуг";
            }
            data.put("services", "Привязанные услуги: \n" + services);
           
            if (!item.getDescription().isEmpty()) {
                data.put("description", "Примечание: \n" + item.getDescription());
            }
           
            if (cabinet != null) {
                String cab = cabinet.getTitle();
                cab += " (" + cabinet.getDescription() + ")";
                data.put("cabinet", "Кабинет:  " + cab);
            }

            TableReportOptions ops = new TableReportOptions();
            ops.setPageA5();
View Full Code Here


        return cabinets.get(row);
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        DirectoryCabinetItem item = cabinets.get(rowIndex);
        switch (columnIndex) {
            case COL_ID : return item.getID();
            case COL_TITLE: return item;
            case COL_DESCRIPTION: return item.getDescription();   
            default: return null;
        }
    }
View Full Code Here

        CabinetDetails d = new CabinetDetails();   
        d.id = 0;   
        d.title = "Введите название кабинета";        
        d.description = "";
    d.lpuId = getCurLpu().getID();
        directory.getItems().append(new DirectoryCabinetItem(d));
    directory = DirectoryLocator.getDirectory(DirectoryCabinet.class, true);
        setTable();
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
    }
View Full Code Here

}//GEN-LAST:event_btAddActionPerformed

private void btDelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btDelActionPerformed
    try {
        if (tabCabinets.getSelectedRowCount() > 0) {
            DirectoryCabinetItem itemAt = tableModel.getItemAt(tabCabinets.getSelectedRowSorted());
            directory.getItems().remove(itemAt);
        }
        directory = DirectoryLocator.getDirectory(DirectoryCabinet.class, true);
        setTable();
    } catch(ClipsException e) {
View Full Code Here

TOP

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

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.