/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package web.operator.reception;
import 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 ConfirmReceptionController 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);
sheduleReception.setConfirmed(true);
getDao().save(sheduleReception);
} catch (Exception ex) {
}
}
return new ModelAndView("redirect:/operator/reception/receptionsearch.htm");
}
}