<%@ Page Language="c#" Inherits="Web.User.manageaskAnswer" CodeBehind="manageaskAnswer.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>Ask and Reply 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 class="user-service pull-right">
                    <span data-original-title="帮助" data-placement="left" data-rel="popover" data-content="【回复审核】字段中，待审和未回复在前台页面上均显示未回复。" data-trigger="hover"><i class="fa fa-question-circle bigger-120 blue"></i></span>
                </div>
            </div>
            <div class="page-content">
                <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" runat="server" class="btn btn-sm btn-primary" 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>
                        &nbsp;
                        <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-mini"></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" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" EmptyDataText="暂无数据…"
                            AllowSorting="True" OnSorting="GridView1_Sorting" AutoGenerateColumns="False" class="table table-striped table-bordered table-hover table-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="编号" SortExpression="pkId" />
                                <asp:TemplateField HeaderText="标题" SortExpression="title">
                                    <ItemTemplate>
                                        <span data-placement="right" data-rel="popover" data-content="<%#Eval("title") %>" data-trigger="hover">
                                            <asp:HyperLink ID="intactTitle" CssClass="FBox_title" runat="server" Text='<%# Eval("title") %>' NavigateUrl='<%# Eval( "pkId", "../Wpet/MessageBoardDetail.aspx?pkId={0}") %>'>
                                            </asp:HyperLink>
                                        </span>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="留言人" SortExpression="author">
                                    <ItemTemplate>
                                        <span data-placement="right" data-rel="popover" data-content="<%# "发布IP："+ Eval("updateIp") %>" data-trigger="hover"><%#Eval("author") %></span>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="留言时间" SortExpression="updateTime">
                                    <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:TemplateField>
                                <asp:TemplateField HeaderText="保密" SortExpression="isSecrecy">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="isSecrecy" runat="server" SelectedIndex='<%# 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" SortExpression="click" />
                                <asp:TemplateField HeaderText="固顶" 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="留言审核" 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="显示等级" SortExpression="gradeId">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="gradeDrop" runat="server" SelectedValue='<%# Eval("gradeId") %>' DataValueField="pkId" DataTextField="name" DataSource="<%# dt_grade %>">
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="浏览权限" 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="回复审核" 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="管理">
                                    <ItemTemplate>
                                        <div class="action-buttons">
                                            <asp:HyperLink ID="edit" runat="server" CommandName="edit" CssClass="FBox" data-toggle="tooltip" data-placement="bottom"   Visible="false" title="编辑"><i class="ace-icon fa fa-pencil bigger-120 blue" ></i></asp:HyperLink>
                                            <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="转发"><i class="ace-icon fa fa-share 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>
                </div>
                <!--/bd-->
                <div class="ft">
                    <div class="pagination">
                        <asp:Label ID="showPage" runat="server"></asp:Label>
                    </div>
                </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': 450,
                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;
            });

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

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

        });

        //栏目移动确认小页面调用本方法 
        function CallMoveSubmit() {
            $("#btnMoveSave").click();
        }

        //function showDetail(pkId) {
        //    w = 400;
        //    h = 370;
        //    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);

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