<%@ Page Language="C#" MasterPageFile="~/Admin/MainPage.Master" AutoEventWireup="true" CodeBehind="NewsList.aspx.cs" Inherits="PPFOR.Admin.ContentArea.News.NewsList" Title="新闻列表" %>
<%@ Register Src="~/Admin/Ascx/PageBar.ascx" TagName="PageBar" TagPrefix="page" %>
<%@ Register Src="~/Admin/Ascx/Publisher.ascx" TagName="Publisher" TagPrefix="publish" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PPFOR_mainContent" runat="server">
<script src="../../JS/gridview.js" type="text/javascript"></script>  
<form id="form1" action="NewsList.aspx" method="post" runat="server">
<asp:Label ID="PPFOR_newsTypeId" runat="server" Enabled="false" Visible="false"></asp:Label>
<asp:Label ID="PPFOR_newsBelongMenuId" runat="server" Enabled="false" Visible="false"></asp:Label>
<asp:Label ID="PPFOR_newsLanguageId" runat="server" Enabled="false" Visible="false"></asp:Label>
    <div class="table-ppfor">
		<i></i><u></u>
		<ul>
		  <li><asp:Label ID="PPFOR_goForAddNews" runat="server"></asp:Label><asp:Label ID="PPFOR_goForAddNewsType" runat="server"></asp:Label><input type="button" class="blueinput" value="生成静态页" onclick="return showDiv('生成静态页',400,150);" /></li>
		    <li class="right">
		        <asp:DropDownList Width="100px" ID="PPFOR_newsSearchCase" runat="server">
				    <asp:ListItem Text="新闻标题" Value="1"></asp:ListItem>
				    <asp:ListItem Text="新闻作者" Value="2"></asp:ListItem>
				  </asp:DropDownList>
				<asp:TextBox ID="PPFOR_newsSearchText" runat="server" Width="100px" MaxLength="50"></asp:TextBox>
				<asp:Button ID="PPFOR_newsSearch" runat="server" Text="搜索" CssClass="blueinput" OnClick="PPFOR_newsSearchClick" />
			</li>
		</ul>
	</div>
    <asp:GridView ID="PPFOR_showNewsList" runat="server" CssClass="forgridview" OnRowDeleting="PPFOR_showNewsList_RowDeleting" OnRowDataBound="PPFOR_gridViewRowDataBound" AllowPaging="false" AutoGenerateColumns="False"  DataKeyNames="ID"  Width="100%" CellPadding="0" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="0px" EmptyDataText="还没有添加新闻">
           <Columns>                
             <asp:TemplateField ShowHeader="False" HeaderText="" HeaderStyle-HorizontalAlign="Center">
                 <ItemStyle Wrap="False" HorizontalAlign="Center" />
                 <HeaderTemplate>
                     <asp:CheckBox ID="PPFOR_selectNews" runat="server"></asp:CheckBox>
                 </HeaderTemplate>
                 <ItemTemplate>
                     <asp:CheckBox ID="PPFOR_selectNews" runat="server"></asp:CheckBox>
                 </ItemTemplate>
             </asp:TemplateField>
             <asp:BoundField HeaderText="ID" DataField="ID" HeaderStyle-Font-Bold="false"/>
             <asp:BoundField HeaderText="标题" ItemStyle-CssClass="right" DataField="newsTitle" HeaderStyle-Font-Bold="false" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Left"/>
             <asp:TemplateField HeaderText="显示" HeaderStyle-Font-Bold="false">
                <ItemTemplate><asp:CheckBox ID="PPFOR_newsShow" runat="server" Text='<%#Eval("show")%>'></asp:CheckBox></ItemTemplate>
             </asp:TemplateField>    
             <asp:TemplateField HeaderText="最新" HeaderStyle-Font-Bold="false">
                <ItemTemplate><asp:CheckBox ID="PPFOR_isNew" runat="server" Text='<%#Eval("New")%>'></asp:CheckBox></ItemTemplate>
             </asp:TemplateField>                      
             <asp:TemplateField HeaderText="推荐" HeaderStyle-Font-Bold="false">
                <ItemTemplate><asp:CheckBox ID="PPFOR_newsRecommended" runat="server" Text='<%#Eval("recommended")%>'></asp:CheckBox></ItemTemplate>
             </asp:TemplateField>
             <asp:TemplateField HeaderText="热点" HeaderStyle-Font-Bold="false">
                <ItemTemplate><asp:CheckBox ID="PPFOR_newsHot" runat="server" Text='<%#Eval("hot")%>'></asp:CheckBox></ItemTemplate>
             </asp:TemplateField>    
             <asp:TemplateField HeaderText="幻灯片" HeaderStyle-Font-Bold="false">
                <ItemTemplate><asp:CheckBox ID="PPFOR_newsSlide" runat="server" Text='<%#Eval("slide")%>'></asp:CheckBox></ItemTemplate>
             </asp:TemplateField>            
             <asp:TemplateField HeaderText="排序" HeaderStyle-Font-Bold="false">
                <ItemTemplate><asp:TextBox ID="PPFOR_newsSort" runat="server" Text='<%#Eval("sort")%>' Width="32" MaxLength="4" ></asp:TextBox></ItemTemplate>
             </asp:TemplateField>
             <asp:TemplateField HeaderText="操作" HeaderStyle-Font-Bold="false">
                <ItemTemplate>
                    <%#PPFOR_getLinkActions(Eval("ID"), Eval("htmlName"))%> 
                    <asp:LinkButton ID="PPFOR_deleteNews" runat="server" CausesValidation="False" CommandName="Delete"
                        Text="删除" OnClientClick="return confirm('删除新闻后不能恢复,确认要删除吗？');"></asp:LinkButton>
                </ItemTemplate>
             </asp:TemplateField>
            </Columns>
             <FooterStyle BackColor="#990000" ForeColor="White" /> 
             <RowStyle Wrap="False" HorizontalAlign="Center" Font-Bold="false" BackColor="#ffffff"/> 
             <HeaderStyle HorizontalAlign="Center" BackColor="#F5F5F5" Font-Bold="false" ForeColor="#000000" />
             <AlternatingRowStyle BackColor="#F5F5F5" />
        </asp:GridView>
      <br />
        <page:PageBar ID="PPFOR_pageBar" runat="server" />
      <br />
      <table width="100%" border="0" cellspacing="0" cellpadding="0" style="display:none;">
        <tr>
          <td>
              <asp:Button ID="PPFOR_updateNewsBatch" CssClass="inputbutton" runat="server" Text="全部更新" OnClick="PPFOR_updateNewsBatchClick"/>
              <asp:Button ID="PPFOR_deleteNewsBatch" CssClass="inputbutton" runat="server" Text="删除" OnClick="PPFOR_deleteNewsBatchClick"/>
              <input name="reset" type="reset" id="reset1" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置" onclick="SelectAllRows('<%=form1.ClientID%>',false)"/>
                <script type="text/javascript">
                    if("<%=PPFOR_displayRecordOption %>"!='none'){
                        addButtonArray("<%= PPFOR_updateNewsBatch.ClientID %>","<%= PPFOR_deleteNewsBatch.ClientID %>","reset1");
                    }
                </script>  
            </td>
        </tr>
      </table>
      <br />
      <publish:Publisher ID="PPFOR_doNewsPublish" runat="server" TextForPublishButton="发布新闻" TextForPublishSeleted="仅发布被勾选的新闻" TextForPublishAll="发布本类型所有新闻" IsDisplayPublishModel="false" />     
</form>        
</asp:Content>
