Package web.reception

Source Code of web.reception.RemoveController

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

}
TOP

Related Classes of web.reception.RemoveController

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.