<%@ Page Language="c#" Inherits="Web.User.manageMessageBoard" CodeBehind="manageMessageBoard.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>Message board manageMent</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="../Wpedt/My97DatePicker/WdatePicker.js"></script>
    <!--#include file="../Css/head.htm"-->

</head>
<body>
    <form id="Form1" method="post" runat="server">
        <div class="list-func-box func-box" style="min-width: 1200px;">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="ace-icon fa  fa-desktop"></i>
                        <asp:Label ID="lbpageNav" runat="server" Text=""></asp:Label>
                    </li>
                </ul>
            </div>
            
            <div class="page-content">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header clearfix">
                    <div class="pull-left">
                        <asp:Button ID="btnSave" class="btn btn-sm btn-primary" runat="server" Text="保 存" OnClick="Btn_Click"></asp:Button>
                        &nbsp;
                    <asp:Button ID="btnAdd" class="btn btn-sm btn-primary " runat="server" Text="添 加" OnClick="Btn_Click"></asp:Button>
                        &nbsp;
                    <asp:Button ID="btnMove" class="btn btn-sm btn-primary" runat="server" Text="移 动"></asp:Button>
                        &nbsp;
                    <asp:Button ID="btnDel" class="btn btn-sm btn-primary" runat="server" Text="删 除" OnClick="Btn_Click"></asp:Button>
                        &nbsp;
                    <asp:HiddenField ID="MoveTargetBigClassID" runat="server" />
                        <asp:HiddenField ID="MoveTargetMenuID" runat="server" />
                        <asp:Button ID="btnMoveSave" class="btn btn-sm btn-primary" runat="server" Text="MoveSave" OnClick="Btn_Click" Style="display: none"></asp:Button>
                        &emsp;
                    <asp:Label ID="lbTip" runat="server" ForeColor="Red" Text=""></asp:Label>
                    </div>
                    <!--/action-field-->
                    <div class="pull-right">
                        编号：<asp:TextBox ID="txtID" runat="server" CssClass="input-md" Width="45"></asp:TextBox>
                        留言：<asp:DropDownList ID="DDLpass" runat="server" CssClass="input-md" Width="90">
                            <asp:ListItem Text="<全部>" Value=""></asp:ListItem>
                            <asp:ListItem Text="待审" Value="0"></asp:ListItem>
                            <asp:ListItem Text="通过" Value="1"></asp:ListItem>
                            <asp:ListItem Text="不通过" Value="2"></asp:ListItem>
                        </asp:DropDownList>
                        回复：<asp:DropDownList ID="DDLrepass" runat="server" CssClass="input-md" Width="90">
                            <asp:ListItem Text="<全部>" Value=""></asp:ListItem>
                            <asp:ListItem Text="待审" Value="0"></asp:ListItem>
                            <asp:ListItem Text="通过" Value="1"></asp:ListItem>
                            <asp:ListItem Text="未回复" Value="2"></asp:ListItem>
                        </asp:DropDownList>
                        时间：<asp:TextBox ID="txtBegintime" runat="server" CssClass="input-md" Width="100" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>至<asp:TextBox ID="txtEndtime" runat="server" CssClass="input-md" Width="100" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="btn btn-sm btn-primary" Width="60" OnClick="Btn_Click" />&nbsp;
                          <asp:Button ID="btnExport" runat="server" Text="导出" CssClass="btn btn-sm btn-primary" Width="60" OnClick="Btn_Click" />
                    </div>
                    <!--/search-box-->
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!--[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" AutoGenerateColumns="False" class="table table-striped table-bordered table-hover table-sorting" 
                             OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" AllowSorting="True" OnSorting="GridView1_Sorting" EmptyDataText="暂无数据…" >
                            <Columns>
                                <asp:TemplateField HeaderStyle-CssClass="title 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="编号"  SortExpression="pkId" />
                                <asp:TemplateField HeaderText="标题" HeaderStyle-CssClass="title" ItemStyle-Width="15%" SortExpression="title">
                                    <ItemTemplate>
                                        <span data-placement="right" data-rel="popover" data-content="<%# Eval("title") %>" data-trigger="hover">
                                            <asp:HyperLink ID="intactTitle" onclick='<%#"javascript:showDetail("+DataBinder.Eval(Container, "DataItem.pkId")+")"%>'
                                                runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.title") %>' NavigateUrl="javascript:#">
                                            </asp:HyperLink>
                                        </span>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="留言人" SortExpression="author">
                                    <ItemTemplate>
                                        <span data-placement="right" data-rel="popover" data-content="<%# "发布IP："+DataBinder.Eval(Container, "DataItem.updateIp") %>" data-trigger="hover"><%# DataBinder.Eval(Container, "DataItem.author") %></span>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="留言时间" HeaderStyle-CssClass="title" SortExpression="updateTime">
                                    <ItemTemplate>
                                        <span data-placement="right" data-rel="popover" data-content="<%# Eval("updateTime") %>" data-trigger="hover">
                                            <asp:Label ID="lbtime" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.updateTime", "{0:yyyy-M-d}") %>'></asp:Label>
                                        </span>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="保密" HeaderStyle-CssClass="title" SortExpression="isSecrecy">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="isSecrecy" runat="server" SelectedValue='<%# Eval("isSecrecy") %>' Enabled="False">
                                            <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                            <asp:ListItem Value="1">保密</asp:ListItem>
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="点击量" DataField="click" HeaderStyle-CssClass="title" SortExpression="click" />
                                <asp:TemplateField HeaderText="固顶" HeaderStyle-CssClass="title" SortExpression="isTop">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="isTop" runat="server" SelectedValue='<%# Eval("isTop") %>'>
                                            <asp:ListItem Value="0" Selected="True">取消</asp:ListItem>
                                            <asp:ListItem Value="1">固顶</asp:ListItem>
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="留言审核" HeaderStyle-CssClass="title" SortExpression="checked">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="pass" runat="server" SelectedValue='<%#Eval( "checked") %>'>
                                            <asp:ListItem Value="0" Selected="True">待审</asp:ListItem>
                                            <asp:ListItem Value="1">通过</asp:ListItem>
                                            <asp:ListItem Value="2">不通过</asp:ListItem>
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="显示等级" HeaderStyle-CssClass="title" SortExpression="gradeId">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="gradeDrop" runat="server" SelectedValue='<%# Eval("gradeId") %>' DataSource="<%# dt_grade %>" DataTextField="name" DataValueField="pkId">
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="浏览权限" HeaderStyle-CssClass="title" SortExpression="gate">
                                    <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="回复审核" HeaderStyle-CssClass="title" SortExpression="reAudit">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="repass" runat="server" SelectedValue='<%# Eval("reAudit") %>'>
                                            <asp:ListItem Value="0" Selected="True">待审</asp:ListItem>
                                            <asp:ListItem Value="1">通过</asp:ListItem>
                                            <asp:ListItem Value="2">未回复</asp:ListItem>
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="管理" HeaderStyle-CssClass="title" ItemStyle-CssClass="td-a">
                                    <ItemTemplate>
                                        <div class="action-buttons">
                                            <asp:HyperLink ID="edit" CssClass="FBox" runat="server" CommandName="edit" data-toggle="tooltip" Visible="false" data-placement="bottom" title="编辑"><i class="ace-icon fa fa-pencil bigger-120 blue" ></i></asp:HyperLink>
                                            <%--<asp:LinkButton ID="edit11" CssClass="FBox" runat="server" CommandName="edit" data-toggle="tooltip" Visible="false" data-placement="bottom" title="编辑"><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="forward" runat="server" CommandName="forward" Visible="<%#(IsForward == true) ? true :false %>" data-toggle="tooltip" data-placement="bottom" title="转发" CommandArgument='<%#Eval("pkId") %>'><i class="ace-icon fa fa-share bigger-120 blue" ></i></asp:LinkButton>
                                            <asp:LinkButton ID="lbtnPrint" runat="server" href='<%# Eval("pkId","../Customize/dgjy/ChengBan.aspx?pkId={0}")%>' target="_blank" data-toggle="tooltip" data-placement="bottom" title="承办单"><i class="ace-icon fa fa-table bigger-120 blue" ></i></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField Visible="False" DataField="grade" HeaderText="等级" />
                            </Columns>
                        </asp:GridView>
                        <div class="grid-pager">
                            <uc1:pageNavi runat="server" ID="pageNavi" dataCtlName="GridView1" />
                        </div>
                        <!--[if lte IE 7]></div><![endif]-->
                    </div>
                    <!--/function-bd-->
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div>
        </div>
    </form>
    <!--#include file="../Css/foot.htm"-->
    <script type="text/javascript">
        jQuery(function ($) {

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

            $("#btnSave").click(function () {
                //return confirm("您确定要保存列表吗？");
                return GridSelectCheck('GridView1', true);
            });

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

            $("#btnMove").click(function () {
                if (GridSelectCheck('GridView1', false)) {
                    //改用弹出层，因为201409发布的最新ghome开始不支持showModalDialog()
                    $.fancybox({
                        'type': 'iframe',
                        'width': 400,
                        'height': 350,
                        'hideOnOverlayClick': false,
                        'href': 'MoveItem.aspx?templateID=<%=TemplateID %>&menuID=<%=menuId %>'
                    });
                }
                return false;
            });

            $(".FancyBox").click().fancybox({
                'width': 500,
                'height': 450,
                'hideOnOverlayClick': false,
                'transitionIn': 'elastic',
                'transitionOut': 'elastic',
                'type': 'iframe',
                'padding': '0'
            });

            $(".FBox").click().fancybox({
                'width': 860,
                'height': 585,
                autoSize: false,
                'hideOnOverlayClick': false,
                'transitionIn': 'elastic',
                'transitionOut': 'fade',
                'type': 'iframe',
                'padding': '0'
            });

        });

        //栏目移动确认小页面调用本方法 
        function CallMoveSubmit() {
            $("#btnMoveSave").click();
        }
        //留言本打开留言详细信息页面
        function showDetail(pkId) {
            w = 510;
            h = 500;
            LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
            TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
            settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no';
            window.open("../Wpet/MessageBoardDetail.aspx?pkId=" + pkId, "", settings);

        }

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

        //    })
        //})
    </script>
</body>
</html>
