package idc.line.command;

import idc.model.IdcCmd;
import idc.model.IdcIPDBDTO;

import java.awt.Checkbox;
import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class IdcLineWriteFormCmd implements IdcCmd 
{

	//라인 등록페이지
	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) 
	{
		String[] s=request.getParameterValues("IdcIPDBCheckList");
		request.removeAttribute("IdcIPDBCheckList");
		
		ArrayList<IdcIPDBDTO> list = (ArrayList<IdcIPDBDTO>) request.getSession().getAttribute("IdcIPDBList");
		ArrayList<IdcIPDBDTO> dto = new ArrayList<IdcIPDBDTO>();
		for(int i=0;i<s.length;i++)
		{
			dto.add(list.get(Integer.parseInt(s[i])));
		}
		request.getSession().setAttribute("IdcIPDBList", dto);
	}

}
