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);
}
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);
}
}
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;
}
Aggregations