<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Role.aspx.cs" Inherits="XpShop.Manage.Role" %>
<!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>
    <!--#include file="inc/head.inc"-->
	<title>角色管理</title>
</head>
<body>
    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />
		    <% if(this.Request.QueryString["Action"] == "Manage"){%>管理员列表<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>管理员添加<%}%>
	    </div>
		<div class="sub_container_content">
        <form id="Form1" method="post" runat="server">	       
	        <div class="frame">
                <div class="frame_title"><asp:Label id="lblAction" runat="server" CssClass="tableHeaderText"></asp:Label></div>
                <div class="frame_content">
                    <% if(this.Request.QueryString["Action"] == "Manage"){%>
	                <table class="tableBorder" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
		                <tr>
			                <td height="23" class="forumRowHighlight">
				                <asp:datagrid id="dgRole" runat="server" AllowPaging="False" 
                                    PagerStyle-Mode="NumericPages" AutoGenerateColumns="False"
					                DataKeyField="RoleID" Width="100%" HorizontalAlign="Center" 
                                    HeaderStyle-CssClass="summary-title" ondeletecommand="dgRole_DeleteCommand">
					                <HeaderStyle Font-Bold="True"></HeaderStyle>
					                <Columns>
						                <asp:TemplateColumn HeaderText="序号">
							                <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
							                <ItemStyle HorizontalAlign="Left" Width="60px"></ItemStyle>
							                <ItemTemplate>
								                <%# Container.ItemIndex + 1%>
							                </ItemTemplate>
						                </asp:TemplateColumn>
						                <asp:TemplateColumn HeaderText="角色名称">
							                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
							                <ItemStyle HorizontalAlign="Center" Width="100px"></ItemStyle>
							                <ItemTemplate>
								                <%# DataBinder.Eval(Container.DataItem, "RoleName") %>
							                </ItemTemplate>
						                </asp:TemplateColumn>
						                <asp:TemplateColumn HeaderText="备注">
							                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
							                <ItemStyle HorizontalAlign="Center"></ItemStyle>
							                <ItemTemplate>
								                <%# DataBinder.Eval(Container.DataItem, "Remark") %>
							                </ItemTemplate>
						                </asp:TemplateColumn>
						                <asp:TemplateColumn HeaderText="权限">
							                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
							                <ItemStyle HorizontalAlign="Center" Width="80px"></ItemStyle>
							                <ItemTemplate>
								                <a href='RolePermission.aspx?roleid=<%# DataBinder.Eval(Container.DataItem, "RoleID") %>'>设置</a>
							                </ItemTemplate>
						                </asp:TemplateColumn>
						                <asp:TemplateColumn HeaderText="修改">
							                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
							                <ItemStyle HorizontalAlign="Center" Width="80px"></ItemStyle>
							                <ItemTemplate>
								                <a href='Role.aspx?Action=Modify&roleid=<%# DataBinder.Eval(Container.DataItem, "RoleID") %>'>修改</a>
							                </ItemTemplate>
						                </asp:TemplateColumn>
						                <asp:ButtonColumn HeaderText="删除" Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
							                CommandName="Delete">
							                <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
						                </asp:ButtonColumn>
					                </Columns>
					                <PagerStyle Mode="NumericPages"></PagerStyle>
				                </asp:datagrid>
			                </td>
		                </tr>
	                </table>
	                <%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
	                <table class="tableBorder" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
		                <tr>
			                <td height="23">
				                <table class="ptable" cellSpacing="0" cellPadding="0" width="95%" align="center" border="0">
					                <tr>
						                <th class="tl">
							                角色名称：
						                </th>
						                <td class="tr">
							                <asp:TextBox id="txtRoleName" runat="server"></asp:TextBox><em>*</em>
						                </td>
					                </tr>
					                <tr>
						                <th class="tl">
							                备注：
						                </th>
						                <td class="tr">
							                <asp:TextBox id="txtRemark" width="500px" runat="server"></asp:TextBox>
						                </td>
					                </tr>
					                <tr>
						                <th class="tl">
							                状态：
						                </th>
						                <td class="tr">
                                            <asp:DropDownList ID="ddlStatus" runat="server">
                                            <asp:ListItem Value="1">启用</asp:ListItem>                                
                                            <asp:ListItem Value="0">禁用</asp:ListItem>
                                            </asp:DropDownList>
						                </td>
					                </tr>
					                <tr>
						                <td align="center" colspan="2"><br>
							                <asp:Button id="btnSave" runat="server" Text="保存" onclick="btnSave_Click"></asp:Button>
							                <asp:Button id="btnCancel" runat="server" Text="取消" CausesValidation="False" onclick="btnCancel_Click"></asp:Button></td>
					                </tr>
				                </table>
			                </td>
		                </tr>
	                </table>
	                <%}%>
	            </div>
	        </div>
        </form>
    </div>
</body>
</html>
