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

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!--><html><!--<![endif]-->
<head>
    <title>bigClass</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/adminCss.htm" -->
    
    <script type="text/javascript">
    
        jQuery(function ($) {
            /*列表高度*/
            $('.function-bd').height($(window).innerHeight() - 140);

            $(window).resize(function () {
                $('.function-bd').height($(window).innerHeight() - 140);
            });
            
//            //编辑：利用自定义data扩展属性重写href，(由于asp:linkbutton无法解析href中的Eval('pkid')嵌套)
//            $(".FBox").each( function(){
//               $(this).attr('href','bigClassEdit.aspx?pkId='+ $(this).data('hrefpkid')) ; 
//            });
            //编辑：打开弹出层
            $(".FBox").click().fancybox({
                'width'		: 690,
				'height'	: 520,
				'hideOnOverlayClick': false,
				'type'		: 'iframe',
				'padding':'0'
            });
            $(".FBox2").click().fancybox({
                'width'		: 400,
				'height'	: 300,
				'hideOnOverlayClick': false,
//				'transitionIn'		: 'elastic',
//				'transitionOut'		: 'elastic',
                'padding':'0',
				'type'		: 'iframe'
            });
            //信息
              $(".FBox3").click().fancybox({
                'width'		: 700,
				'height'	: 550,
				'hideOnOverlayClick': false,
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'padding':'0',
				'type'		: 'iframe'
            });
            //新增栏目
            $("#btnAdd2").click(function() {
                    return true; 
                }).fancybox({
                'width'		: 690,
				'height'	: 520,
				'hideOnOverlayClick': false,
				'type': 'iframe',
				'padding':'0',
				'href'      : 'bigClassEdit.aspx?pkId=0'
            });
          //编辑栏目CSS文件
          $("#btnOpenCSS").click(function(){
          return true;
          }).fancybox({
           'width'		: 746,
				'height'	: 640,
				'hideOnOverlayClick': false,
				'type'		: 'iframe',
				'padding':'0',
				'href'      : 'editCss.aspx'
          })
        });

        jQuery.triggerSelect = function(){
            __doPostBack('<%=btnQuery.ClientID %>', '');
        }
        
    </script>

</head>
<body>
    <div class="list-func-box func-box">
        <div class="hd">
             您的位置：网站架构 &gt; 栏目管理
            <!--/user-service-->
        </div>
        <asp:ScriptManager ID="scriptManager1" runat="server"></asp:ScriptManager>
        <form id="bigClass" method="post" runat="server">
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                <asp:UpdatePanel ID="upd2" runat="server">
                    <ContentTemplate>
                    栏目类别：<asp:DropDownList ID="ddlTemplateType" runat="server" CssClass="drop-txt" Width="70" DataTextField="type" 
                            DataValueField="pkId" AutoPostBack="true" 
                            onselectedindexchanged="ddlTemplateType_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="ddlTemplate" runat="server" DataTextField="name" DataValueField="pkId" CssClass="drop-txt" Width="100">
                        </asp:DropDownList>,
                        <asp:DropDownList ID="ddlremark" runat="server" CssClass="drop-txt" Width="70">
                            <asp:ListItem Text="栏目名" Value="1"></asp:ListItem>
                            <asp:ListItem Text="说明" Value="2"></asp:ListItem>                            
                        </asp:DropDownList>：
                        <asp:TextBox ID="tbremark" runat="server" CssClass="input-txt" Width="100" ></asp:TextBox>
                        &nbsp;<asp:Button ID="btnFilter" class="btn"  runat="server" Text="查 询" OnClick="Btn_Click" />
                    </ContentTemplate>
                </asp:UpdatePanel>
                </div>
                <!--/search-box-->
                <div class="action-field">
                    <asp:Button ID="btnAdd2" class="btn" runat="server" Text="添加栏目" />
                    &nbsp;<asp:Button ID="btnQuery" class="btn"  runat="server" Text="刷新" OnClick="Btn_Click" style="display:none;" />
                    &nbsp;<asp:Button ID="btnOpenCSS" class="btn" runat="server" Text="栏目样式" Visible="false"/>
                    <asp:CheckBox runat="server" ID="ckbSelect" Text="只显示‘孤立’栏目" AutoPostBack="True" oncheckedchanged="ckbSelect_CheckedChanged"/>
                </div>
            </div>
            <div class="function-bd" style="height:580px;overflow:auto;">
            <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
            <asp:UpdatePanel ID="upd1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
            <asp:DataGrid class="list-table" AutoGenerateColumns="False" CellPadding="3" ID="bigClassGrid"
                PageSize="1" runat="server" Width="100%" OnItemCommand="bigClassGrid_ItemCommand">
                <Columns>
                    <asp:BoundColumn Visible="true" DataField="pkId" HeaderText="ID" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="name" HeaderText="栏目名" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="remark" HeaderText="说明" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="栏目类别" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="lblTemplate" runat="server" Text='<%# "【" + Eval("type") + "】 " + Eval("template") %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="adminName" HeaderText="管理员" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="updateTime" HeaderText="更新时间" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="系统模板" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="isSystemItem" runat="server" Text='<%# Eval("isSystemItem").ToString() == "1" ? "是" : "否" %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="操作" HeaderStyle-CssClass="title" ItemStyle-Width="170">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="edit" CausesValidation="False" CssClass="FBox" title="编辑" href='<%# Eval("pkId","bigClassEdit.aspx?pkId={0}")%>' ><i class="icon icon-pencil"></i></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="del" CausesValidation="False"><i class="icon icon-remove" title="删除"></i></asp:LinkButton>
                            <a href='bigClassApply.aspx?pkId=<%#Eval("pkId") %>' class="FBox2" title="频道引用"><i class="icon icon-01"></i></a>
                            <asp:LinkButton ID="lbtnNews"  runat="server" CssClass="FBox3" href='<%#Eval("pkId","UserInfoSearch.aspx?searchId={0}&t=2")%>' title="信息"><i class="icon icon-file"></i></asp:LinkButton>
                            <asp:HyperLink ID="hyRss" NavigateUrl='<%#"../Rss.aspx?id=" + Eval("pkId") %>' runat="server" Text="RSS" Target="_blank" style="display:none ;"></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="adminId" HeaderText="adminId" Visible="False" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="code" HeaderText="code" Visible="False" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                </Columns>
            </asp:DataGrid>
            </ContentTemplate>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="click" />
            <%--<asp:AsyncPostBackTrigger ControlID="ddlTemplate" EventName="OnSelectedIndexChanged" />--%>
            </Triggers>
            </asp:UpdatePanel>
            <!--[if lte IE 7]></div><![endif]-->
            </div><!--/function-bd-->
        </div>
        <div class="ft">
            <div class="action-field txt-l">
                列表中栏目数：<asp:Label ID="lb_totalItem" runat="server" ForeColor="Red"></asp:Label>
            </div>
            <!--/action-field-->
        </div>
        </form>
    </div>
</body>
</html>

