Package com.suarte.core

Examples of com.suarte.core.Product


    public String edit() {
        if (id != null) {
            product = productManager.get(id);
        } else {
            product = new Product();
        }

        return "edit";
    }
View Full Code Here


        response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
        response.setHeader("Pragma", "no-cache"); //HTTP 1.0
        response.setDateHeader("Expires", 0); //prevents caching at the proxy server

        Long id = Long.valueOf(request.getParameter("id"));
        Product product = productManager.get(id);

        Response resp = null;

        if (product == null) {
            resp = new Response(false, "Registro no encontrado");
            response.getWriter().append("{");
            response.getWriter().append("\"success\":" + (product != null ? "\"OK\"" : "\"FAIL\""));
            response.getWriter().append("}");
            response.getWriter().flush();
            response.getWriter().close();
        } else {
            try {
                resp = new Response();

                response.getWriter().append("{");
                response.getWriter().append("\"success\":" + (product != null ? "\"OK\"" : "\"FAIL\"") + ",");
                response.getWriter().append("\"item\":{" + "\"price\":" + (product.getPrice()) + "," + "\"description\":" + "\"" + product.getDescription() + "\"" + ","
                        + "\"unitMeasure\":" + "\"" +  product.getUnitMeasure().getDescription()  + "\"" + "," + "\"measure\":" + product.getMeasure() + "}");

                response.getWriter().append("}");
                response.getWriter().flush();
                response.getWriter().close();
View Full Code Here

TOP

Related Classes of com.suarte.core.Product

Copyright © 2018 www.massapicom. 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.