<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_InfoModel_ExtendFieldList, QianboCMS" EnableEventValidation="false" %>
<%@ Import Namespace="Qianbo.BLL.CommonModel" %>
<%@ Import Namespace="Qianbo.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>扩展字段列表</title>
    <link href="../Css/layout.css" type="text/css" rel="stylesheet">
    <script src="../../Js/Common.js" type="text/javascript"></script>
    <script src="../../Js/XmlHttp.js" type="text/javascript"></script>
    <script language="javascript">
        function User_Html() {
            var TypeCount = document.getElementsByName("IsUserHtml");
            for (var i = 1; i < TypeCount.length; i++) {
                if (TypeCount[i].checked) {
                    if (TypeCount[i].value == "False") {
                        document.all.txtUserHtml.readOnly = "True";
                    }
                    else {
                        document.all.txtUserHtml.readOnly = "";
                    }
                }
            }
        }
        function System_Html() {
            var TypeCount = document.getElementsByName("IsSystemHtml");
            for (var i = 1; i < TypeCount.length; i++) {
                if (TypeCount[i].checked) {
                    if (TypeCount[i].value == "False") {
                        document.all.txtSystemHtml.readOnly = "True";
                    }
                    else {
                        document.all.txtSystemHtml.readOnly = "";
                    }
                }
            }
        }
    </script>
</head>

