Package clips.delegate.shedule.reception

Examples of clips.delegate.shedule.reception.SheduleReceptionData


     * @param table
     */
    @Override
    public void spanMoved(TimeSpan span, JTimeTable table) {
        TimeSpanItem itemSpan = (TimeSpanItem) span;
        SheduleReceptionData item = itemSpan.get();
        item.setBegin(span.getBegin());
        item.setDuration(span.getLength());
    }
View Full Code Here


                desc = "Услуги:\n";
            }
           
            //получаем список услуг необслуженных услуг клиента и отображаем их
            try {
                SheduleReceptionData data = tsi.get();
                List<Integer> srl = data.getLinkedServicesList();
                List<SerRenLocal> clientServices = getServices(data.getClient(am));

                for (int i = 0; i < clientServices.size(); i++) {
                    SerRenLocal s = clientServices.get(i);
                    if (srl.contains(s.getID())) {
                        try {
View Full Code Here

     * @param dayOfWeek
     * @param span
     */
    private void showSpanDetails(TimeSpanItem span) {
        try {
            SheduleReceptionData item = span.get();
            ClientLocal client = item.getClient(am);
            List<SerRenLocal> clientServices =  getServices(client);

            SheduleItemDialog dlg = new SheduleItemDialog(MainWindow.mainWindow, clientServices.iterator(), getAuditManager());

            Calendar gc = GregorianCalendar.getInstance();
            gc.setTime(item.getBegin());
            dlg.hBegin.setValue(gc.get(Calendar.HOUR_OF_DAY));
            dlg.mBegin.setValue(gc.get(Calendar.MINUTE));
           
            dlg.hDuration.setValue(item.getDuration() / 60);
            dlg.mDuration.setValue(item.getDuration() % 60);
            dlg.description.setText(item.getDescription());
            dlg.setServiceSelectedList(item.getLinkedServicesList());

            dlg.setVisible(true);
            if (dlg.getDlgResult() == ModalDialog.DLG_OK) {
                SheduleReceptionData saved = (SheduleReceptionData) item.clone();
                try {
                    update(item, dlg, gc);
                    span.itemChanged();
                } catch (ClipsException ex) {
                    item.setBegin(saved.getBegin());
                    item.setDuration(saved.getDuration());
                    item.setDescription(saved.getDescription());
                    MessageBox.showException(ex);
                }
            } else if (dlg.getDlgResult() == SheduleItemDialog.DLG_DELETED) {
                removeSpanWithConformation(span);
            }
View Full Code Here

     * печатает спан
     * @param span
     */
    private void printSpanDetails(TimeSpanItem span) {
        try {
            SheduleReceptionData item = span.get();
            HashMap<String, Object> data = new LinkedHashMap<String, Object>();
            String title = "Запись на прием:";
            data.put("clientFIO", "Пациент: " + item.getClient(am).toString());
            data.put("collabFIO", "Врач: " + item.getCollaborator().getTitle());
            data.put("date", "Дата: " + Converter.dateToString(item.getBegin()));
           
            DayOfWeek dayOfWeek = day.getDayOfWeek();
            SheduleIndividualLocal sil = new SheduleIndividualLocal(collaborator);           
            WeekIndex weekIndex = new WeekIndex(day);
           
            Iterator<SheduleIndividualData> it = sil.daySelector(weekIndex, dayOfWeek);
           
            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() + ")";
View Full Code Here

        @Override
        protected SheduleReceptionData init() throws Exception {
            if(getDetails().receptionDetails == null) {
                return null;
            }
            return new SheduleReceptionData(getPolisData().getClient(getAuditListener()), getDetails().receptionDetails);
        }
View Full Code Here

TOP

Related Classes of clips.delegate.shedule.reception.SheduleReceptionData

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.