package servlet;

import core.process.C_StudentFillGraduationDesignInformation;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

@WebServlet("/home/student-fill-graduation-design-information")
public class S_StudentFillGraduationDesignInformation extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String id = request.getParameter("id");
        Map<String,String> vMap = servlet.Utils.getVMap(vName,request);

        C_StudentFillGraduationDesignInformation p=new C_StudentFillGraduationDesignInformation();
        p.setGraduationDesignId(id);
        p.setVMap(vMap);
        try {
            p.fillInformation();
        } catch (Exception e) {
            e.printStackTrace();
            response.sendRedirect("/op_fail.jsp");
        }

    }
    static String[] vName = {
            "chinese_name",
            "english_name",
            "type_of_topic",
            "source_of_design",
            "nature_of_design",
            "description_of_topic"
    };
}
