Search in sources :

Example 1 with MailBatch

use of com.axelor.apps.base.db.MailBatch in project axelor-open-suite by axelor.

the class MailBatchController method remindTimesheet.

public void remindTimesheet(ActionRequest request, ActionResponse response) throws AxelorException {
    MailBatch mailBatch = request.getContext().asType(MailBatch.class);
    Batch batch = null;
    batch = Beans.get(MailBatchService.class).remindMail(Beans.get(MailBatchRepository.class).find(mailBatch.getId()));
    if (batch != null)
        response.setFlash(batch.getComments());
    response.setReload(true);
}
Also used : MailBatch(com.axelor.apps.base.db.MailBatch) MailBatchRepository(com.axelor.apps.base.db.repo.MailBatchRepository) Batch(com.axelor.apps.base.db.Batch) MailBatch(com.axelor.apps.base.db.MailBatch)

Example 2 with MailBatch

use of com.axelor.apps.base.db.MailBatch in project axelor-open-suite by axelor.

the class MailBatchController method remindTimesheetGeneral.

public void remindTimesheetGeneral(ActionRequest request, ActionResponse response) throws AxelorException {
    MailBatch mailBatch = Beans.get(MailBatchRepository.class).findByCode(MailBatchRepository.CODE_BATCH_EMAIL_TIME_SHEET);
    if (mailBatch != null) {
        Batch batch = null;
        batch = Beans.get(MailBatchService.class).remindMail(mailBatch);
        if (batch != null)
            response.setFlash(batch.getComments());
        response.setReload(true);
    } else {
        throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.BASE_BATCH_2), MailBatchRepository.CODE_BATCH_EMAIL_TIME_SHEET);
    }
}
Also used : AxelorException(com.axelor.exception.AxelorException) MailBatch(com.axelor.apps.base.db.MailBatch) MailBatchRepository(com.axelor.apps.base.db.repo.MailBatchRepository) Batch(com.axelor.apps.base.db.Batch) MailBatch(com.axelor.apps.base.db.MailBatch)

Example 3 with MailBatch

use of com.axelor.apps.base.db.MailBatch in project axelor-open-suite by axelor.

the class MailBatchBaseRepository method copy.

@Override
public MailBatch copy(MailBatch entity, boolean deep) {
    MailBatch copy = super.copy(entity, deep);
    copy.setBatchList(null);
    return copy;
}
Also used : MailBatch(com.axelor.apps.base.db.MailBatch)

Aggregations

MailBatch (com.axelor.apps.base.db.MailBatch)3 Batch (com.axelor.apps.base.db.Batch)2 MailBatchRepository (com.axelor.apps.base.db.repo.MailBatchRepository)2 AxelorException (com.axelor.exception.AxelorException)1