<%@ Import Namespace="SWTraining" %>

<%@ Page Language="c#" CodeBehind="Dictionary.aspx.cs" AutoEventWireup="True" Inherits="SWTraining.Admin.Dictionary"
    Title="系统设置-字典设置" %>

<!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">
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div id="sw_content">
        <div class="divpanel">
            字典名称：
            <asp:TextBox ID="tbxDictionaryName" runat="server"></asp:TextBox>
            类型：
            <asp:DropDownList ID="ddlDictionaryType" runat="server">
                <asp:ListItem Value="1">上课规律</asp:ListItem>
                <asp:ListItem Value="2">学员称呼</asp:ListItem>
                <asp:ListItem Value="3">年级</asp:ListItem>
                <asp:ListItem Value="4">班级</asp:ListItem>
                <asp:ListItem Value="5">职务</asp:ListItem>
                <asp:ListItem Value="6">学历</asp:ListItem>
                <asp:ListItem Value="7">工作单位</asp:ListItem>
            </asp:DropDownList>
            <asp:Button ID="btnGo" runat="server" Text="转到" OnClick="btnGo_Click"></asp:Button>
            <asp:Button ID="btnAdd" runat="server" Text="增加" OnClick="btnAdd_Click"></asp:Button>
        </div>
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
                DataKeyNames="DictionaryID" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowCommand="GridView1_RowCommand"
                OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowCreated="GridView1_RowCreated"
                OnRowDeleting="GridView1_RowDeleting" OnRowDataBound="GridView1_RowDataBound">
                <Columns>
                    <asp:BoundField DataField="DictionaryID" ReadOnly="True" HeaderText="字典编号" />
                    <asp:BoundField DataField="DictionaryName" HeaderText="字典名称" />
                    <asp:TemplateField HeaderText="状态">
                        <ItemTemplate>
                            <%# Rs.Items.GetLockState((int)Eval("LockState"))%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList runat="server" ID="ddlLockState" SelectedIndex='<%# Eval("LockState") %>'>
                                <asp:ListItem Value="0" Text="禁用"></asp:ListItem>
                                <asp:ListItem Value="1" Text="启用"></asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="排序">
                        <ItemTemplate>
                            <asp:LinkButton ID="btnUp" runat="server" CommandName="Up" Text="↑"></asp:LinkButton>
                            <asp:LinkButton ID="btnDo" runat="server" CommandName="Do" Text="↓"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField HeaderText="编辑" EditText="编辑" CancelText="取消" UpdateText="更新" ShowEditButton="true" />
                    <asp:TemplateField HeaderText="删除">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div class="divpanel">
            <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
        </div>
        <div class="divremark">
            <b>注意事项：</b><br />
            字典：自动采集记录文本字段的值，下次使用时会自动弹出供选择。（类似下拉列表）<br />
        </div>
    </div>
    </form>
</body>
</html>