<body>
    <table cellspacing="1" cellpadding="0" class="wzdh" align="center">
        <tr>
            <td style="padding-left: 10px;">
                <img src="../Images/Skin/Default/you.gif" align="absmiddle" />
                您现在的位置：<a href="../SystemInfo.aspx">后台管理</a> &gt;&gt;
                <asp:Literal ID="ColName" runat="server"></asp:Literal>
                &gt;&gt; 扩展字段列表
			</td>
        </tr>
    </table>
    <table cellspacing="0" cellpadding="0" align="center" border="0" class="cd">
        <tbody>
            <tr align="center">
                <td id="Td1" onclick="ShowTabs(0)" class="title5"><a href="SetModelField.aspx?ColId=<%=ColId %>&ModelId=<%=ModelId %>">创建字段</a></td>
                <td id="TabTitle0" onclick="ShowTabs(0)" class="title6">字段列表</td>
                <td id="TabTitle1" onclick="ShowTabs(1)" class="title5">用户界面</td>
                <td id="TabTitle2" onclick="ShowTabs(2)" class="title5">后台界面</td>
                <td>&nbsp;</td>
            </tr>
        </tbody>
    </table>
    <form id="form1" runat="server">
        <table class="editborder" cellspacing="1" cellpadding="0" border="0" align="center">
            <tbody id="Tabs0">
                <tr class="wzlist">
                    <td colspan="2">
                        <table align="center" class="border" cellspacing="1" cellpadding="0">
                            <tr class="title">
                                <td>字段名</td>
                                <td width="180px">字段别名</td>
                                <td width="180px">字段类型</td>
                                <td width="60px">是否必填</td>
                                <td width="90px">排序</td>
                                <td width="90px">管理操作</td>
                            </tr>
                            <asp:Repeater ID="RepExtendField" runat="server" OnItemCommand="RepExtendField_ItemCommand" OnItemDataBound="RepExtendField_ItemDataBound">
                                <ItemTemplate>
                                    <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                        <td align="left" style="padding-left: 5px;">
                                            <asp:Label ID="ColId" Style="display: none;" runat="server" Text='<%#Eval("ColId") %>'></asp:Label>
                                            <%#Eval("Name")%>
										</td>
                                        <td><%#Eval("Alias")%></td>
                                        <td><%# B_ModelField.GetFieldType(Eval("Type","{0}"))%></td>
                                        <td><%# Function.GetStyleTrue(Eval("IsNotNull","{0}"))%></td>
                                        <td><asp:LinkButton ID="LinkButton2" runat="server" CommandName="UpMove" CommandArgument='<%# Eval("FieldId") %>'>上移</asp:LinkButton> | <asp:LinkButton ID="LinkButton3" runat="server" CommandName="DownMove" CommandArgument='<%# Eval("FieldId") %>'>下移</asp:LinkButton></td>
                                        <td>
											<asp:HyperLink ID="HyperLink1" runat="server"><a href="SetModelField.aspx?FieldId=<%# Eval("FieldId") %>&ModelId=<%#Eval("ModelId") %>&ColId=<%# Eval("ColId") %>">修改</a></asp:HyperLink>
											<asp:Label ID="DelLabel" runat="server" Text="|"></asp:Label>
											<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" CommandArgument='<%# Eval("FieldId") %>' OnClientClick="return confirm('是否确定删除此字段？')">删除</asp:LinkButton>
										</td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </td>
                </tr>
            </tbody>
            <tbody id="Tabs1" style="display: none;">
                <tr>
                    <td class="bqleft">手动编辑用户录入界面：</td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="IsUserHtml" runat="server" RepeatDirection="Horizontal" onclick="User_Html()">
                            <asp:ListItem Value="True">开启</asp:ListItem>
                            <asp:ListItem Selected="True" Value="False">关闭</asp:ListItem>
                        </asp:RadioButtonList>
                        <span style="color: red;">*</span>
						选择开启后，新增、编辑、删除、移动任何字段后，都需要手动更改用户录入界面。
					</td>
                </tr>
                <tr>
                    <td class="bqleft">自定义用户录入界面：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtUserHtml" runat="server" TextMode="MultiLine" Style="width: 650px; height: 350px;"></asp:TextBox>
                        <div style="width: 650px; height: 25px; background: #d4d0c8; text-align: right;">
                            <a href="javascript:" onclick="runEx('txtUserHtml')"><img src="../Images/PreView.gif" border="0" title="预览用户录入界面" /></a>
                            <a href="javascript:" onclick="copyToClipboard(document.form1.txtUserHtml.value)"><img src="../Images/copy.gif" border="0" title="复制用户录入样式" /></a>
                            <a href="javascript:" onclick="SizePlus('txtUserHtml')" title="增加编辑高度"><img src="../Images/sizeplus.gif" border="0" /></a>
                            <a href="javascript:" onclick="SizeMinus('txtUserHtml')"><img src="../Images/sizeminus.gif" border="0" title="减少编辑高度" /></a>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft"></td>
                    <td class="bqright">
                        <asp:Button ID="Button1" runat="server" CssClass="btn" Text="更新用户录入界面" OnClick="Button1_Click" />
					</td>
                </tr>
            </tbody>
            <tbody id="Tabs2" style="display: none;">
                <tr>
                    <td class="bqleft">手动编辑管理员录入界面：</td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="IsSystemHtml" runat="server" RepeatDirection="Horizontal" onclick="System_Html()">
                            <asp:ListItem Value="True">开启</asp:ListItem>
                            <asp:ListItem Selected="True" Value="False">关闭</asp:ListItem>
                        </asp:RadioButtonList>
                        <span style="color: red;">*</span>
						选择开启后，新增、编辑、删除、移动任何字段后，都需要手动更改管理员录入界面。
					</td>
                </tr>
                <tr>
                    <td class="bqleft">自己定义管理员录入界面：</td>
                    <td class="bqright">
                        <asp:TextBox ID="txtSystemHtml" runat="server" TextMode="MultiLine" Style="width: 650px; height: 350px;"></asp:TextBox>
                        <div style="width: 650px; height: 25px; background: #d4d0c8; text-align: right;">
                            <a href="javascript:" onclick="runEx('txtSystemHtml')"><img src="../Images/PreView.gif" border="0" title="预览管理员录入界面" /></a>
                            <a href="javascript:" onclick="copyToClipboard(document.form1.txtSystemHtml.value)"><img src="../Images/copy.gif" border="0" title="复制管理员录入界面" /></a>
                            <a href="javascript:" onclick="SizePlus('txtSystemHtml')" title="增加编辑高度"><img src="../Images/sizeplus.gif" border="0" /></a>
                            <a href="javascript:" onclick="SizeMinus('txtSystemHtml')"><img src="../Images/sizeminus.gif" border="0" title="减少编辑高度" /></a>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft"></td>
                    <td class="bqright">
                        <asp:Button ID="Button2" runat="server" CssClass="btn" Text="更新管理员录入界面" OnClick="Button2_Click" />
					</td>
                </tr>
            </tbody>
        </table>
    </form>
    <script>
        User_Html();
        System_Html();
    </script>
    <br />
</body>
</html>