Search in sources :

Example 1 with TicketRepository

use of com.axelor.apps.helpdesk.db.repo.TicketRepository in project axelor-open-suite by axelor.

the class TicketController method timerStateOn.

@Transactional
public void timerStateOn(ActionRequest request, ActionResponse response) {
    try {
        TicketRepository ticketRepo = Beans.get(TicketRepository.class);
        Ticket ticket = request.getContext().asType(Ticket.class);
        ticket = ticketRepo.find(ticket.getId());
        ticket.setTimerState(true);
        ticketRepo.save(ticket);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Ticket(com.axelor.apps.helpdesk.db.Ticket) TicketRepository(com.axelor.apps.helpdesk.db.repo.TicketRepository) Transactional(com.google.inject.persist.Transactional)

Example 2 with TicketRepository

use of com.axelor.apps.helpdesk.db.repo.TicketRepository in project axelor-open-suite by axelor.

the class TicketController method timerStateOff.

@Transactional
public void timerStateOff(ActionRequest request, ActionResponse response) {
    try {
        TicketRepository ticketRepo = Beans.get(TicketRepository.class);
        Ticket ticket = request.getContext().asType(Ticket.class);
        ticket = ticketRepo.find(ticket.getId());
        ticket.setTimerState(false);
        ticketRepo.save(ticket);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Ticket(com.axelor.apps.helpdesk.db.Ticket) TicketRepository(com.axelor.apps.helpdesk.db.repo.TicketRepository) Transactional(com.google.inject.persist.Transactional)

Aggregations

Ticket (com.axelor.apps.helpdesk.db.Ticket)2 TicketRepository (com.axelor.apps.helpdesk.db.repo.TicketRepository)2 Transactional (com.google.inject.persist.Transactional)2