<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*" %>
<%@ page import="com.gx.webpage.framework.util.inoutformat.DataBean" %>
<%@ page import="com.gx.webpage.engine.pagedesigndbengine.factory.PageDesignDbEngineFactory"%>
<%@ page import="com.gx.webpage.engine.pagedesigndbengine.valueobject.*"%>
<%
    boolean isSave = false;
    boolean isError = false;
    String infStr = "";
    String uuid = DataBean.getStr(request, "uuid");
    FormsUiModel fm = null;
    try{
        fm = PageDesignDbEngineFactory.getInstance().getPageDbEngineApi().findFormsUi(uuid,request);
        if(request.getMethod().equalsIgnoreCase("POST")){
            isSave = true;
            String uiName = DataBean.getStr(request, "uiName");
            fm.setUiName(uiName);
            fm = PageDesignDbEngineFactory.getInstance().getPageDbEngineApi().createFormsUi(fm,request);
        }
    }catch(Exception err){
//err.printStackTrace();
        isError = true;
        infStr = DataBean.getErrStr(err);
    }
%>
<head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="./../../../../webpage/common/css/common.css" rel="StyleSheet"  type="text/css" />
<script language="javascript" src="./../../../../webpage/common/engine/constant.js"></script>
<script language="JScript.Encode" src="./../../../../webpage/common/engine/common.js"></script>
<script language="JScript.Encode" src="./../../../../webpage/common/engine/DTFControl.js"></script>
<script language="JScript.Encode" src="./../../../../webpage/common/js/DataReferControl.js"></script>
<script language="JScript.Encode" src="./../../../../webpage/design/js/SqlBuilder.js"></script>
<script language="javascript">
<!--
    function btn_toList(){
        window.navigate("inputList.jsp?uuid=<%=fm.getFormUuid()%>");
    }
    function btn_submit()
    {
        var b = UTIL.checkNull("uiName","请输入查询视图名称．");
        if(b == false)
        {
            return;
        }
        formsAdd.submit();
    }
    function btn_back()
    {
        window.history.back();
    }
//-->
</script>
    <title>修改自定义查询视图</title>
</head>
<body class="main">
<div align="center">
<h3 align="center">修改自定义查询视图</h3>
<%if(!isError){
    if(isSave){
%>
    <p align=center>修改成功．
    <p align=center>
    <input class="butAction" type="button" name="toList" value=" 返回列表 " onclick="btn_toList();">
<%}else{%>
<form id="formsAdd" name="formsAdd" method="POST">
<table class="content">
    <tr>
        <td width=30%>查询视图名称</td><td><input type="text" id="uiName" size=40 name="uiName" value="<%=fm.getUiName()%>"></td>
    </tr>
</table>
<table class="buttable2">
<tr>
    <td width=50% align=center><input class="butAction" type="button" name="add" value="修　　改" onclick="btn_submit();">
    <td width=50% align=center><input class="butAction" type="button" name="toList" value="返回列表" onclick="btn_toList();">
</tr>
</table>
</form>
<%}}else{%>
<p align=center>修改失败．
<p align=center><%= infStr%>
<table class="buttable2">
<tr>
    <td width=50% align=center><input class="butAction" type="button" name="add" value="后　　退" onclick="btn_back();">
    <td width=50% align=center><input class="butAction" type="button" name="toList" value="返回列表" onclick="btn_toList();">
</tr>
</table>
<%}%>
</div>
</body>
</html>
