<%@ page language="C#" masterpagefile="~/Member/MyShopMasterPage.master" autoeventwireup="true" inherits="Member_StockManage_StockAlarmManage, WebApp_deploy" title="库存报警提醒" %>

<asp:Content ID="cphContent" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        //切换选项卡                
        function setButtonActive(flags) {
            var _flag = parseInt(flags);

            var saleli = document.getElementById("saleli");
            var stockli = document.getElementById("stockli");
            if (_flag == 1) {
                saleli.className = "active";
                stockli.className = "";
            } else {
                saleli.className = "";
                stockli.className = "active";
            }

        }   
    </script>
    <div class="pageTitle" style="line-height: 30px; vertical-align: middle;">
        &nbsp;&nbsp;&nbsp;&nbsp;<asp:Literal ID="ltrTitle" runat="server">库存报警提醒</asp:Literal></div>
    <div id="MainMenu">
        <div class="TabMenu">
            <!--一级导航-->
            <ul id="M1">
                <li id="saleli" class="active"><a href="StockAlarmManage.aspx?TabMenu=tabSale">
                    <asp:Label ID="lblSale" runat="server" Text="上架" />
                </a></li>
                <li id="stockli"><a href="StockAlarmManage.aspx?TabMenu=tabStock">
                    <asp:Label ID="lblStock" runat="server" Text="下架" />
                </a></li>
            </ul>
        </div>
        <div class="TabText">
            <asp:PlaceHolder ID="phManage" runat="server">
                <table class="SearchTableStyle">
                    <tr>
                        <th colspan="3" style="float: left; text-align: left">
                            &nbsp;<b>高级查询：</b>
                        </th>
                    </tr>
                    <tr>
                        <td>
                            &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>
                        <td>
                            &nbsp;商品名称：<asp:TextBox ID="txtProductName" CausesValidation="false" runat="server"></asp:TextBox>
                            &nbsp;<asp:Button ID="SeachBut" runat="server" Text="查询" OnClick="SeachBut_Click" />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="gvManage" CssClass="tableHead" runat="server" AutoGenerateColumns="false"
                    AllowPaging="True" OnRowDataBound="gvManage_RowDataBound" OnPageIndexChanging="gvManage_PageIndexChanging"
                    PageSize="10">
                    <Columns>
                        <asp:TemplateField HeaderText="选择">
                            <ItemTemplate>
                                <input type="checkbox" id="SelectId" name="SelectId" value='<%# Eval("ProductID") %>' />
                            </ItemTemplate>
                            <HeaderTemplate>
                                &nbsp;&nbsp;<input type="checkbox" id="chkAll" onclick="SelectAllCheckboxes(this,'SelectId')" />&nbsp;
                            </HeaderTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="编号" DataField="ProductID" />
                        <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="AlarmNum" />
                        <asp:BoundField HeaderText="库存" DataField="Stocks" />
                        <asp:TemplateField HeaderText="差量">
                            <ItemTemplate>
                                <asp:HiddenField ID="hfAlarmNum" Value='<%#Eval("AlarmNum") %>' runat="server" />
                                <asp:HiddenField ID="hfStocks" Value='<%#Eval("Stocks") %>' runat="server" />
                                <asp:Label ID="lblChaLiang" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="单位" DataField="PUnit" />
                        <asp:BoundField HeaderText="价格" DataField="StandPrice" />
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <%--<asp:LinkButton ID="lbtnUpdate" CommandName="inStock" CommandArgument='<%# Eval("ProductID")%>'
                                    OnCommand="Button_Command" runat="server">添货</asp:LinkButton>--%>
                                <asp:LinkButton ID="lbtnDelete" CommandName="DelInfo" CommandArgument='<%# Eval("ProductID") %>'
                                    OnCommand="Button_Command" runat="server" OnClientClick="return confirm('确定要删除该信息吗？');">删除</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <table class="tableHead" width="100%">
                            <tr>
                                <th>
                                    编号
                                </th>
                                <th>
                                    图片
                                </th>
                                <th>
                                    商品名称
                                </th>
                                <th>
                                    报警下限
                                </th>
                                <th>
                                    库存
                                </th>
                                <th>
                                    差量
                                </th>
                                <th>
                                    单位
                                </th>
                                <th>
                                    价格
                                </th>
                            </tr>
                            <td colspan="8" style="text-align: center">
                                没有符合条件的商品数据！
                            </td>
                        </table>
                    </EmptyDataTemplate>
                </asp:GridView>
                <div style="text-align: center;">
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Literal ID="ltrPagePanel" runat="server"></asp:Literal>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                </div>
                <div id="button1" runat="server">
                    &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnMoreDelete" CommandName="MoreDelete" OnCommand="Button_Command"
                        runat="server" Text="批量删除" />
                    &nbsp;&nbsp;&nbsp;&nbsp;<%--<asp:Button ID="btnMoreInStock" CommandName="MoreInStock"
                                OnCommand="Button_Command" runat="server" Text="批量添货" />--%>
                </div>
                <div id="tishi" runat="server">
                    &nbsp;&nbsp;<asp:Literal ID="ltrTishi" runat="server"></asp:Literal></div>
                <br />
            </asp:PlaceHolder>
        </div>
    </div>
    <script type="text/javascript">        setButtonActive('<%=m_flag %>');</script>
</asp:Content>
