* IRequest
* @return {@link tw.com.iisi.cap.response.IResult}
* @throws CapException
*/
public IResult save(IRequest request) {
AjaxFormResult result = new AjaxFormResult();
String oid = request.get("oid");
Remind remind = null;
if (!CapString.isEmpty(oid)) {
remind = commonSrv.findById(Remind.class, oid);
}
if (remind == null) {
remind = new Remind();
remind.setCrTime(CapDate.getCurrentTimestamp());
}
String startDate = request.get("startDate");
String startTime = request.get("startTime");
if (CapString.isEmpty(startTime)) {
startTime = "00:00:00";
} else {
startTime = startTime + ":00";
}
request.put("startDate", startDate + " " + startTime);
String endDate = request.get("endDate");
String endTime = request.get("endTime");
if (CapString.isEmpty(endTime)) {
endTime = "00:00:00";
} else {
endTime = endTime + ":00";
}
request.put("endDate", endDate + " " + endTime);
CapBeanUtil.map2Bean(request, remind, Remind.class);
remind.setUpdater(CapSecurityContext.getUserId());
remind.setUpdTime(CapDate.getCurrentTimestamp());
remind.setLocale(SimpleContextHolder.get(CapWebUtil.localeKey)
.toString());
commonSrv.save(remind);
result.putAll(new AjaxFormResult(remind.toJSONObject(
CapEntityUtil.getColumnName(remind), null)));
return result;
}