Search in sources :

Example 6 with TrainingSession

use of com.axelor.apps.talent.db.TrainingSession in project axelor-open-suite by axelor.

the class TrainingRegisterController method massTrainingRegisterCreation.

@SuppressWarnings("unchecked")
public void massTrainingRegisterCreation(ActionRequest request, ActionResponse response) {
    Context context = request.getContext();
    ArrayList<LinkedHashMap<String, Object>> employeeList = (ArrayList<LinkedHashMap<String, Object>>) context.get("employeeList");
    TrainingSession trainingSession = Beans.get(TrainingSessionRepository.class).find(Long.parseLong(context.get("_trainingSessionId").toString()));
    String eventList = Beans.get(TrainingRegisterService.class).massTrainingRegisterCreation(employeeList, trainingSession);
    response.setCanClose(true);
    if (!eventList.equals("()")) {
        response.setView(ActionView.define("Meeting").model(Event.class.getCanonicalName()).add("grid", "event-grid").add("form", "event-form").param("search-filters", "event-filters").domain("self.id in " + eventList).map());
    } else {
        response.setAlert(IExceptionMessage.NO_EVENT_GENERATED);
    }
}
Also used : Context(com.axelor.rpc.Context) TrainingSessionRepository(com.axelor.apps.talent.db.repo.TrainingSessionRepository) ArrayList(java.util.ArrayList) Event(com.axelor.apps.crm.db.Event) TrainingRegisterService(com.axelor.apps.talent.service.TrainingRegisterService) LinkedHashMap(java.util.LinkedHashMap) TrainingSession(com.axelor.apps.talent.db.TrainingSession)

Example 7 with TrainingSession

use of com.axelor.apps.talent.db.TrainingSession in project axelor-open-suite by axelor.

the class TrainingSessionController method completeSession.

public void completeSession(ActionRequest request, ActionResponse response) {
    TrainingSession trainingSession = request.getContext().asType(TrainingSession.class);
    trainingSession = Beans.get(TrainingSessionRepository.class).find(trainingSession.getId());
    Beans.get(TrainingSessionService.class).closeSession(trainingSession);
    response.setReload(true);
}
Also used : TrainingSessionService(com.axelor.apps.talent.service.TrainingSessionService) TrainingSession(com.axelor.apps.talent.db.TrainingSession)

Example 8 with TrainingSession

use of com.axelor.apps.talent.db.TrainingSession in project axelor-open-suite by axelor.

the class TrainingSessionController method updateAllRating.

public void updateAllRating(ActionRequest request, ActionResponse response) {
    TrainingSession trainingSession = request.getContext().asType(TrainingSession.class);
    trainingSession = Beans.get(TrainingSessionRepository.class).find(trainingSession.getId());
    Beans.get(TrainingSessionService.class).updateAllRating(trainingSession);
    response.setReload(true);
}
Also used : TrainingSessionService(com.axelor.apps.talent.service.TrainingSessionService) TrainingSession(com.axelor.apps.talent.db.TrainingSession)

Aggregations

TrainingSession (com.axelor.apps.talent.db.TrainingSession)8 TrainingSessionService (com.axelor.apps.talent.service.TrainingSessionService)3 Event (com.axelor.apps.crm.db.Event)2 Training (com.axelor.apps.talent.db.Training)2 TrainingRegisterService (com.axelor.apps.talent.service.TrainingRegisterService)2 TrainingRegister (com.axelor.apps.talent.db.TrainingRegister)1 TrainingRegisterRepository (com.axelor.apps.talent.db.repo.TrainingRegisterRepository)1 TrainingSessionRepository (com.axelor.apps.talent.db.repo.TrainingSessionRepository)1 Context (com.axelor.rpc.Context)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 ValidationException (javax.validation.ValidationException)1