<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.formCreate.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.jsp"%>
<%
    strLevel_SESSION = "../../../";
    strSkin_SESSION = "../../../images/skin1";
    
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));   
		String name = SzConvert.strWriteData(request.getParameter("name") );
%>
<form name="formHidden" method="post">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>"> 
</form>
<%

    boolean flag = true;
    String sUrl = "index.jsp";
    BdModuleOperator bdModuleOperator = new BdModuleOperator();
    String strPath = "";
    if (sOPERATOR.equals("add") ) {
    	flag = bdModuleOperator.add(request);
    } else if (sOPERATOR.equals("update")) {
    	flag = bdModuleOperator.update(request);    	
    } else if (sOPERATOR.equals("delete")) {
    	flag = bdModuleOperator.delete(request);    	
    } else if (sOPERATOR.equals("export")) {
    	BdFormExport bdFormExport = new BdFormExport();
    	bdFormExport.formExport(name);
    	strPath = bdFormExport.getZipName(name);
    }
    
    String sMessage = SzOut.getMessage();
    if (flag) {    	
        if (sOPERATOR.equals("export")) {
            out.println(SzPageHelp.jsFormSubmitBlank("formHidden", "../../../down.jsp?tablename=export&filename=" + strPath));
        } else {    	
        	out.println(SzPageHelp.jsAlert("操作成功"));
        }
        out.println(SzPageHelp.jsFormSubmit("formHidden",sUrl));
    } else {
        out.println(SzPageHelp.jsAlertBack(sMessage));
    }
%>
