<%@ Page Language="c#" AutoEventWireup="true" Inherits="Web.Wpdcc.manageManager" CodeBehind="manageManager.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>manage Manager</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/adminCss.htm" -->
    <script lang="javascript" type="text/javascript" src="../Js/pwdintensity.js"></script>
    <script lang="javascript" type="text/javascript">				
            	
	    function Delconfirm(adminName){
	        var str = "您确定要删除管理员“"+adminName +"”吗？";
	        if (adminName.toString() =="")  {
	            str = "您确定要删除当前选中的管理员吗？";  //传入参数失败，#Eval("pkId")方式不行，奇怪！ 施健
	            }
	        return confirm(str);
	        
	    }
        
        $(document).ready(function(){        
            
            $(".FancyBox").click().fancybox({
                'width'		: 510,
				'height'	: 320,
				'hideOnOverlayClick': false,
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'type': 'iframe',
				'padding': '0'
            });
            
            
            $("#FancyBox_reg").click().fancybox({
                'width'		: 510,
				'height'	: 320,
				'hideOnOverlayClick': false,
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'type': 'iframe',
				'padding': '0',
				'href' : 'adminPassword.aspx?pkid=0'
            });
            /*列表高度*/
            $('.function-bd').height($(window).innerHeight() - 100);

            $(window).resize(function () {
                $('.function-bd').height($(window).innerHeight() - 100);
            });
        });
    
        //防止用户恶意保存
        function checkSave(){
            if (confirm("确定保存吗？") == true)
            {
                return true;
            }
            else{
                return false;
            }
        }
    </script>

</head>
<body>
    <div class="list-func-box func-box">
        <div class="hd">
            您的位置：用户管理设置 &gt; 管理员管理<!--/breadcrumb-->
            <div class="user-service">
                <a class="help" href="#" title="设计控制中心管理员可修改管理员账号">帮助</a></div>
            <!--/user-service-->
        </div>
        <form id="Form1" method="post" runat="server">
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                    用户筛选：
                    <asp:DropDownList ID="ddlUserType" runat="server" CssClass="drop-txt" AutoPostBack="True" OnSelectedIndexChanged="ddlUserType_SelectedIndexChanged">
                        <asp:ListItem Selected="True" Value="0">全部用户</asp:ListItem>
                        <asp:ListItem Value="1">网站用户</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <!--/search-box-->
                <div class="action-field">
                    <asp:Button ID="btnSavelist" class="btn" TabIndex="1" runat="server" Text="保存列表" CausesValidation="False" OnClientClick="return checkSave();" OnClick="btn_Click"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="button" id="FancyBox_reg" class="btn" value="添加管理员" />
                </div>
                <!--/action-field-->
            </div>
            <div class="function-bd" style="overflow: auto;">
            <asp:DataGrid ID="adminDataGrid" class="list-table" runat="server" AutoGenerateColumns="False"
                Width="100%" OnItemCommand="adminDataGrid_ItemCommand">
                <Columns>
                    <asp:BoundColumn DataField="pkId" HeaderText="ID号" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="adminName" HeaderText="管理员帐号" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="fullName" HeaderText="管理员名称" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="操作权限设置" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="allowEditOthersAdmin" runat="server" Enabled='<%#Eval("pkId").ToString() == "1" ? false : true %>'
                                SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.allowEditOthersAdmin") %>' CssClass="drop-txt" Width="100">
                                <asp:ListItem Value="0" Selected="True">无权限</asp:ListItem>
                                <asp:ListItem Value="1">只读</asp:ListItem>
                                <asp:ListItem Value="2">允许修改</asp:ListItem>
                                <asp:ListItem Value="3">修改删除</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="等同于超级管理员权限" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="isEqualAdmin" runat="server" Enabled='<%#Eval("pkId").ToString() == "1" ? false : true %>'
                                SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.isEqualAdmin") %>' CssClass="drop-txt" Width="60">
                                <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                <asp:ListItem Value="1">是</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="网站数据权限设置" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="allowAllAssign" runat="server" Enabled='<%#Eval("pkId").ToString() == "1" ? false : true %>'
                                SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.allowAllAssign") %>' CssClass="drop-txt">
                                <asp:ListItem Value="0" Selected="True">无权限</asp:ListItem>
                                <asp:ListItem Value="1">备份权限</asp:ListItem>
                                <asp:ListItem Value="2">备份恢复权限</asp:ListItem>
                                <asp:ListItem Value="3">备份恢复及删除</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="登录" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="allowLogin" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.allowLogin") %>' CssClass="drop-txt" Width="60">
                                <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                <asp:ListItem Value="1">允许</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="执行" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <a class="FancyBox blue" href='adminPassword.aspx?pkid=<%#Eval("pkid") %>'>修改</a>&nbsp;&nbsp;
                            <asp:LinkButton ID="del" runat="server" CssClass="blue" CausesValidation="false" CommandName="del" OnClientClick="return Delconfirm('');" ToolTip='<%#Eval("adminName") %>' >删除</asp:LinkButton>&nbsp;&nbsp;
                            <asp:LinkButton ID="assign" runat="server" CausesValidation="False" >
                                <a class="FancyBox blue" href='managerAccredit.aspx?pkId=<%#Eval("pkid") %>&name=<%#Eval("adminName") %>'>布局管理授权</a>
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                </Columns>
            </asp:DataGrid>
                </div>
        </div>
        </form>
    </div>
</body>
</html>
