<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WebMvc.ViewData.ModelViewData>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    产品展示
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
   <script type="text/javascript">
        var GB_ROOT_DIR = "/greybox/";
    </script>
    <script type="text/javascript" src="/greybox/AJS.js"></script>
    <script type="text/javascript" src="/greybox/AJS_fx.js"></script>
    <script type="text/javascript" src="/greybox/gb_scripts.js"></script>
    <link href="/greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        产品展示
        <%if (Request.IsAuthenticated)
          { %>
        <%= Html.ActionLink("[管理]", "List")%>
        <%}%></h2>
    <table cellspacing="0" cellpadding="0" width="559" border="0">
        <tr>
            <td>
                <img height="28" src="/images/cpzs.gif" width="559">
            </td>
        </tr>
    </table>
    <div style="text-align: left">
        <table cellspacing="0" cellpadding="5" width="559" border="0">
            <tr>
                <td>
                    <!--普通产品展示-->
                    <% foreach (var item in Model.Products)
                       {                                                                                         
                    %>
                    <table border="0" cellpadding="5" cellspacing="1">
                        <tr>
                            <td align="center" valign="middle">
                                <a href='/ProductImages/<%=item.Image %>' title="商品信息" rel="gb_page_center[700, 530]">
                                    <img width="150" height="150" border="0" src='/ProductImages/<%=item.Image %>'>
                                </a>
                            </td>
                            <td width="300"  background="images/0079.GIF" align="left" valign="top">
                                产品名称： <a href='/Product/Details/<%=item.ProductId %>'  target="_blank" title="<%=item.Name%> 的详细信息">
                                    <%=item.Name%>
                                </a>
                                <br />
                                产品价格：
                                <%=item.Price%>
                                元<br />
                                产品描述：
                                <%=item.Descn%>
                            </td>
                        </tr>
                    </table>
                    <% } %>
                </td>
            </tr>
        </table>
        <!--分页导航-->
        <table width="559" height="28" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td align="left" valign="middle">
                    ○ 页次：<%= ViewData.Model.CurrentPage%>/<%= ViewData.Model.TotalPages%>
                    页
                </td>
                <td align="right" valign="middle">
                    <% if (ViewData.Model.HasPreviousPage)
                       { %>
                    <%=Html.ActionLink("第一页", "Index", new { page = 1 }, null)%>
                    <%=Html.ActionLink("上一页", "Index", new { page = ViewData.Model.PreviousPage }, null)%>
                    <% }
                       else
                       { %>
                    第一页 上一页
                    <% } %>
                    <% if (ViewData.Model.HasNextPage)
                       { %>
                    <%=Html.ActionLink("下一页", "Index", new { page = ViewData.Model.NextPage }, null)%>
                    <%=Html.ActionLink("最后页", "Index", new { page = ViewData.Model.TotalPages }, null)%>
                    <% }
                       else
                       { %>
                    下一页 最后页
                    <% } %>
                </td>
            </tr>
        </table>
        <!--分页导航end-->
    </div>
</asp:Content>
