<%@ Page Language="C#" AutoEventWireup="true" Inherits="User_FieldView" CodeBehind="FieldView.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>编辑字段</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file="../Css/head.htm"-->
    <script type="text/javascript" language="javascript">

        //关闭弹出层 刷新列表
        function divClose(menuid, bigclassid) {
            parent.$.fancybox.close();
            parent.location = "ManageSignUp.aspx?bigClassId=" + bigclassid + "&menuId=" + menuid;
        };

        function delayClose(menuid, bigclassid) {
            setTimeout("divClose(" + menuid + "," + bigclassid + ")", 1000);
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="scriptManager1" runat="server">
        </asp:ScriptManager>
        <div class="edit-func-box func-box">
            <div class="hd b">
                自定义表单字段编辑
            </div>
            <div class="bd">
                <table class="edit-table">
                    <tr>
                        <th style="width: 15%">字段名称：
                        </th>
                        <td>
                            <asp:TextBox ID="txtName" runat="server" class="input-md"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="txtName"></asp:RequiredFieldValidator>
                        </td>
                        <td>
                            <span class="lgrey">仅允许包含字母(包括中文)和数字，且必须以字母开头</span>
                        </td>
                    </tr>
                    <tr>
                        <th>字段类型：
                        </th>
                        <td>
                            <asp:DropDownList ID="ddlType" runat="server" CssClass="input-md" AutoPostBack="True" OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
                                <asp:ListItem Selected="True" Value="varchar">文本型</asp:ListItem>
                                <asp:ListItem Value="int">数字型</asp:ListItem>
                                <asp:ListItem Value="datetime">日期型</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <span class="lgrey">为生成数据表时字段的类型</span>
                        </td>
                    </tr>
                    <tr>
                        <th>字段长度：
                        </th>
                        <td>
                            <asp:TextBox ID="txtSize" runat="server" class="input-md" MaxLength="4"></asp:TextBox>
                            <asp:RequiredFieldValidator ControlToValidate="txtSize" ErrorMessage="*" ID="RequiredFieldValidator3" runat="server"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtSize" MaximumValue="8000" MinimumValue="1" Type="Integer">*</asp:RangeValidator>
                        </td>
                        <td>
                            <span class="lgrey">做为自动生成录入表单时文本框的宽度依据，最大不超过8000</span>
                        </td>
                    </tr>
                    <tr>
                        <th>显示名称：
                        </th>
                        <td>
                            <asp:TextBox ID="txtShowName" runat="server" class="input-md"></asp:TextBox>
                            <asp:RequiredFieldValidator ControlToValidate="txtShowName" ErrorMessage="*" ID="RequiredFieldValidator2" runat="server"></asp:RequiredFieldValidator>

                        </td>
                        <td>
                            <span class="lgrey">为在用户录入表单中显示的名称</span>
                        </td>
                    </tr>
                    <tr>
                        <th>显示类型：
                        </th>
                        <td>
                            <asp:DropDownList ID="ddlShowType" runat="server" CssClass="input-md">
                                <asp:ListItem Selected="True">单行文本框</asp:ListItem>
                                <asp:ListItem>多行文本框</asp:ListItem>
                                <asp:ListItem Value="多选框">多选框</asp:ListItem>
                                <asp:ListItem>下拉框</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <span class="lgrey">为自动生成用户录入表单时该字段的显示方式</span>
                        </td>
                    </tr>
                    <tr>
                        <th>默认值：
                        </th>
                        <td>
                            <asp:UpdatePanel ID="upd1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtShowValue" runat="server" class="input-md" MaxLength="99"></asp:TextBox>
                                    <asp:CheckBox ID="ckbSystemDate" runat="server" Text="系统当前时间" Visible="false" OnCheckedChanged="ckbSystemDate_CheckedChanged" AutoPostBack="True" />
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="ckbSystemDate" EventName="ckbSystemDate_CheckedChanged" />
                                    <asp:AsyncPostBackTrigger ControlID="ddlType" EventName="ddlType_SelectedIndexChanged" />
                                </Triggers>
                            </asp:UpdatePanel>

                        </td>
                        <td>
                            <span class="lgrey">初始值，如果[显示类型]为“下拉框”有多项用“|”分隔</span>
                        </td>
                    </tr>
                    <tr>
                        <th>允许为空：
                        </th>
                        <td>
                            <asp:DropDownList ID="ddlAllowNull" runat="server" CssClass="input-md">
                                <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                                <asp:ListItem Value="0">否</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <span class="lgrey">选项为“否”时，则在录入数据时为必填项</span>
                        </td>
                    </tr>
                    <tr>
                        <th>是否唯一：
                        </th>
                        <td>
                            <asp:DropDownList ID="ddlIsOnly" runat="server" CssClass="input-md">
                                <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                                <asp:ListItem Value="0">否</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            <span class="lgrey">选项为“是”时，则在录入数据时，该字段不能重复录入</span>
                        </td>
                    </tr>
                    <tr>
                        <th>提示信息：
                        </th>
                        <td>
                            <asp:TextBox ID="txtShowComments" runat="server" class="input-md"></asp:TextBox>

                        </td>
                        <td>
                            <span class="lgrey">为自动生成用户录入表单时对该字段录入信息的提示</span>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="lbIsAddMark" runat="server" Text="是否加水印：" Visible="False" CssClass="input-md"></asp:Label>
                        </th>
                        <td>
                            <asp:DropDownList ID="ddlIsAddMark" runat="server" Visible="False">
                                <asp:ListItem Selected="True" Value="1">是</asp:ListItem>
                                <asp:ListItem Value="0">否</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <th>
                            <asp:Label ID="lbMarkField" runat="server" Text="水印对应字段：" Visible="False"></asp:Label>
                        </th>
                        <td>
                            <asp:DropDownList ID="ddlMarkField" runat="server" Visible="False">
                            </asp:DropDownList>
                        </td>
                        <td></td>
                    </tr>
                </table>
                <div class="ft">
                    <div class="action-field text-center">
                        <asp:Button ID="add" runat="server" CssClass="btn btn-sm btn-primary" Text="保存修改" OnClick="add_Click"></asp:Button>&emsp;
                    <input type="button" class="btn btn-sm btn-primary" value="关 闭" onclick="parent.$.fancybox.close();" />
                        &emsp;<asp:Label ID="labMsg" runat="server" Text="" ForeColor="Red"></asp:Label>
                    </div>
                </div>

            </div>
        </div>
        <!--#include file = "../Css/foot.htm" -->
    </form>
</body>
</html>
