/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package web.operator.request;
import domain.UserRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import web.generic.CH;
import web.generic.GenericAbstractController;
/**
* Контроллер отказа подтверждения пациента
* Обязательные параметры:
* clientrequested - ID UserRequestа
* @author lacoste
*/
public class DenyController extends GenericAbstractController {
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
String requestedStr = request.getParameter("clientrequested");
if (requestedStr != null && !requestedStr.isEmpty()) {
try {
UserRequest requested = CH.get(getDao(), UserRequest.class, requestedStr);
getDao().delete(requested);
} catch (Exception ex) {
}
}
return new ModelAndView("redirect:/operator/request/index.htm");
}
}