<%@ Page Language="c#" Inherits="Web.User.manageBoard" CodeBehind="manageBoard.aspx.cs" %>
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>manageboard</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <!--#include file="../Css/userCssList.htm"-->
    <script type="text/javascript">
        jQuery(function ($) {

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

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

        });
            
        //选中背景特效
        $(function(){
            $('.txt-c input').click(function(){
	            $(this).parents('tr').toggleClass('active');
            })
            
            $('.title.txt-c 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>
</head>
<body>
    <div class="list-func-box func-box">
        <form id="newsMange" method="post" runat="server">
        <div class="hd">
            <div class="breadcrumb">
                <asp:PlaceHolder ID="placeHead" runat="server"></asp:PlaceHolder>
            </div>
            <!--/breadcrumb-->
            <div class="user-service">
                <a class="help" href="#" title="帮助：公告标题只用作于当前后台显示区分，不会显示在前台页面上。">帮助</a></div>
            <!--/user-service-->
        </div>
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                </div>
                <!--/search-box-->
                <div class="action-field">
                    <asp:Button ID="btnSave" runat="server" CssClass="btn" Text="保 存" OnClick="Btn_Click"></asp:Button>
                    &nbsp;
                    <asp:Button ID="btnAdd" runat="server" CssClass="btn" Text="添 加" OnClick="Btn_Click"></asp:Button>
                    &nbsp;
                    <asp:Button ID="btnDel" runat="server" CssClass="btn" Text="删 除" OnClick="Btn_Click"></asp:Button>
                </div>
                <!--/action-field-->
            </div>
            <div class="function-bd" style="height:580px;overflow:auto;">
            <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
            <asp:HiddenField ID="hfidstr" runat="server" />
            <asp:HiddenField ID="hftitlestr" runat="server" />
            <asp:DataGrid ID="boardGrid" runat="server" class="list-table" AutoGenerateColumns="False" AllowSorting="True" onitemcommand="boardGrid_ItemCommand" onpageindexchanged="boardGrid_PageIndexChanged">
                <Columns>
                    <asp:TemplateColumn HeaderStyle-CssClass="title txt-c" ItemStyle-CssClass="txt-c" ItemStyle-Width="36px">
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbAll" Text="" runat="server" onclick="GridSelectAll('boardGrid',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>
                            <asp:Label ID="CC" Visible="false" runat="server" Text="[抄送]" ForeColor="Red"></asp:Label>
                            <asp:HyperLink ID="title" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.name") %>' Target="_blank">
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="发布人" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <a href="#">
                                <asp:Label ID="info" runat="server" Text='<%#Eval("fullName") %>' ToolTip='<%# "发布IP："+ Eval("updateIp") %>'></asp:Label></a>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="发布时间" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <a href="#">
                                <asp:Label ID="lbtime" runat="server" Text='<%# Eval("updateTime", "{0:yyyy-M-d}") %>' ToolTip='<%# Eval("updateTime") %>'></asp:Label></a>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="showDay" HeaderText="显示天数" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden" FooterStyle-CssClass="hidden">
                    </asp:BoundColumn>
                    <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" DataValueField="pkId" DataTextField="name"
                                DataSource="<%# dv %>">
                            </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" ItemStyle-CssClass="td-a">
                        <ItemTemplate>
                            <asp:LinkButton ID="edit" runat="server" CommandName="edit">编辑</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn Visible="False" DataField="gradeId" HeaderText="等级" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="isDuplicated" HeaderText="是否抄送" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="duplicateFrom" HeaderText="抄送来源" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="duplicatedPkId" HeaderText="抄送Id" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                </Columns>
                <PagerStyle Mode="NumericPages"></PagerStyle>
            </asp:DataGrid>
            <!--[if lte IE 7]></div><![endif]-->
            </div><!--/function-bd-->
        </div>
        <div class="ft">
        </div>
        </form>
    </div>
</body>
</html>
