<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Fields.aspx.cs" Inherits="MTCUN.Admin.Fields"
    Title="自定义字段-系统" %>

<%@ Import Namespace="MTCUN" %>
<!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="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <div class="tool_Search">
            <asp:DropDownList ID="ddlFieldType" runat="server">
                <asp:ListItem Value="">全部</asp:ListItem>
                <asp:ListItem Value="Student">学员报名(Student)</asp:ListItem>
                <asp:ListItem Value="Class">开设班级(Class)</asp:ListItem>
                <asp:ListItem Value="Potential">潜在登记(Potential)</asp:ListItem>
                <asp:ListItem Value="Users">增加员工(Users)</asp:ListItem>
            </asp:DropDownList>
            <label class="lab_button">
                <asp:Button ID="btnGoto" runat="server" Text="转到" OnClick="btnGoto_Click"></asp:Button>
            </label>
            <label class="lab_button">
                <asp:Button ID="btnStuRole" runat="server" Text="学员角色字段管理" OnClick="btnStuRole_Click"></asp:Button>
            </label>
        </div>
        <div class="both">
        </div>
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
                DataKeyNames="CustomID" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing"
                OnRowUpdating="GridView1_RowUpdating" OnRowDataBound="GridView1_RowDataBound">
                <Columns>
                    <asp:TemplateField HeaderText="隶属表">
                        <ItemTemplate>
                            <%# Eval("TableName")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="字段名称">
                        <ItemTemplate>
                            <%# "Custom" + Eval("CustomIndex")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CustomName" HeaderText="显示名称" />
                    <asp:TemplateField HeaderText="宽度">
                        <ItemTemplate>
                            <%# Eval("CustomWidth")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="tbxCustomWidth" runat="server" Text='<%# Eval("CustomWidth")%>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="显示">
                        <ItemTemplate>
                            <%# Rs.Items.GetYN((int)Eval("CustomState"))%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList runat="server" ID="ddlCustomState" SelectedIndex='<%# Eval("CustomState") %>'>
                                <asp:ListItem Value="0" Selected="True" Text="否"></asp:ListItem>
                                <asp:ListItem Value="1" Text="是"></asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <%--<asp:CommandField HeaderText="编辑" EditText="编辑" CancelText="取消" UpdateText="更新" ShowEditButton="true" />--%>
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divEdit" runat="server">
                                <asp:LinkButton ID="lbnEdit" runat="server" Text="编辑" CommandName="Edit"></asp:LinkButton>
                            </div>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <div class="lab_button_sub">
                                <asp:LinkButton ID="lbnUpdate" runat="server" Text="更新" CommandName="Update"></asp:LinkButton>
                            </div>
                            <div class="lab_button_sub">
                                <asp:LinkButton ID="lbnCancel" runat="server" Text="取消" CommandName="Cancel"></asp:LinkButton>
                            </div>
                        </EditItemTemplate>
                    </asp:TemplateField>

                </Columns>
            </asp:GridView>
        </div>
        <div class="divpanel">
            <b>注意事项：</b><br />
            1、“隶属表”表示数据库中的表名。<br />
            2、“字段名称”表示字段在数据表中的实际名称。<br />
            3、“显示名称”表示字段出现在表单界面上的名称。<br />
            4、“宽度”表示字段呈现的文本控件的宽度，单位为“像素”。<br />
        </div>
    </form>
</body>
</html>
