<%@ Page Language="C#" CodeFile="RightsTypeList.aspx.cs" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="RightsTypeList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderToolbar" runat="Server">
    <table id="__tblSubmitImage" height="100%" style="display: none" width="100%">
        <tr>
            <td align="center">
                <img src="../Images/Sumiting.gif" /></td>
        </tr>
    </table>
    <table cellpadding="5" cellspacing="0" class="Navigator" width="100%">
        <tr>
            <td nowrap="nowrap" width="80">
            </td>
            <td align="left">
                <font class="NavigatorTitle">公告管理->公告信息管理</font></td>
            <td width="150">
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderList" runat="Server">
    <div>
        <table cellspacing="0" cellpadding="5" align="center" runat="server" id="tblQuery">
            <tr>
                <td>
                    共
                    <asp:Label ID="lblRecordCount" runat="server" ForeColor="Red" />條記錄，分
                    <asp:Label ID="lblPageCount" runat="server" ForeColor="Red" />頁顯示，每页显示
                    <asp:TextBox ID="txtPageSize" runat="server" Width="32px" CssClass="treemenu" Text="10" /><asp:RequiredFieldValidator
                        ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPageSize" Display="None"
                        EnableViewState="False" ErrorMessage="请填写每页显示数量！"> 
					*
                    </asp:RequiredFieldValidator><asp:RangeValidator ID="RangeValidator1" runat="server"
                        ErrorMessage="每页显示数量必须为正整数！" Type="Integer" MinimumValue="0" MaximumValue="100000000"
                        Display="None" ControlToValidate="txtPageSize" EnableViewState="False">
				*
                    </asp:RangeValidator>
                    条，当前为
                    <asp:TextBox ID="txtCurrentPage" runat="server" Width="32px" CssClass="textboxmoney">
					1
                    </asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                        ControlToValidate="txtCurrentPage" Display="None" EnableViewState="False" ErrorMessage="请填写页码！">
				*
                    </asp:RequiredFieldValidator><asp:RangeValidator ID="RangeValidator2" runat="server"
                        ErrorMessage="非法的页码" Type="Integer" MinimumValue="0" MaximumValue="100000000"
                        Display="None" ControlToValidate="txtCurrentPage" EnableViewState="False">
					*
                    </asp:RangeValidator>頁
                    <asp:Button ID="btnGo" runat="server" Text="Go..." EnableViewState="False" OnClick="btnGo_Click">
                    </asp:Button><input type="button" value="新增" onclick="OpenAdd()" /><asp:ValidationSummary
                        ID="pageValidation" runat="server" ShowSummary="False" ShowMessageBox="True"
                        EnableViewState="False"></asp:ValidationSummary>
                </td>
            </tr>
        </table>
    </div>
    <div style="width: 100%">
        <asp:GridView ID="dgResult" runat="server" AllowSorting="True" AllowPaging="True"
            OnRowDeleting="dgResult_RowDeleting" OnRowCommand="dgResult_RowCommand" OnSorting="dgResult_Sorting"
            AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderWidth="1px"
            CellPadding="5">
            <SelectedRowStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedRowStyle>
            <RowStyle ForeColor="#330099" BackColor="White"></RowStyle>
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" BackColor="#DDDDDD">
            </HeaderStyle>
            <FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
            <Columns>
                <asp:TemplateField SortExpression="TypeID" HeaderText="TypeID">
                    <ItemTemplate>
                        <asp:Label ID="labTypeID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"TypeID")%>' /></ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="SubSystemID" SortExpression="SubSystemID" HeaderText="子系统编号" />
                <asp:BoundField DataField="TypeName" SortExpression="TypeName" HeaderText="权限类别名称" />
                <asp:BoundField DataField="ParentTypeID" SortExpression="ParentTypeID" HeaderText="父类编号" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="btnEdit" runat="server" NavigateUrl='<%# "javascript:OpenEdit(\"" + DataBinder.Eval(Container.DataItem,"TypeID") + "\");"%>'>编辑</asp:HyperLink>
                        <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return confirm('你确定要删除吗？')"
                            CommandArgument='<%# DataBinder.Eval(Container.DataItem,"TypeID") %>' CommandName="Delete">刪除</asp:LinkButton>
                      <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%# "RightsList.aspx?subsystemid=" + (string)ViewState["SubSystemID"] + "&typeid=" + DataBinder.Eval(Container.DataItem,"TypeID") %>'>管理</asp:HyperLink>
                            </ItemTemplate>            
                </asp:TemplateField>
            </Columns>
            <PagerTemplate>
            </PagerTemplate>
        </asp:GridView>
    </div>
    <table align="center" bgcolor="#e9e9e9" width="100%">
        <tr>
            <td style="text-align: right">
                <asp:LinkButton ID="lbtnFirst" runat="server" Text="首页" OnClick="lbtnFirst_Click" /><asp:LinkButton
                    ID="lbtnPrevious" runat="server" Text="上一页" OnClick="lbtnPrevious_Click" /><asp:LinkButton
                        ID="lbtnNext" runat="server" Text="下一页" OnClick="lbtnNext_Click" /><asp:LinkButton
                            ID="lbtnLast" runat="server" Text="末页" OnClick="lbtnLast_Click" /></td>
        </tr>
    </table>

    <script language="javascript">
		function OpenAdd(){
	location.href("RightsTypeEdit.aspx?action=add");
		}
		function OpenEdit(TypeID){
		location.href("RightsTypeEdit.aspx?action=edit"
			+ "&amp;TypeID=" + TypeID);
		}
    </script>

</asp:Content>
