<%@ page language="C#" masterpagefile="~/Member/MyShopMasterPage.master" autoeventwireup="true" inherits="Member_PromotionManage_ProductScore, 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>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script src="../../Js/Function.js" type="text/javascript"></script>
    <div class="pageTitle" style="line-height: 30px; vertical-align: middle;">
        &nbsp;&nbsp;&nbsp;&nbsp;<asp:Literal ID="ltrTitle" runat="server">积分商品管理</asp:Literal>
        &nbsp;&nbsp;&nbsp;&nbsp;<a target="_blank" href="../../ClassChoose.aspx?showProType=<%=ProType %>"
            style="font-weight: normal; color: Black;">添加积分商品</a>
    </div>
    <div id="MainMenu">
        <div class="TabMenu">
            <!--一级导航-->
            <ul id="M1">
                <li id="saleli" class="active"><a href="ProductScore.aspx?TabMenu=tabSale">
                    <asp:Label ID="lblSale" runat="server" Text="上架" />
                </a></li>
                <li id="stockli"><a href="ProductScore.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:TextBox ID="txtProductName" CausesValidation="false" runat="server"></asp:TextBox>
                            &nbsp;<asp:Button ID="SeachBut" runat="server" Text="查询" OnClick="SeachBut_Click" />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <br />
                <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")%>
                                </a>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="报警下限" DataField="AlarmNum" />
                        <asp:BoundField HeaderText="库存" DataField="Stocks" />
                        <asp:BoundField HeaderText="单位" DataField="PUnit" />
                        <asp:BoundField HeaderText="价格" DataField="StandPrice" />
                        <asp:BoundField HeaderText="换购积分" DataField="NeedPresentExp" />
                        <asp:TemplateField HeaderText="推荐">
                            <ItemTemplate>
                                <%#GetStatus(Eval("IsElite"))%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbtnStopSale" CommandName="StopSale" CommandArgument='<%# Eval("ProductID")%>'
                                    OnCommand="Button_Command" runat="server">下架</asp:LinkButton>
                                <asp:LinkButton ID="lbtnOnSale" CommandName="OnSale" CommandArgument='<%# Eval("ProductID")%>'
                                    OnCommand="Button_Command" runat="server">上架</asp:LinkButton>
                                <asp:HyperLink ID="editProduct" runat="server" Text="编辑" NavigateUrl='<%#"~/Add_Products.aspx?ProductID="+Eval("ProductID")+"&showProType=5" %>'
                                    Target="_blank" />
                                <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>
                                <th>
                                    推荐
                                </th>
                            </tr>
                            <td colspan="9" style="text-align: center">
                                没有符合条件的商品数据！
                            </td>
                        </table>
                    </EmptyDataTemplate>
                </asp:GridView>
                <table class="SearchTableStyle" style="text-align: left">
                    <tr>
                        <td class="page" style="float: left">
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:Literal ID="ltrPagePanel" runat="server"></asp:Literal>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="line-height: 30px">
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:Button ID="btnMoreStopSale" runat="server" Text="商品下架" CommandName="MoreStopSale"
                                OnCommand="Button_Command" />
                            &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnMoreOnSale" runat="server" Text="商品上架"
                                CommandName="MoreOnSale" OnCommand="Button_Command" />
                            &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnMoreDelete" CommandName="MoreDelete" OnCommand="Button_Command"
                                runat="server" Text="批量删除" />
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Blue">
                            &nbsp;&nbsp;<asp:Literal ID="ltrTishi" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </table>
            </asp:PlaceHolder>
        </div>
    </div>
    <script type="text/javascript">        setButtonActive('<%=m_flag %>');</script>
</asp:Content>
