/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package web.reception;
import domain.shedule.SheduleReception;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import web.generic.CH;
import web.generic.GenericAbstractController;
/**
* Контроллер отменяет запись на прием
* Обязательные параметры:
* reception - ID записи на прием
* @author petr
*/
public class RemoveController extends GenericAbstractController{
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
String receptionStr = hsr.getParameter("reception");
if (receptionStr != null && !receptionStr.isEmpty()) {
try {
SheduleReception sheduleReception = CH.get(getDao(), SheduleReception.class, receptionStr);
getDao().delete(sheduleReception);
} catch (Exception ex) {
}
}
return new ModelAndView("redirect:list.htm");
}
}