Search in sources :

Example 36 with Event

use of com.axelor.apps.crm.db.Event in project axelor-open-suite by axelor.

the class TrainingRegisterController method EventToDateUpdate.

@Transactional
public void EventToDateUpdate(ActionRequest request, ActionResponse response) {
    TrainingRegister trainingRegister = request.getContext().asType(TrainingRegister.class);
    if (trainingRegister.getEventList() != null) {
        for (Event event : trainingRegister.getEventList()) {
            event.setEndDateTime(trainingRegister.getToDate());
            eventRepository.save(event);
        }
    }
}
Also used : TrainingRegister(com.axelor.apps.talent.db.TrainingRegister) Event(com.axelor.apps.crm.db.Event) Transactional(com.google.inject.persist.Transactional)

Aggregations

Event (com.axelor.apps.crm.db.Event)36 Transactional (com.google.inject.persist.Transactional)21 EventRepository (com.axelor.apps.crm.db.repo.EventRepository)11 EventService (com.axelor.apps.crm.service.EventService)7 ICalendarEventService (com.axelor.base.service.ical.ICalendarEventService)7 TrainingRegister (com.axelor.apps.talent.db.TrainingRegister)6 Duration (java.time.Duration)6 AxelorException (com.axelor.exception.AxelorException)5 LocalDateTime (java.time.LocalDateTime)4 RecurrenceConfiguration (com.axelor.apps.crm.db.RecurrenceConfiguration)3 RecurrenceConfigurationRepository (com.axelor.apps.crm.db.repo.RecurrenceConfigurationRepository)3 HashMap (java.util.HashMap)3 TooManyIterationsException (org.apache.commons.math3.exception.TooManyIterationsException)3 Partner (com.axelor.apps.base.db.Partner)2 Lead (com.axelor.apps.crm.db.Lead)2 Training (com.axelor.apps.talent.db.Training)2 TrainingSession (com.axelor.apps.talent.db.TrainingSession)2 TrainingSessionRepository (com.axelor.apps.talent.db.repo.TrainingSessionRepository)2 User (com.axelor.auth.db.User)2 DayOfWeek (java.time.DayOfWeek)2