Examples of Gost


Examples of com.vst.model.Gost

    protected Object formBackingObject(HttpServletRequest request) throws Exception {


        if (!isFormSubmission(request)) {
            Gost gost = new Gost();

            if (request.getParameter("gostId") != null) {
                int id = Integer.parseInt(request.getParameter("gostId"));
                gost = gostManager.getGostById((Integer) id);
            }

            if (request.getParameter("edited") != null) {
                request.setAttribute("addition", "?edited=1");
                gost.setEdited(true);
            }

            return gost;

        }
View Full Code Here

Examples of com.vst.model.Gost

        if (request.getParameter("cansel") != null) {
            return new ModelAndView("redirect:/lookGost.html");
        }

        Gost gost = (Gost) command;

        if (gost.getGostId() != null) {
            gostManager.updateGost(gost);
            if (gost.isEdited()) {

                return new ModelAndView("redirect:updating.html?id=" + gost.getGostId() + "&fieldId=" + request.getParameter("fieldId"));
            }
            return new ModelAndView("redirect:/lookGost.html");
        } else {
            gostManager.insertGost(gost);
            if (gost.isEdited()) {

                return new ModelAndView("redirect:updating.html?id=" + gost.getGostId() + "&fieldId=" + request.getParameter("fieldId"));
            }
            mav.addObject("result", Integer.valueOf(1));
        }
        mav.addObject("gost", new Gost());
        return mav;
    }
View Full Code Here

Examples of com.vst.model.Gost

    public boolean exist(Diameter diameter) {
        List list=diameterDao.getListDiameter();
        for (int i=0; i<list.size(); i++){
            Diameter diam=(Diameter)list.get(i);
            Double count=diameter.getDiametrCount() ;
            Gost gost=diameter.getGost();
            if (diam.getGost().getGostId().equals(gost.getGostId())
                && diam.getDiametrCount().equals(count)){
                return true;
            }
        }
        return false//To change body of implemented methods use File | Settings | File Templates.
View Full Code Here

Examples of com.vst.model.Gost

    public boolean supports(Class aClass) {
        return Gost.class.isAssignableFrom(aClass);
    }

    public void validate(Object o, Errors errors) {
       Gost gost=(Gost)o;

        if (gost==null || gost.getGostName().trim().equals("") || gost.getGostAbout().trim().equals("")){
            if (gost==null || gost.getGostAbout().trim().equals("")) {
                errors.rejectValue("gostAbout","insert.gostAbouterror");
            }
            if (gost==null || gost.getGostName().trim().equals("") ){
                errors.rejectValue("gostName", "gost.nullerror");
            }
          
        }else
            {
                if (gostManager.isGostExist(gost) && gost.getGostId()==null){
               errors.rejectValue("gostName", "gost.existerror");
            }
        }

    }
View Full Code Here
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.