<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_InfoList, QianboCMS" EnableEventValidation="false" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!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 id="Head1" runat="server">
<link href="../Css/layout.css" type="text/css" rel="stylesheet" />
<title>内容管理列表</title>
<script type="text/javascript" src="../../Js/XmlHttp.js"></script>
<script type="text/javascript" src="../../Js/Common.js"></script>
<script type="text/javascript">
var gvElement = 'gvInfoList'
function SetCheckBox()
{
    if($(gvElement)!=null)
    {
        var s=$(gvElement).getElementsByTagName("input")
        for(var i=0;i<s.length;i++)
        {
            if(s[i].type=="checkbox")
            {
                s[i].checked=$("chkBoxChooseAll").checked;
            }
        }
    }
}
function IsSelectedId()
{
    var flag = false;
    if($(gvElement)==null)
    {
        return flag;
    }
    var s = $(gvElement).getElementsByTagName("input")
    for(var i=0;i<s.length;i++)
    {
        if(s[i].type=="checkbox")
        {
            if(s[i].checked)
            {
                flag = true;
                break;
            }
        }
    }
    return flag;
}
</script>
</head>

<body>
<form id="form1" runat="server" defaultbutton="btnGoSearch" defaultfocus="txtKeyword">
  <table width="99%" cellspacing="1" cellpadding="0" class="wzdh" align="center">
    <tr>
      <td style="padding-left: 10px;"><img src="../Images/Skin/Default/you.gif" align="absmiddle" /> 您现在的位置：<a href='../SystemInfo.aspx'>后台管理</a> &gt;&gt;
        <asp:Literal runat="server" ID="litNav"></asp:Literal></td>
    </tr>
  </table>
  <table width="99%" cellspacing="1" cellpadding="0" class="border" align="center">
    <tr class="wzlist">
      <td>
        <asp:HyperLink ID="hyperGetAll" runat="server">频道<%=ChannelModel.TypeName %>列表</asp:HyperLink>
        <span id="SetInfoSpan" runat="server"> | <asp:HyperLink ID="hyperSetInfo" runat="server">添加<%=ChannelModel.TypeName %></asp:HyperLink><img src="../Images/comment_add.gif" border="0" align="absmiddle" /></span> | <asp:HyperLink ID="hyperPass" runat="server" Text="已审核"></asp:HyperLink> | <asp:HyperLink ID="hyperNoPass" runat="server" Text="未审核"></asp:HyperLink> | <asp:HyperLink ID="hyperUserType" runat="server" Text="投稿"></asp:HyperLink></td>
    </tr>
  </table>
  <table width="99%" cellspacing="1" cellpadding="0" class="border" align="center">
    <tr class="wzlist">
      <td><span style="float: left;"><asp:LinkButton ID="lkBtnIsTop" runat="server" Text="置顶" CommandName="IsTop" OnClick="ShowSearchResult"></asp:LinkButton> | <asp:LinkButton ID="lkBtnIsRecommend" runat="server" Text="推荐" CommandName="IsRecommend" OnClick="ShowSearchResult"></asp:LinkButton> | <asp:LinkButton ID="lkBtnIsFocus" runat="server" Text="焦点" CommandName="IsFocus" OnClick="ShowSearchResult"></asp:LinkButton> | <asp:LinkButton ID="lkBtnIsHot" runat="server" Text="热点" CommandName="IsHot" OnClick="ShowSearchResult"></asp:LinkButton> | <asp:LinkButton ID="lkBtnIsSideShow" runat="server" Text="幻灯" CommandName="IsSideShow" OnClick="ShowSearchResult"></asp:LinkButton> | <asp:LinkButton ID="lkBtnIsImg" runat="server" Text="图片" CommandName="IsImg" OnClick="ShowSearchResult"></asp:LinkButton></span>
      <span style="float: right;"><asp:DropDownList ID="ddlChannel" runat="server" OnSelectedIndexChanged="ddlChannel_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList></span></td>
    </tr>
  </table>
  <asp:GridView ID="gvInfoList" runat="server" AutoGenerateColumns="False" Width="99%" CssClass="border" align="center" OnRowDataBound="gvInfoList_RowDataBound" OnRowDeleting="gvInfoList_RowDeleting" DataKeyNames="Id" CellSpacing="1" GridLines="None" OnRowCommand="gvInfoList_RowCommand">
    <Columns>
    <asp:TemplateField HeaderText="全选">
      <ItemTemplate>
        <asp:CheckBox ID="chkBoxChooseInfo" runat="server" />
      </ItemTemplate>
      <ItemStyle Width="30px" CssClass="tc" />
      <HeaderTemplate>
        <asp:Label ID="lbChooseAll" runat="server" Text="全选"></asp:Label>
      </HeaderTemplate>
      <HeaderStyle CssClass="title" />
    </asp:TemplateField>
    <asp:TemplateField HeaderText="标题">
      <ItemTemplate><%# InfoTitle(Eval("ColName"), Eval("Title"), Eval("ColId"), Eval("Id"), Eval("UName"))%></ItemTemplate>
      <ItemStyle CssClass="tl wrap" />
    </asp:TemplateField>
    <asp:BoundField HeaderText="点击数" DataField="HitCount">
      <ItemStyle Width="40px" CssClass="tc" />
    </asp:BoundField>
    <asp:TemplateField HeaderText="属性">
      <ItemTemplate><%# ChangePropertyDisplay(Eval("IsTop"),Eval("IsRecommend"),Eval("IsFocus"),Eval("HitCount"),Eval("IsSideShow"),Eval("TitleType")) %></ItemTemplate>
      <ItemStyle Width="150px" CssClass="tc" />
    </asp:TemplateField>
    <asp:TemplateField HeaderText="审核状态">
      <ItemTemplate>
        <asp:Label ID="lbStatus" runat="server" Text='<%# ChangeStatus(Eval("Status")) %>'></asp:Label>
      </ItemTemplate>
      <ItemStyle CssClass="tc" Width="60px" />
    </asp:TemplateField>
    <asp:TemplateField HeaderText="生成">
      <ItemStyle Width="30px" CssClass="tc" />
      <ItemTemplate><%#(bool)Eval("IsCreated") ? "√" : "×"%></ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="推送">
      <ItemStyle Width="30px" CssClass="tc" />
      <ItemTemplate><%#IsSend(Eval("Id"),Eval("colId"))%></ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="常规管理操作" ShowHeader="False">
      <ItemTemplate><a href="../Preview/PreInfo.aspx?ModelId=<%=ChannelModel.ModelType %>&Id=<%#Eval("Id") %>" target="_blank">预览</a>
        <a href="<%#GetInfoUrl(Eval("Id"),Eval("ColId")) %>">修改</a>
        <asp:LinkButton ID="lkBtnDelete" runat="server" CausesValidation="False" CommandName="Delete" Text="删除" OnClientClick="return confirm('是否确定将该数据删除到回收站？')"></asp:LinkButton>
        <asp:LinkButton ID="lkBtnSetTop" runat="server" CausesValidation="False" CommandArgument='<%# SetIsTopCA(Eval("IsTop")+"|"+Eval("Id")) %>' Text='<%# SetIsTopText(Eval("IsTop")) %>' CommandName="setIsTop"></asp:LinkButton>
        <asp:LinkButton ID="lkBtnSetRecommend" runat="server" CausesValidation="False" Text='<%#SetIsRecommendText(Eval("IsRecommend")) %>' CommandArgument='<%# SetIsRecommendCA(Eval("IsRecommend")+"|"+Eval("Id")) %>' CommandName="setIsRecommend"></asp:LinkButton>
        <asp:LinkButton ID="lkBtnExitInfo" runat="server" Text='<%# ExitInfoText(Eval("Status"),Eval("UserType")) %>' CommandArgument='<%# Eval("Id") %>' CommandName="ExitInfo" CausesValidation="False" OnClientClick="javascript:return confirm('是否确定退稿？')">退稿</asp:LinkButton>
        <asp:LinkButton ID="lkBtnAnomaly" runat="server" CommandArgument='<%# Eval("Id")+"┃"+Eval("Title") %>' CommandName="Anomaly">设为不规则</asp:LinkButton>
      </ItemTemplate>
      <ItemStyle Width="250px" />
    </asp:TemplateField>
    </Columns>
    <HeaderStyle CssClass="title" Width="20px" />
    <PagerStyle CssClass="tc" />
    <RowStyle CssClass="tdbg" />
  </asp:GridView>
  <table cellpadding="0" cellspacing="1" class="border" align="center">
    <tr class="wzlist">
      <td><input type="checkbox" onClick="SetCheckBox()" id="chkBoxChooseAll" />
        <label for="chkBoxChooseAll">全选</label>
        <span id="Div1" runat="server">
        <asp:Button ID="btnMainSiteGetRecord" Text="信息推送" runat="server" CssClass="btn" OnClick="btnMainSiteGetRecord_Click" />
        </span>
        <span id="dvCreateSelectInfo" runat="server">
        <asp:Button ID="btnCreateSelectInfo" runat="server" CssClass="btn" OnClick="btnCreateSelectInfo_Click" OnClientClick="if(!IsSelectedId()){alert('请选择生成项！');return false;}else{return confirm('是否确定生成选中内容？')}" />
        </span>
        <span id="dvCreateColumn" runat="server">
        <asp:Button ID="btnCreateColumn" runat="server" CssClass="btn" OnClick="btnCreateColumn_Click" OnClientClick="return confirm('是否确定生成本栏目所有内容？')" />
        </span>
        <span id="dvAudit" runat="server">
        <asp:Button ID="btnAudit" runat="server" CssClass="btn" OnClick="btnAudit_Click" OnClientClick="if(!IsSelectedId()){alert('请选择审核项！');return false;}else{return confirm('是否确定审核选中内容？')}" />
        </span>
        <span id="dvMassSet" runat="server">
        <asp:Button ID="btnMassSet" runat="server" Text="批量设置" CssClass="btn" OnClick="btnMassSet_Click" />
        </span>
        <span id="dvMassMove" runat="server">
        <asp:Button ID="btnMassMove" runat="server" Text="批量移动" CssClass="btn" OnClick="btnMassMove_Click" />
        </span>
        <span id="dvDeleteTotal" runat="server">
        <asp:Button ID="btnDeleteAll" runat="server" Text="批量删除" OnClick="btnDeleteAll_Click" OnClientClick="if(!IsSelectedId()){alert('请选择删除项！');return false;}else{return confirm('是否确定将所有选择项放入回收站？')}" CssClass="btn" UseSubmitBehavior="true" />
        </span></td>
    </tr>
  </table>
  <table cellpadding="0" cellspacing="1" class="border" align="center">
    <tr class="wzlist">
      <td><webdiyer:AspNetPager ID="AspNetPager" runat="server" AlwaysShow="True" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" OnPageChanging="AspNetPager_PageChanging" PageSize="20" PrevPageText="上一页" ShowCustomInfoSection="Left" ShowInputBox="Never" ShowNavigationToolTip="True" Width="99%" HorizontalAlign="Right" LayoutType="Table" CustomInfoSectionWidth="10%"></webdiyer:AspNetPager></td>
    </tr>
  </table>
  <table cellpadding="0" cellspacing="1" class="border" align="center">
    <tr class="wzlist">
      <td><strong>内容搜索：</strong>
      <asp:DropDownList ID="ddlColId" runat="server"></asp:DropDownList>
        <asp:DropDownList ID="ddlsortName" runat="server">
          <asp:ListItem Value="Title"></asp:ListItem>
          <asp:ListItem Value="UName">录入者</asp:ListItem>
          <asp:ListItem Value="AdminUName">审核人</asp:ListItem>
        </asp:DropDownList>
        <asp:TextBox ID="txtKeyword" runat="server" MaxLength="50"></asp:TextBox>
        <asp:Button runat="server" ID="btnGoSearch" Text="搜索" CssClass="btn" OnClick="btnGoSearch_Click" OnClientClick="javascript:if($('txtKeyword').value==''){alert('请输入搜索关键字！');$('txtKeyword').focus();return false;}" /></td>
    </tr>
  </table>
</form>
<br />
</body>
</html>