<%@ page language="C#" masterpagefile="~/Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_Stock_AlarmManage, WebApp_deploy" title="库存报警管理" %>

<asp:Content ID="cphContent" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script src="Js/Function.js" type="text/javascript"></script>
    <table class="nick" id="table_item" runat="server">
        <tr>
            <td class="tit left1">
                &nbsp;&nbsp;<asp:Literal ID="ltrTitle" runat="server">库存报警提醒</asp:Literal>
            </td>
        </tr>
    </table>
    <div id="MainMenu">
        <div class="TabText">
            <asp:Panel ID="pnlManage" runat="server">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <table class="nick">
                            <tr>
                                <td class="tit" colspan="4">
                                    &nbsp;<b>查询：</b>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">
                                    &nbsp;商品上下架：
                                </td>
                                <td class="rtd">
                                    &nbsp;<asp:DropDownList ID="ddlEnableSale" runat="server">
                                        <asp:ListItem Value="0">下架</asp:ListItem>
                                        <asp:ListItem Value="1" Selected="True">上架</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td class="ltd">
                                    &nbsp;商品类型：
                                </td>
                                <td class="rtd">
                                    &nbsp;<asp:DropDownList ID="ddlProdcutType" runat="server">
                                        <asp:ListItem Value="0">全部</asp:ListItem>
                                        <asp:ListItem Value="1">一口价</asp:ListItem>
                                        <asp:ListItem Value="2">拍卖</asp:ListItem>
                                        <asp:ListItem Value="3">团购</asp:ListItem>
                                        <asp:ListItem Value="4">促销(秒杀)</asp:ListItem>
                                        <asp:ListItem Value="5">积分商品</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">
                                    &nbsp;高级查询：
                                </td>
                                <td class="rtd">
                                    &nbsp;<asp:DropDownList ID="ddlDetailSearchType" runat="server" AppendDataBoundItems="True">
                                        <asp:ListItem Selected="True" Value="product_name" Text="按商品名称" />
                                        <asp:ListItem Value="saler_name" Text="按卖家名称" />
                                        <asp:ListItem Value="product_class" Text="按商品分类" />
                                    </asp:DropDownList>
                                    <asp:TextBox ID="DetailSearchName" runat="server" Width="150px" AutoPostBack="false" />
                                </td>
                                <td colspan="2" class="rtd">
                                    &nbsp;&nbsp;<asp:Button ID="SeachBut" runat="server" Text="查询" OnClick="SeachBut_Click" />
                                </td>
                            </tr>
                        </table>
                        <asp:GridView ID="gvManage" CssClass="adminlist" runat="server" AutoGenerateColumns="false"
                            AllowPaging="True" OnRowDataBound="gvManage_RowDataBound" OnPageIndexChanging="gvManage_PageIndexChanging"
                            PageSize="10">
                            <Columns>
                                <asp:TemplateField HeaderText="图片">
                                    <HeaderStyle Width="110px" />
                                    <ItemTemplate>
                                        <a href='<%# "../../ShowProduct.aspx?ProductID="+Eval("ProductID") %>' target="_blank">
                                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# (Convert.ToString(Eval("ProductSmallImageUrl"))==""?"../../Images/show_nopic.gif":"../../"+Eval("ProductSmallImageUrl").ToString()) %>'
                                                Height="80px" Width="80px" />
                                        </a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="商品名称" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <a href='<%# "../../ShowProduct.aspx?ProductID="+Eval("ProductID") %>' target="_blank">
                                            <%#Eval("ProductName").ToString().Length > 10 ? Eval("ProductName").ToString().Substring(0, 8)+"..." : Eval("ProductName")%>
                                        </a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="商家名称" DataField="UserName" />
                                <asp:BoundField HeaderText="商品分类" DataField="ClassName" />
                                <asp:TemplateField HeaderText="商品类型">
                                    <ItemTemplate>
                                        <%# HoWave.Web.Shop.TextFormat.GetProductType(Eval("ProductType").ToString()) %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="报警下限" DataField="AlarmNum" />
                                <asp:BoundField HeaderText="库存" DataField="Stocks" />
                                <asp:BoundField HeaderText="单位" DataField="PUnit" />
                                <asp:BoundField HeaderText="价格" DataField="StandPrice" />
                                <asp:TemplateField HeaderText="推荐">
                                    <ItemTemplate>
                                        <%#HoWave.Web.Shop.TextFormat.GetStatus(Eval("IsElite"))%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="销售中">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hfEnableSale" Value='<%#Eval("EnableSale") %>' runat="server" />
                                        <%#HoWave.Web.Shop.TextFormat.GetStatus(Eval("EnableSale"))%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataTemplate>
                                <table class="adminlist" width="100%">
                                    <tr>
                                        <th>
                                            编号
                                        </th>
                                        <th>
                                            图片
                                        </th>
                                        <th>
                                            商品名称
                                        </th>
                                        <th>
                                            商家名称
                                        </th>
                                        <th>
                                            商品分类
                                        </th>
                                        <th>
                                            商品类型
                                        </th>
                                        <th>
                                            报警下限
                                        </th>
                                        <th>
                                            库存
                                        </th>
                                        <th>
                                            单位
                                        </th>
                                        <th>
                                            价格
                                        </th>
                                        <th>
                                            推荐
                                        </th>
                                        <th>
                                            销售中
                                        </th>
                                    </tr>
                                    <td colspan="11" style="text-align: center">
                                        没有符合条件的商品数据！
                                    </td>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                        <asp:Literal ID="ltrPagePanel" runat="server"></asp:Literal>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="SeachBut" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
