<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.ProductReviewsControl"
    CodeBehind="ProductReviews.ascx.cs" %>
<div class="section-title">
    <img src="Common/ico-catalog.png" alt="Configuration" />
    Product Reviews
</div>
<asp:DataPager ID="pagerProductReviews" runat="server" PagedControlID="lvProductReviews"
    PageSize="10">
    <Fields>
        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
    </Fields>
</asp:DataPager>
<asp:ListView ID="lvProductReviews" runat="server" DataKeyNames="ProductReviewID"
    OnPagePropertiesChanging="lvProductReviews_OnPagePropertiesChanging">
    <LayoutTemplate>
        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
    </LayoutTemplate>
    <ItemTemplate>
        <p>
            <strong>
                <%#Server.HtmlEncode(Eval("Title").ToString())%></strong>
        </p>
        <p>
            <%#ProductManager.FormatProductReviewText((string)Eval("ReviewText"))%>
        </p>
        <p>
            <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn")).ToString()%>
            -
            <%#GetCustomerInfo (Convert.ToInt32(Eval("CustomerID")))%></p>
        <p>
            <b><a href="ProductDetails.aspx?ProductID=<%#Eval("ProductID")%>" title="Click to view product details">
                <%#Server.HtmlEncode(((Product)Eval("Product")).Name)%></a></b>
        </p>
        <p>
        </p>
        <asp:Button runat="server" ID="btnUpdateProductReview" CssClass="adminButton" Text='<%# Convert.ToBoolean(Eval("IsApproved"))?"Disapprove" :"Approve"%>'
            ToolTip='<%# Convert.ToBoolean(Eval("IsApproved"))?"Disapprove the product review" :"Approve the product review"%>'
            CommandName="Update" OnCommand="btnUpdateProductReview_Click" CommandArgument='<%#Eval("ProductReviewID")%>' />
        <p>
        </p>
        <asp:Button runat="server" ID="btnEditProductReview" CssClass="adminButton" Text="Edit"
            ToolTip="Edit the product review" CommandName="Edit" OnCommand="btnEditProductReview_Click"
            CommandArgument='<%#Eval("ProductReviewID")%>' />
        <asp:Button runat="server" ID="btnDeleteProductReview" CssClass="adminButton" Text="Delete"
            ToolTip="Delete the product review" CommandName="Delete" OnCommand="btnDeleteProductReview_Click"
            CommandArgument='<%#Eval("ProductReviewID")%>' />
    </ItemTemplate>
    <ItemSeparatorTemplate>
        <hr />
    </ItemSeparatorTemplate>
</asp:ListView>
