Package web.operator.reception

Source Code of web.operator.reception.ConfirmReceptionController

/*
* 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");
    }

}
TOP

Related Classes of web.operator.reception.ConfirmReceptionController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.