<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_WebSite_SetController, QianboCMS" EnableEventValidation="false" %>
<!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 type="text/javascript" src="../../Js/Common.js"></script>
    <script type="text/javascript">
        function CheckValidate() {
            if ($("txtControllerName").value.trim().length == 0) {
                alert("链接名称不能为空！");
                return false;
            }
            if ($("txtLinkURI").value.trim().length == 0) {
                alert("链接指向不能为空！");
                return false;
            }
            if (!CheckNumber($("txtOrderNum").value.trim())) {
                alert("排序值必须为非负整数！");
                return false;
            }
            return true;
        }
    </script>
</head>

<body>
    <table border="0" cellpadding="0" cellspacing="1" 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; 我的控制台设置
			</td>
        </tr>
    </table>
    <form id="form1" runat="server">
        <table cellpadding="0" cellspacing="1" class="border" align="center">
            <tr class="wzlist">
                <td style="padding-left: 10px">
					链接名称：<asp:TextBox ID="txtControllerName" runat="server" Width="100px"></asp:TextBox>
                    链接指向：<asp:TextBox ID="txtLinkURI" runat="server" Width="250px"></asp:TextBox>
                    排序：<asp:TextBox ID="txtOrderNum" runat="server" Width="30px"></asp:TextBox>
                    <asp:Button ID="btnAdd" runat="server" Text="添加设置" CssClass="btn" OnClick="btnAdd_Click" OnClientClick="return CheckValidate()" />
                    <asp:Button ID="btnSetDefault" runat="server" OnClick="btnSetDefault_Click" Text="恢复初始值设置" OnClientClick="return confirm('是否确定将控制台恢复为初始设置？');" CssClass="btn" />
				</td>
            </tr>
        </table>
        <asp:GridView GridLines="None" ID="gvController" runat="server" CellPadding="2" CellSpacing="1" CssClass="border" HeaderStyle-CssClass="title" RowStyle-CssClass="tdbg" AutoGenerateColumns="False" OnRowCancelingEdit="gvController_RowCancelingEdit" OnRowEditing="gvController_RowEditing" OnRowUpdating="gvController_RowUpdating" OnRowDeleting="gvController_RowDeleting" HorizontalAlign="Center" OnRowDataBound="gvController_RowDataBound">
            <Columns>
                <asp:BoundField DataField="ControllerName" HeaderText="链接名称" ItemStyle-HorizontalAlign="Left">
                    <ControlStyle Width="85%" />
                    <HeaderStyle />
                </asp:BoundField>
                <asp:BoundField DataField="LinkURI" HeaderText="链接指向">
                    <ControlStyle Width="85%" />
                    <HeaderStyle />
                    <ItemStyle HorizontalAlign="left" />
                </asp:BoundField>
                <asp:BoundField DataField="OrderNum" HeaderText="排序" ItemStyle-Width="90px">
                    <ControlStyle Width="85%" />
                    <HeaderStyle />
                </asp:BoundField>
                <asp:CommandField HeaderText="修改" ShowEditButton="True" EditText="编辑" UpdateText="修改" CancelText="取消" ItemStyle-Width="90px">
                    <HeaderStyle />
                </asp:CommandField>
                <asp:TemplateField HeaderText="删除" ShowHeader="False" ItemStyle-Width="60px">
                    <HeaderStyle />
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkBtnDelete" runat="server" CausesValidation="False" CommandName="Delete" OnClientClick="return confirm('是否确定删除该设置？');" Text="删除"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </form>
    <asp:Literal ID="LitMsg" runat="server"></asp:Literal>
</body>
</html>