<%@ page language="C#" autoeventwireup="true" inherits="admin_field_FieldList, DianCMS" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Import Namespace="D.BLL" %>
<%@ Import Namespace="D.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 id="CssName" rel="stylesheet" type="text/css" runat="server" />

    <script language="javascript" src="../../js/Common.js"></script>

    <script src="../../js/lhgdialog/lhgcore.lhgdialog.min.js?self=true&skin=<%=Function.GetCssNameColor()%>" type="text/javascript"></script>

    <script src="../../js/<%=B_Lang.getLang() %>/SelectCheckBox.js" language="javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <table class="dh" cellpadding="0" cellspacing="0" border="0" align="center">
        <tr>
            <td>
                <asp:Image ID="P_Go" runat="server" ImageAlign="AbsMiddle" />
                您现在的位置：<a href="../info.aspx">后台管理</a> >> 字段列表
            </td>
        </tr>
    </table>
    <table class="dh3" cellpadding="0" cellspacing="0" border="0" align="center">
        <tr>
            <td style="padding-left: 10px">
                <a href="setfield.aspx?tableName=<%=Request.QueryString["tableName"] %>">添加字段</a>
            </td>
        </tr>
    </table>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table align="center" cellpadding="2" cellspacing="1" width="99%" class="border">
                <tr class="title">
                    <td class="t1">
                        选择
                    </td>
                    <td>
                        字段名
                    </td>
                    <td>
                        字段别名
                    </td>
                    <td>
                        字段类型
                    </td>
                    <td width="10%">
                        是否必填
                    </td>
                    <td width="15%">
                        排序
                    </td>
                    <td width="30%">
                        管理操作
                    </td>
                </tr>
                <asp:Repeater ID="RepField" runat="server" OnItemCommand="RepField_ItemCommand">
                    <ItemTemplate>
                        <tr class="tdMoveTr" onmouseover="this.className='tdMoveTrBg'" onmouseout="this.className='tdMoveTr'">
                            <td align="center" class="t1">
                                <asp:CheckBox ID="CheckBox1" runat="server" /><asp:TextBox ID="txtFieldId" runat="server" Text='<%# Eval("FieldId") %>' style="display:none"></asp:TextBox>
                            </td>
                            <td>
                                <%#Eval("Alias")%>
                            </td>
                            <td>
                                <%#Eval("Name")%>
                            </td>
                            <td align="center">
                                <%# B_Field.GetFieldType(Eval("FieldData", "{0}"))%>
                            </td>
                            <td align="center">
                                <%# Function.GetStyleTrue(Eval("IsNotNull","{0}"))%>
                            </td>
                            <td align="center">
                                <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Up" CommandArgument='<%# Eval("FieldId")+","+Eval("OrderId") %>'>上移</asp:LinkButton>
                                ┊
                                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Down" CommandArgument='<%# Eval("FieldId")+","+Eval("OrderId") %>'>下移</asp:LinkButton>
                            </td>
                            <td align="center">
                                <a href="SetField.aspx?TableName=<%=TableName %>&FieldId=<%#Eval("FieldId") %>">修改</a>
                                ┊ <a href="javascript:WinOpenLhgDialog('更新字段值','../field/SetFieldValue.aspx?FieldId=<%# Eval("FieldId") %>',650,280,'')">
                                    更新字段值</a> ┊
                                <asp:LinkButton ID="lnkDelete" runat="server" Text="删除" CommandName="delete" CommandArgument='<%#Eval("FieldId") %>'
                                    OnClientClick="return confirm('您确定要删除该字段吗?')"></asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <table cellpadding="0" cellspacing="1" class="dh2" align="center">
        <tr>
            <td height="30">
                <input id="checkDel" onclick="CheckDelBox(this)" type="checkbox"><span id="ShowA">选择全部</span>
                <asp:Button ID="ButCopyField" runat="server" Text="复制选中字段到指定模型" CssClass="btn" 
                    Style="margin-left: 10px" onclick="ButCopyField_Click"/>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
