<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="articlelist.aspx.cs" Inherits="HeyuanHouse.Web.backend.articlelist" %>
<%@Register TagPrefix="Webdiyer" Namespace="Wuqi.Webdiyer" Assembly="aspnetpager"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>河房网网站管理系统</title>
<link href="images/sdcms.css" rel="stylesheet" type="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<script language="javascript" src="images/sdcms.js" type="text/javascript"></script>
<script type="text/javascript" src="editor/xheditor/jquery.js"></script>
<script language="javascript" type="text/javascript">
function SelectAll(theBox)
{
    var elm=document.Form1.elements;
    for(i=0;i<elm.length;i++)
    if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
    {
        elm[i].checked=theBox.checked ;
    }
}

function CheckDeleteHandle(btn)
{
    var elm=document.Form1.elements;
    var flag = false ;
    for(i=0;i<elm.length;i++) 
    if(elm[i].type=="checkbox")
    {
        if (elm[i].checked)
        {
          flag = true ;
          break ;
        }
    }
    
    if (flag)
    { 
        return confirm('是否要删除选择的文章？') ;
    }
    else
    {
        alert("你没有选择任何文章，请选择！") ;
        return false ;
    }
}
</script>
</head>
<body>
<form runat="server" id="Form1">
<div class="sdcms_notice">
  <span>文章搜索：</span> 
  文章分类：<asp:DropDownList ID="ddlSearchCategorys" runat="server" />  
  关键词：<asp:TextBox runat="server" ID="txtSearchKeyword" />
  <asp:Button runat="server" ID="btnSearch" Text="搜索" onclick="btnSearch_Click" />
</div>
<br />
<ul id="sdcms_sub_title">
	<li class="sub"><a>信息管理</a></li>
	<li class="unsub"><a class="hand" href="articleedit.aspx?action=add">添加资讯</a></li>
</ul>
<div id="sdcms_right_b">
  <asp:DataGrid runat="server" ID="dgArticleList" AutoGenerateColumns="false" 
            BorderWidth="0" HorizontalAlign="Center" CellPadding="3" CellSpacing="1" 
            CssClass="table_b" HeaderStyle-CssClass="title_bg" 
            FooterStyle-BackColor="#ffffff" FooterStyle-HorizontalAlign="Center" FooterStyle-Height="33"
            UseAccessibleHeader="true" ShowFooter="false" ShowHeader="true" 
            DataKeyField="aid" onitemcommand="dgArticleList_ItemCommand" 
        onitemcreated="dgArticleList_ItemCreated">
     <Columns>
        <asp:TemplateColumn HeaderText="选择" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <asp:CheckBox runat="server" ID="chkIsSelect" CssClass="input" />
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="标题" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <a href='/newsview.aspx?aid=<%# DataBinder.Eval(Container.DataItem, "aid")%>' target="_blank" style='<%# DataBinder.Eval(Container.DataItem, "linkstyle")%>'><%# DataBinder.Eval(Container.DataItem, "title")%></a>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="分类" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# GetCategoryName((int)DataBinder.Eval(Container.DataItem, "cid"))%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="属性" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
             <%# (bool)DataBinder.Eval(Container.DataItem, "isincludepic") ? "<font color='red'>图</font>" : ""%>  
             <%# (bool)DataBinder.Eval(Container.DataItem, "istop") ? "<font color='red'>顶</font>" : ""%>  
             <%# (bool)DataBinder.Eval(Container.DataItem, "iscommend") ? "<font color='red'>荐</font>" : ""%>  
             <%# (bool)DataBinder.Eval(Container.DataItem, "islink") ? "<font color='red'>链</font>" : ""%>
             <%# (bool)DataBinder.Eval(Container.DataItem, "ischecked") ? "<font color='red'>审</font>" : ""%>  
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="浏览" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "hits")%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="发布时间" ItemStyle-Height="33" ItemStyle-HorizontalAlign="Center">
           <ItemTemplate>
              <%# DataBinder.Eval(Container.DataItem, "createtime")%>
           </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn HeaderText="操作" ItemStyle-HorizontalAlign="Center">
             <ItemTemplate>
                <a href='articleedit.aspx?action=edit&aid=<%# DataBinder.Eval(Container.DataItem, "aid")%>'>编辑</a>
                <asp:LinkButton runat="server" ID="lnkDelete" CommandArgument="DeleteInfo" Text="删除" Visible="false" />
             </ItemTemplate>
        </asp:TemplateColumn>
     </Columns>
  </asp:DataGrid> 
  <table border="0" align="center" cellpadding="3" cellspacing="1" class="table_b">
  <tr>
    <td colspan="9" class="tdbg" align="center">
    <webdiyer:AspNetPager id="pager" runat="server" AlwaysShow="True" ShowCustomInfoSection="Left" Width="80%" OnPageChanged="pager_PageChanged" ShowSelectBox="Never"></webdiyer:AspNetPager> <br />
    <asp:CheckBox runat="server" ID="chkSelectAll" ToolTip="全选/否选" />全选/否选 <asp:DropDownList runat="server" ID="ddlMoveToCategorys" /> 
        <asp:Button runat="server" ID="btnMoveToNewCategory" Text="转移到所选分类" 
            onclick="btnMoveToNewCategory_Click" />  &nbsp;  
        <asp:Button runat="server" ID="btnBatchDelete" Text="删除所选文章" 
            onclick="btnBatchDelete_Click" /> 
     </td>
  </tr>
  </table>
</div>
</form>
</body>
</html>
