Package web.users

Source Code of web.users.RemoveController

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package web.users;

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;

/**
* Контроллер, удаляющий запись о пациенте на подтверждение
* Обязательные параметры:
*     request - ID UserRequesta, пациента на подтверждение
* @author petr
*/
public class RemoveController extends GenericAbstractController {

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
        String requestStr = hsr.getParameter("request");
        if (requestStr == null || requestStr.isEmpty()) {
            return new ModelAndView("redirect:/users/list.htm");
        }
       
        UserRequest request = null;
        try {
            request = CH.get(getDao(), UserRequest.class, hsr.getParameter("request"));
        } catch (Exception ex) {
        }
        if (request != null) {
            getDao().delete(request);
        }
        return new ModelAndView("redirect:list.htm");
    }

}
TOP

Related Classes of web.users.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.