<%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="general_role" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>角色管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <link href="../../styles/1/style.css" rel="stylesheet" type="text/css" />

    <script>
function delete_priv(USER_PRIV)
{
 msg="确认要删除该角色么？";
 if(window.confirm(msg))
 {
  URL="delete.php?USER_PRIV="+USER_PRIV;
  window.location=URL;
 }
}
    </script>

</head>
<body class="bodycolor" topmargin="5">
    <table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
        <tr>
            <td class="Big">
                <img src="~/images/notify_new.gif" align="absmiddle" id="IMG1" runat="server"><span
                    class="big3"> 新建角色</span><br>
            </td>
        </tr>
    </table>
    <div align="center">
        <input type="button" value="新建角色" class="BigButton" onclick="location='role_add.aspx';"
            title="新建角色">
    </div>
    <br>
    <table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
        <tr>
            <td background="../../images/dian1.gif" width="100%">
            </td>
        </tr>
    </table>
    <table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
        <tr>
            <td class="Big">
                <img src="~/images/notify_open.gif" width="22" height="20" align="absmiddle" id="IMG2"
                    runat="server"><span class="big3"> 管理角色</span>
            </td>
        </tr>
    </table>
    <br>
    <div align="center">
        <form runat="server" id="form1">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="USER_PRIV" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Width="700px" OnRowDataBound="GridView1_RowDataBound">
                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <Columns>
                    <asp:BoundField DataField="PRIV_NO" HeaderText="角色排序号" SortExpression="PRIV_NO">
                        <ItemStyle Width="20%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="PRIV_NAME" HeaderText="角色名称" SortExpression="PRIV_NAME">
                        <ItemStyle Width="30%" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl='<%# Eval("USER_PRIV", "role_edit.aspx?id={0}") %>'>编辑角色</asp:HyperLink>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("USER_PRIV", "MakeRole.aspx?id={0}") %>'>编辑权限</asp:HyperLink>&nbsp;
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete">删除</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <RowStyle BackColor="#E3EAEB" />
                <EditRowStyle BackColor="#7C6F57" />
                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:hqglConnectionString %>" DeleteCommand="delete from [user_priv] where USER_PRIV=@USER_PRIV" SelectCommand="SELECT [USER_PRIV], [PRIV_NAME], [PRIV_NO] FROM [user_priv] order by [priv_no]">
                <DeleteParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="USER_PRIV" PropertyName="SelectedValue" />
                </DeleteParameters>
            </asp:SqlDataSource>
        </form>
    </div>
</body>
</html>
