<%@ Page Title="商家黄页文章管理" StylesheetTheme="AdminSkin" Language="C#" MasterPageFile="~/Others/AdminMasterPage.Master" AutoEventWireup="true" CodeBehind="ShopArticleManage.aspx.cs" Inherits="Web.Admin.Contents.ShopArticleManage" %>

<%@ Register Assembly="BX.Common" Namespace="Common" TagPrefix="BX" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminContentHead" runat="server">
    <script src="../Script/admin.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContentCenter" runat="server">
    <form id="form1" runat="server">
        <asp:ObjectDataSource ID="ObjectDataSourceArticle" runat="server" EnablePaging="True"
            SelectMethod="ListByUser" TypeName="Logic.Article" SelectCountMethod="CountByUser">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="0" Name="categoryId" QueryStringField="CategoryID"
                    Type="Int32" />
                <asp:QueryStringParameter DefaultValue="0" Name="userId" QueryStringField="UserID"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <div class="DivRightCenter">
            <div class="listdiv">
                <div class="grid-title">
                    <div class="grid-title-text">
                        <h4>
                            <span>商家文章管理</span>
                        </h4>
                    </div>
                </div>
                <div class="grid-list">
                    <BX:ExtendedGridView ID="ExtendedGridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        CssClass="grid" PageSize="20" DataSourceID="ObjectDataSourceArticle" EnableTheming="False" ItemName="文章管理列表" CheckBox="False" CheckBoxDataIndex="0">
                        <Columns>
                            <asp:BoundField DataField="ArticleID" HeaderText="ID" />
                            <asp:BoundField DataField="CategoryName" HeaderText="类别" />
                            <asp:BoundField DataField="Title" HeaderText="标题" />
                            <asp:TemplateField HeaderText="推荐">
                                <ItemTemplate>
                                    <%# DataBinder.Eval(Container.DataItem, "Recommend").Equals(1)?"推荐":""%>
                                </ItemTemplate>
                                <ItemStyle Width="50px" Wrap="False" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="状态">
                                <ItemTemplate>
                                    <%#DataBinder.Eval(Container.DataItem, "Status").Equals(3)?"已审核":DataBinder.Eval(Container.DataItem, "Status").Equals(2)?"待审核":"草稿"%>
                                </ItemTemplate>
                                <ItemStyle Width="50px" Wrap="False" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemTemplate>
                                    <div>
                                        <ul id="Menu<%#Eval("ArticleID")%>">
                                            <li><a href='<%#"ShopArticleEdit.aspx?id="+DataBinder.Eval(Container.DataItem,"ArticleID")+"&UserID="+Request.QueryString["UserID"]+"&CategoryID="+Request.QueryString["CategoryID"] %>'>修改</a></li>
                                            <%--<li><a href='<%#"ArticleManage.aspx?cmd=delete&id="+DataBinder.Eval(Container.DataItem,"ArticleID") %>' onclick="return confirm('确定删除?');">删除</a> </li>--%>
                                            <li><a href="javascript:" onclick="if(confirm('确定删除?')){alert('删除成功!');};">删除</a> </li>
                                        </ul>
                                        <script type="text/javascript">DownMenu.load(document.getElementById("Menu<%#Eval("ArticleID")%>"))</script>
                                    </div>
                                </ItemTemplate>
                                <ItemStyle Width="100px" Wrap="False" />
                            </asp:TemplateField>
                        </Columns>
                    </BX:ExtendedGridView>
                  <script type="text/javascript">DownMenu.load()</script>
                </div>
            </div>
            <br />
            <div class="FormButtonArea">
                <asp:Button ID="Button1" runat="server" UseSubmitBehavior="false" OnClientClick="AddNew();return false;"
                    Text="添加新文章" />&nbsp;&nbsp;
                <script type="text/javascript">
                    function AddNew() {
                        document.location.href = 'ArticleEdit.aspx?UserID='+<%=Request.QueryString["UserID"]%>+'&CategoryID='+<%=Request.QueryString["CategoryID"]%>;
                    }
                </script>
            </div>
        </div>
        <br />
        <br />
    </form>
</asp:Content>
