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

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>manage popwindow</title>
    <!--#include file="../Css/head.htm"-->
</head>
<body>
    <form id="newsMange" method="post" runat="server">
    <div class="list-func-box func-box">
        <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa  fa-desktop"></i>
                弹出窗口
                    </li>
                </ul>
            </div>
         <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
        <div class="bd">
            <div class="page-header clearfix">
                <div class="search-box pull-right">
                </div>
                <!--/search-box-->
                <div class="action-field">
                                    <asp:Button ID="btnSave" runat="server" Text="保 存" OnClick="Btn_Click" CssClass="btn btn-sm btn-primary"></asp:Button>&emsp;
                    <asp:Button ID="ok" runat="server" Text="添 加" OnClick="ok_Click" CssClass="btn btn-sm btn-primary"></asp:Button>&emsp;
                    <asp:Button ID="btnDel" class="btn btn-sm btn-primary" runat="server" Text="删 除" OnClick="Btn_Click"></asp:Button>
                </div>
                <!--/action-field-->
            </div>
                            <div class="function-bd">
            <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
            <asp:HiddenField ID="hfidstr" runat="server" />
            <asp:HiddenField ID="hftitlestr" runat="server" />
            <asp:DataGrid ID="popWindowGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False" class="table table-striped table-bordered table-hover">
                <Columns>
                    <asp:TemplateColumn HeaderStyle-CssClass="title text-center" ItemStyle-CssClass="text-center" ItemStyle-Width="36px">
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbAll" Text=" " runat="server" onclick="GridSelectAll('popWindowGrid',this.checked)" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbthis" runat="server" Text=" "></asp:CheckBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                                        <asp:BoundColumn DataField="pkId" HeaderText="ID号" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden" FooterStyle-CssClass="hidden"></asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="窗口标题" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <span  data-placement="right" data-rel="popover" data-content="<%# DataBinder.Eval(Container, "DataItem.title") %>" data-trigger="hover">
                            <asp:HyperLink ID="name" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.title") %>' Target="_blank">
                            </asp:HyperLink>
                                </span>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="发布人" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <span  data-placement="right" data-rel="popover" data-content="<%# "发布IP："+DataBinder.Eval(Container, "DataItem.updateIp") %>" data-trigger="hover"><%#Eval("fullName") %></span>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="发布时间" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <span data-placement="right" data-rel="popover" data-content="<%# Eval("updateTime") %>" data-trigger="hover"> 
                                <asp:Label ID="lbtime" runat="server" Text='<%# Eval("updateTime", "{0:yyyy-M-d}") %>' ></asp:Label></span>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="固顶" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="isTop" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.isTop") %>'>
                                <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="pass" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.passed") %>'>
                                <asp:ListItem Value="0" Selected="True">待审</asp:ListItem>
                                <asp:ListItem Value="1">通过</asp:ListItem>
                                <asp:ListItem Value="2">不通过</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="显示等级" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="gradeDrop" runat="server" DataSource="<%# dv %>" DataTextField="name" DataValueField="pkId">
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="浏览权限" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="gate" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.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:TemplateColumn>
                    <asp:TemplateColumn HeaderText="弹出天数" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:TextBox ID="popDay" runat="server" CssClass="input-mini" Text='<%# DataBinder.Eval(Container, "DataItem.popDay") %>'>
                            </asp:TextBox>
                            <asp:RequiredFieldValidator ID="eq1" runat="server" ErrorMessage="*" ControlToValidate="popDay"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="wq2" runat="server" ErrorMessage="输入错误！" ControlToValidate="popDay" MinimumValue="0" MaximumValue="1000" Type="Integer"></asp:RangeValidator>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="弹出顺序" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:TextBox ID="order" runat="server" CssClass="input-mini" Text='<%# DataBinder.Eval(Container, "DataItem.ordering") %>'>
                            </asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                ControlToValidate="order"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="输入错误！" ControlToValidate="order"
                                MinimumValue="0" MaximumValue="10000" Type="Integer"></asp:RangeValidator>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="管理" HeaderStyle-CssClass="title" ItemStyle-CssClass="td-a">
                        <ItemTemplate>
                                                <div class="action-buttons">
                                                    <asp:LinkButton ID="edit" runat="server" CommandName="edit" data-toggle="tooltip" data-placement="bottom" title="编辑"><i class="ace-icon fa fa-pencil bigger-120 blue" ></i></asp:LinkButton>
                                                </div>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                                        <asp:BoundColumn Visible="False" DataField="grade" HeaderText="等级" HeaderStyle-CssClass="title"></asp:BoundColumn>
                </Columns>
            </asp:DataGrid>
            </div>
        </div>
        <!--/bd-->
        <div class="ft">
            <div class="pagination">
            <asp:Label ID="showPage" runat="server">Label</asp:Label>
            </div>
        </div>
                    <!-- PAGE CONTENT ENDS -->
                </div>
            </div>
        </div>
    </div>
    </form>
    <!--#include file="../Css/foot.htm"-->
     <script type="text/javascript">
         jQuery(function ($) {

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

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

         });

         //选中背景特效
         $(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');
                 }
             })

             $('.list-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;
                     }
                 }

             })
         })

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