<%@ Page Language="c#" Inherits="Web.User.manageLinkGroup" CodeBehind="manageLinkGroup.aspx.cs" %>

<%@ Register Src="~/Module/pageNavi.ascx" TagPrefix="uc1" TagName="pageNavi" %>
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>managelinkgroup</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file="../Css/head.htm"-->
</head>
<body>
        <form id="newsMange" method="post" runat="server">
            <div class="breadcrumbs" >
                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa  fa-desktop"></i>
                <%--<asp:PlaceHolder ID="placeHead" runat="server"></asp:PlaceHolder>--%>
                        <asp:Label ID="lbpageNav" runat="server" Text=""></asp:Label>
                    </li>
                </ul>
            </div>
            <!--/breadcrumb-->
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <div class="page-content">
                        <div class="page-header clearfix">
                            <div class="pull-left">
                                <asp:Button ID="btnSave" cssclass="btn btn-sm btn-primary" runat="server" Text="保 存" OnClick="Btn_Click"></asp:Button>
                                &nbsp;
                    <asp:Button ID="btnAdd" cssclass="btn btn-sm btn-primary" runat="server" Text="添 加"></asp:Button>
                                &nbsp;
                    <asp:Button ID="btnDel" cssclass="btn btn-sm btn-primary" runat="server" Text="删 除" OnClick="Btn_Click"></asp:Button>
                                &emsp;
                    <asp:Label ID="lbTip" runat="server" ForeColor="Red" Text=""></asp:Label>
                            </div>
                <!--/action-field-->
            </div>
                <div class="row">
                     <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
                                <ContentTemplate>  
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
            <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
            <asp:HiddenField ID="hfidstr" runat="server" />
            <asp:HiddenField ID="hftitlestr" runat="server" />
            <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand"  cssclass="table table-striped table-bordered table-hover table-sorting" 
                OnRowDataBound="GridView1_RowDataBound"  EmptyDataText="暂无数据…" OnSorting="GridView1_Sorting" >
                <Columns>
                    <asp:TemplateField HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-center" ItemStyle-Width="36px">
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbAll" Text=" " runat="server" onclick="GridSelectAll('GridView1',this.checked)" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbthis" runat="server" Text=" "></asp:CheckBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                     <asp:BoundField DataField="pkId" HeaderText="ID号" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden" FooterStyle-CssClass="hidden"></asp:BoundField>
                      <asp:BoundField Visible="False" DataField="grade" HeaderText="等级" ></asp:BoundField>
                    <asp:TemplateField HeaderText="组名称"  SortExpression="groupName" >
                        <ItemTemplate>
                            <asp:Label ID="groupName" runat="server" Text='<%# Eval("groupName") %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="描述" SortExpression="remark" >
                        <ItemTemplate>
                            <asp:Label ID="remark" runat="server" Text='<%# Eval("remark") %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="顺序" SortExpression="ordering" >
                        <ItemTemplate>
                            <asp:TextBox ID="ordering" MaxLength="6" class="input-md priority" Style="width: 45px;" runat="server" Text='<%# Eval("ordering") %>'>
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="显示等级" SortExpression="gradeId" >
                        <ItemTemplate>
                                                <asp:DropDownList Width="90" ID="gradeDrop" runat="server" DataSource="<%# dt_grade %>" DataTextField="name" DataValueField="pkId" SelectedValue='<%# Eval("gradeId") %>'>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="浏览权限" SortExpression="gate"  HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden" FooterStyle-CssClass="hidden" >
                        <ItemTemplate>
                            <asp:DropDownList ID="gate" runat="server" SelectedValue='<%# Eval("gate") %>'>
                                <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:TemplateField>
                    <asp:TemplateField HeaderText="是否显示" SortExpression="isShow" >
                        <ItemTemplate>
                            <asp:DropDownList ID="isShowDropDownList" runat="server" SelectedValue='<%# Eval("isShow") %>'>
                                <asp:ListItem Value="0">不显示</asp:ListItem>
                                <asp:ListItem Value="1">显示</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="排序"  Visible="false" >
                        <ItemTemplate>
                            <asp:TextBox ID="Priority" runat="server" MaxLength="6" Text='<%#Eval("Priority")%>' class="input-md" Style="width: 45px;"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="管理">
                        <ItemTemplate>
                                                <div class="action-buttons">
                                                    <asp:LinkButton ID="edit" runat="server" CssClass="FBox" data-toggle="tooltip" data-placement="bottom" title="编辑"  Visible="false"><i class="ace-icon fa fa-pencil bigger-120 blue" ></i></asp:LinkButton>
                                                    <asp:LinkButton ID="edit1" runat="server"  data-toggle="tooltip" data-placement="bottom" title="对不起，您没有权限编辑！" Visible="false" Enabled="false"><i class="ace-icon fa fa-pencil bigger-120 grey" ></i></asp:LinkButton>
                                                    <asp:LinkButton ID="linkGangsLinkButton" runat="server" CommandName="editLinkGang" data-toggle="tooltip" data-placement="bottom" title="链接项管理" CommandArgument='<%# Eval("pkId") %>' ><i class="ace-icon fa fa-link bigger-120 light-grey" ></i></asp:LinkButton>
                                                </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                   <asp:BoundField Visible="False" DataField="grade" HeaderText="等级" ></asp:BoundField>
                </Columns>
            </asp:GridView>
                        <div class="grid-pager">                              
                                <uc1:pageNavi runat="server" id="pageNavi"  dataCtlName="GridView1" />
                         </div> 
            <!--[if lte IE 7]></div><![endif]-->
       <%-- <div class="ft">
            <div class="pagination">
                <asp:Label ID="showPage" runat="server"></asp:Label>
            </div>
        </div>--%>
                        <!-- PAGE CONTENT ENDS -->
                    </div>
                                    </ContentTemplate>
                                    </asp:UpdatePanel>
                </div>
            </div>
        </form>
    <!--#include file="../Css/foot.htm"-->
     <script type="text/javascript">
         jQuery(function ($) {

             $("#btnSave").click(function () {
                 return GridSelectCheck('GridView1', true);
             });

             $("#btnDel").click(function () {
                 return GridSelectCheck('GridView1', true);
             });

             $("#btnAdd").click(function () {
                 $.fancybox({
                     'type': 'iframe',
                     'width': 600,
                     'height': 300,
                     'hideOnOverlayClick': false,
                     'padding': '0',
                     'href': 'addlinkgroup.aspx?bigClassId=<%= bigClassId %>&menuId=<%= menuId %>'
                });
                return false;
            });

            $(".FBox").click(function () {
                var h = $(this).attr('disabled');
                if (h == "disabled") {
                    $.fancybox.cancle();
                }
            }).fancybox({
                'width': 600,
                'height': 300,
                'hideOnOverlayClick': false,
                'transitionIn': 'elastic',
                'transitionOut': 'elastic',
                'padding': '0',
                'type': 'iframe'
            });
        });
        //选中背景特效
        //$(function () {
        //    $('.text-center input').click(function () {
        //        $(this).parents('tr').toggleClass('active');
        //    })

        //    $('.title.text-center input').click(function () {

        //        if ($('.list-table tr:first').hasClass('active')) {
        //            $('.list-table tr').addClass('active');
        //        } else {
        //            $('.list-table tr').removeClass('active');
        //        }
        //    })

        //    $('.table select').change(function () {
        //        //背景选中
        //        if ($(this).parents('tr').hasClass('active')) {

        //        } else {
        //            $(this).parents('tr').toggleClass('active');
        //        }

        //        //复选框选中
        //        var checkbox = $(this).parents("tr").find("input");
        //        for (var i = 0; i < checkbox.length; i++) {
        //            if (checkbox[i].type == 'checkbox') {
        //                checkbox[i].checked = true;
        //            }
        //        }

        //    })

        //    //排序输入框失去焦点时选中
        //    $('.priority').blur(function () {
        //        //背景选中
        //        if ($(this).parents('tr').hasClass('active')) {

        //        } else {
        //            $(this).parents('tr').toggleClass('active');
        //        }

        //        //复选框选中
        //        var checkbox = $(this).parents("tr").find("input");
        //        for (var i = 0; i < checkbox.length; i++) {
        //            if (checkbox[i].type == 'checkbox') {
        //                checkbox[i].checked = true;
        //            }
        //        }

        //    })
        //});

    </script>
</body>
</html>
