<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TabSecrity.aspx.cs" Inherits="Portal.Portal.TabSecrity" %>
 <%@ Register src="../UserControls/TabSecMenu.ascx" tagname="TabSecMenu" tagprefix="uc1" %>
 <!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>
    <script type="text/javascript" src="../Javascript/jquery-1.9.1.min.js"></script>
    <style>
    .slide li { border-bottom:dotted 1px #cccccc; line-height:29px;}
    #tip{  margin:10px;   }
    
     .btn {
border: 1px solid #919699;
background: #fcfcfc;
text-align: center;
text-decoration: none;
cursor: pointer;
font-size: 12px;
padding-left: 10px;
padding-right: 10px;
padding-top: 4px;
padding-bottom: 4px;
}

    </style>
</head>
<body style=" font-family:Verdana; font-size:12px;">
    <form id="form1" runat="server">
    <div>
    
    
     <table width="850px">
     <tr valign="top">
     
     <td   style=" width:180px; background-color:#eeeeee; height:1000px; padding-top:10px;">
     
   <uc1:TabSecMenu ID="TabSecMenu1" runat="server" />
   
     
     </td>
     
     <td>
      <fieldset> 
       <div id="tip"></div>
      </fieldset>

      <div style=" width:650px; text-align:right; padding-right:20px; margin-bottom:10px;">
         <asp:HyperLink ID="hl_addright" runat="server"   style=" text-decoration:underline">
         <img src="../Images/add.gif" style="border-width:0px; vertical-align:middle" /> 添加权限 Add Right</asp:HyperLink>
     </div>


     
     <div style=" margin-left:5px;">
         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
             DataKeyNames="id" DataSourceID="SqlDataSource1" BackColor="White" 
             BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
             ForeColor="Black" GridLines="Horizontal" Width="650px">
             <Columns>
              
                 <asp:BoundField DataField="id" HeaderText="编号" InsertVisible="False" 
                     ReadOnly="True" SortExpression="id"  />
               
                 <asp:BoundField DataField="tabid" HeaderText="编号"  Visible="false" SortExpression="tabid" />
                
                 <asp:BoundField DataField="name" HeaderText="角色/帐户名称" SortExpression="name" />
                
             
                     <asp:TemplateField>
                     <HeaderTemplate>角色属性</HeaderTemplate>
                     <ItemTemplate>
                     <%#Eval("attribute").ToString() == "user" ? "用户User" : "组Group"%>
                     </ItemTemplate>
                     </asp:TemplateField>
                     
                
                      <asp:TemplateField>
                     <HeaderTemplate>权限属性</HeaderTemplate>
                     <ItemTemplate>
                     <%#GetRightName(Eval("roletype"))%>
                    
                     </ItemTemplate>
                     </asp:TemplateField>
                     
                     
        <asp:CommandField ShowDeleteButton="True" ButtonType="Button"   DeleteText="删除" ControlStyle-CssClass="btn" />
             </Columns>
            
     <HeaderStyle BackColor="#E0E0E0" Font-Bold="True"   HorizontalAlign="Left" />
      <AlternatingRowStyle BackColor="#F2F2F2" />
      <RowStyle BackColor="#ffffff"  Height="28"/>
    <PagerSettings Mode="NumericFirstLast" />    
    
         </asp:GridView>
         </div>
         
         <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
             ConnectionString="<%$ConnectionStrings:connectionstring %>" 
             DeleteCommand="DELETE FROM [portal_tabsecurity] WHERE [id] = @id  " 
            
           
             SelectCommand="SELECT * FROM [portal_tabsecurity] WHERE (([roletype] = @roletype) AND ([tabid] = @tabid)) and sectype=@sectype ORDER BY [id] DESC" 
     >
             <SelectParameters>
                 <asp:QueryStringParameter Name="roletype" QueryStringField="roletype"   Type="Int32" />
                 <asp:QueryStringParameter Name="tabid" QueryStringField="tabid" Type="Int32" />
                 <asp:QueryStringParameter Name="sectype" QueryStringField="sectype"  />
             </SelectParameters>
             
             <DeleteParameters>
                 <asp:Parameter Name="id" Type="Int32" /> 
             </DeleteParameters>
             
           
         </asp:SqlDataSource>
     
     </td>
     
     </tr>
     
     </table>
   
    
   
    
    </div>



     


<asp:HiddenField runat="server" ID="hf_menuid" ClientIDMode="Static" />

<script>
    $(document).ready(

    function () {

        menuid = $("#hf_menuid").val();

        $("#a" + menuid).css("font-weight", "bold");

        switch (menuid) {

            case "":
                $("#tip").html("提示：请从左边选择相应的权限。");
                break;

            case "0":
                $("#tip").html("提示：查看权限Read设定用户/组具有查看的权限。");
                break;

            case "1":
                $("#tip").html("提示：修改权限允许修改内容，修改用户的权限会自动具有查看权限");
                break;

            case "2":
                $("#tip").html("提示：设计权限能够修改左边导航，设计用户的权限会自动具有修改的权限。");
                break;

        }


    }


    );
  
</script>

    </form>
</body>
</html>
