/*
 * 
 * Created on May 30, 2005
 * 
 * Gy�rgy S�veges
 * Etixpert Kft.
 * Copyright(c) 2005
 * 
 */
package com.etixpert.evolution.gui.servlets.pageactions;

import java.math.BigDecimal;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.etixpert.evolution.*;
import com.etixpert.evolution.gui.servlets.*;
import org.apache.log4j.*;


/**
 * @author Peter Albert
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class new_orderchange_comment extends PageActionHandler {
    protected String newDetails;
    protected String newError;
    protected String toNewPos;
    /**
     * 
     */
    public new_orderchange_comment() {
        super();
        newDetails="new_order_details";
	    newError="new_order_error";
	    toNewPos = "to_new_pos";
    }

    /* (non-Javadoc)
     * @see com.etixpert.evolution.gui.servlets.pageactions.PageActionHandler#handle(javax.servlet.http.HttpServletRequest)
     */
    protected void handle(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpSession session = request.getSession();
        Map m = (Map) session.getAttribute(newDetails);
        String pos = request.getParameter("pos");
        Map mod = (Map)m.get(pos);
        
        String newComment = request.getParameter("comment"+pos);
        
        mod.put("comment", new String[] {newComment});
        session.setAttribute(toNewPos, null);        
    }
    
}
