use of org.apache.struts.action.ActionMessage in project head by mifos.
the class EditStatusActionForm method validatePaymentDate.
public ActionErrors validatePaymentDate(String transactionDate, String fieldName) {
ActionErrors errors = null;
if (transactionDate != null && !transactionDate.equals("")) {
try {
if (lastPaymentDate != null && dateFallsBeforeDate(getDateAsSentFromBrowser(transactionDate), lastPaymentDate)) {
errors = new ActionErrors();
errors.add(AccountConstants.ERROR_PAYMENT_DATE_BEFORE_LAST_PAYMENT, new ActionMessage(AccountConstants.ERROR_PAYMENT_DATE_BEFORE_LAST_PAYMENT, fieldName));
}
} catch (InvalidDateException ide) {
errors = new ActionErrors();
errors.add(AccountConstants.ERROR_INVALIDDATE, new ActionMessage(AccountConstants.ERROR_INVALIDDATE, fieldName));
}
}
return errors;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class BirtReportsUploadAction method isReportInfoNotEdit.
private boolean isReportInfoNotEdit(HttpServletRequest request, BirtReportsUploadActionForm form, ReportsBO report) {
if (isReportItsSelf(form, report)) {
if (form.getIsActive().equals(report.getIsActive().toString()) && StringUtils.isBlank(form.getFile().getFileName())) {
ActionErrors errors = new ActionErrors();
errors.add(ReportsConstants.ERROR_REPORTINFONOTEDIT, new ActionMessage(ReportsConstants.ERROR_REPORTINFONOTEDIT));
request.setAttribute(Globals.ERROR_KEY, errors);
return true;
}
}
return false;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class ReportsCategoryAction method isValidToDelete.
private boolean isValidToDelete(HttpServletRequest request, ReportsCategoryBO reportsCategoryBO) {
if (!reportsCategoryBO.getReportsSet().isEmpty()) {
ActionErrors errors = new ActionErrors();
errors.add(ReportsConstants.ERROR_CATEGORYHASREPORTS, new ActionMessage(ReportsConstants.ERROR_CATEGORYHASREPORTS));
request.setAttribute(Globals.ERROR_KEY, errors);
return false;
}
return true;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class ReportsCategoryAction method isReportCategoryNameAlreadyExist.
private boolean isReportCategoryNameAlreadyExist(HttpServletRequest request, String inputCategoryName) {
for (ReportsCategoryBO category : new ReportsPersistence().getAllReportCategories()) {
if (category.getReportCategoryName().equals(inputCategoryName)) {
ActionErrors errors = new ActionErrors();
errors.add(ReportsConstants.ERROR_CATEGORYNAMEALREADYEXIST, new ActionMessage(ReportsConstants.ERROR_CATEGORYNAMEALREADYEXIST));
request.setAttribute(Globals.ERROR_KEY, errors);
return true;
}
}
return false;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class ReportsCategoryAction method isReportCategoryNameNotEdit.
private boolean isReportCategoryNameNotEdit(HttpServletRequest request, String inputCategoryName, ReportsCategoryBO reportCategory) {
if (inputCategoryName.equals(reportCategory.getReportCategoryName())) {
ActionErrors errors = new ActionErrors();
errors.add(ReportsConstants.ERROR_CATEGORYNAMENOTEDIT, new ActionMessage(ReportsConstants.ERROR_CATEGORYNAMENOTEDIT));
request.setAttribute(Globals.ERROR_KEY, errors);
return true;
}
return false;
}
Aggregations