<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.NewsCommentsControl"
    CodeBehind="NewsComments.ascx.cs" %>
<div class="section-title">
    <img src="Common/ico-content.png" alt="News" />
    Manage News Comments
</div>
<asp:DataPager ID="pagerNewsComments" runat="server" PagedControlID="lvNewsComments"
    PageSize="10">
    <Fields>
        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
    </Fields>
</asp:DataPager>
<asp:ListView ID="lvNewsComments" runat="server" DataKeyNames="NewsCommentID" OnPagePropertiesChanging="lvNewsComments_OnPagePropertiesChanging">
    <LayoutTemplate>
        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
    </LayoutTemplate>
    <ItemTemplate>
        <p>
            <strong>
                <%#Server.HtmlEncode((string)Eval("Title"))%>
            </strong>
        </p>
        <p>
            <%#NewsManager.FormatCommentText((string)Eval("Comment"))%>
        </p>
        <p>
            <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn")).ToString()%>
            -
            <%#GetCustomerInfo (Convert.ToInt32(Eval("CustomerID")))%>
        </p>
        <p>
            <a href="NewsDetails.aspx?NewsID=<%#Eval("NewsID")%>">
                <%#Server.HtmlEncode(((News)Eval("News")).Title)%></a>
        </p>
        <asp:Button runat="server" ID="btnEditNewsComment" CssClass="adminButton" Text="Edit"
            ToolTip="Edit news entry comment" CommandName="Edit" OnCommand="btnEditNewsComment_Click"
            CommandArgument='<%#Eval("NewsCommentID")%>' />
        <asp:Button runat="server" ID="btnDeleteNewsComment" CssClass="adminButton" Text="Delete"
            ToolTip="Delete news entry comment" CommandName="Delete" OnCommand="btnDeleteNewsComment_Click"
            CommandArgument='<%#Eval("NewsCommentID")%>' />
    </ItemTemplate>
    <ItemSeparatorTemplate>
        <hr />
    </ItemSeparatorTemplate>
</asp:ListView>
