Package clips.delegate.shedule.individual

Examples of clips.delegate.shedule.individual.WeekIndex


        @Override
        public void actionPerformed(ActionEvent arg0) {
            int index = buttons.indexOf(arg0.getSource());
            if(index != -1) {
                try {
                    WeekIndex wi= new WeekIndex(index);
                    initTimeTableModel(wi);
                    currentWeekIndex = wi;
                    for(int i=0; i<buttons.size(); i++) {
                        buttons.get(i).setSelected(i==index);
                    }
View Full Code Here


                }
            }
        }
       
        private void updateCurrentWeekIndex(int weekCount) throws ClipsException {
            WeekIndex wi = new WeekIndex();
            currentWeek = Math.abs(wi.getIndex() % weekCount + 1);
            lbCurrentWeek.setText("Сейчас идет "+ currentWeek + " неделя");
            weeks.invalidate();
        }
View Full Code Here

            try {
                Day day = currentWeekIndex.getDay(dayOfWeek);
                SheduleProrumbleData data = spl.getProrumble(day);

                if (option == exceptionOption) {
                    WeekIndex planweekIndex = new WeekIndex(currentWeekIndex.getIndex() % sil.getWeekCount());
                    sil.copyWorksWithOverwrite(planweekIndex, dayOfWeek, currentWeekIndex, dayOfWeek);
                    if (data != null) {
                        spl.iterator(day.getYear(), day.getMonth() + 1).remove(data);
                    }
                } else if (option == planOption) {
View Full Code Here

        if (col == 0) {
            return "Неделя " + (rowIndex + 1);
        } else {
            try {
                DayOfWeek dayOfWeek = DayOfWeek.createEurope(col - 1);
                Iterator<SheduleIndividualData> it = sil.daySelector(new WeekIndex(rowIndex), dayOfWeek);
                String toScreen = "";
                if (swl.isWeekend(dayOfWeek)) {
                    toScreen += "Выходной день\n";
                }
                if (!it.hasNext()) {
View Full Code Here

            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;
           
View Full Code Here

    public SheduleIndividualExceptionDialog(java.awt.Frame parent,
            SheduleIndividualLocal sil, SheduledDay sheduledDay,
            WeekIndex weekIndex, DayOfWeek dayOfWeek, AuditManager am) throws ClipsException {
        super(parent, true);

        planWeekIndex = new WeekIndex(weekIndex.getIndex() % sil.getWeekCount());
        model = new SheduleTemplateTableModel(sil, weekIndex, am);
        planModel = new SheduleTemplateTableModel(sil, planWeekIndex, am);

        initComponents();
        this.sil = sil;
View Full Code Here

            return res;
        }

        //Получаем расписание врача за текущую неделю (только работы указанного типа)
        //если нет работ - значит врач работает по шаблону, идем дальше
        WeekIndex weekIndex = new WeekIndex(day);
        IteratorEditable<SheduleIndividualData> exWorks = sil.daySelector(weekIndex, dow);
        if (exWorks.hasNext()) {
            res.setWorking(true);
            res.setDescription("Исключение");
            //если есть работы используем их
            List<SheduleIndividualData> lst = new LinkedList<SheduleIndividualData>();
            while (exWorks.hasNext()) {
                lst.add(exWorks.next());
            }
            res.setData(lst);
            return res;
        }

        //5. Получаем исключения работы поликлинники за текущую неделю.
        //если исключения есть, и они указывают что день нерабочий, отмечаем день как закрытый
        SheduleExceptionData exception = sel.getException(day.getCalendar().getTime());
        if (exception != null && !exception.isWorking()) {
            res.setWorking(false);
            res.setDescription(exception.getDescription());
            return res;
        }

        //6. Если исключений нет, получаем праздники за указанную неделю
        //если в этот день праздник, отмечаем день как закрытый
        if (exception == null) {
            SheduleHolidayData holiday = shl.getHoliday(day.getDay(), day.getMonth() + 1);
            if (holiday != null) {
                res.setWorking(false);
                res.setDescription(holiday.getDescription());
                return res;
            }
        }

        //7. Врач работает по шаблону. получаем шаблон расписания для данного врача
        res.setWorking(true);
        res.setByPlan(true);
        WeekIndex planWeekIndex = new WeekIndex(weekIndex.getIndex() % sil.getWeekCount());
        IteratorEditable<SheduleIndividualData> plWorks = sil.daySelector(planWeekIndex, dow);
        if (plWorks.hasNext()) {
            //если есть работы используем их
            List<SheduleIndividualData> lst = new LinkedList<SheduleIndividualData>();
            while (plWorks.hasNext()) {
View Full Code Here

TOP

Related Classes of clips.delegate.shedule.individual.WeekIndex

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.