<%@ 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.formEngine2.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.formCreate.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.jsp"%>
<form name="formHidden" method="post">
   
</form>
<%
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));
    String GLSM = SzConvert.toSpaceStr(request.getParameter("relateName") );
    String sObjectType = SzConvert.toSpaceStr(request.getParameter("ObjectType")); 
    
    boolean flag = true;
    String sUrl = "index.jsp";    
    BdOpenSelectOperator bdOpenSelectOperator = new BdOpenSelectOperator();
    if (sOPERATOR.equals("add") ) {
    	flag = bdOpenSelectOperator.add(request);
    } else if (sOPERATOR.equals("update")) {
    	flag = bdOpenSelectOperator.update(request);
    } else if (sOPERATOR.equals("delete")) {
    	flag = bdOpenSelectOperator.delete(request);    	
    }
    
    String sMessage = SzOut.getMessage();
    if (flag) {
        out.println(SzPageHelp.jsAlert("操作成功"));
        if (sOPERATOR.equals("set")) { //保存才可以
        	String sFunction = "OpenSelectWin";
        	if (sObjectType.equals("101")) {
        		sFunction = "OpenDetailSelectWin";
        	}
%>
  <script language="javascript">  
    //把生成的选择html放到
    var oWindow = window.opener;
    //var id = oWindow.getNewObjectCount("6");
    var vHtml = "";
    vHtml += "<input type='button' name='btnSelect' class='btnClassShort' value='选择' ";  
    vHtml += " OnClick=\"javascript:<%=sFunction%>('<%=GLSM%>');\">";
    oWindow.AddSelectHtml(vHtml);
    window.close();
  </script>
<%
       } else  { 
        out.println(SzPageHelp.jsFormSubmit("formHidden",sUrl));
       }
    } else {
        out.println(SzPageHelp.jsAlertBack(sMessage));
    }
%>

