<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" AutoEventWireup="true"
    CodeFile="MemberProductList.aspx.cs" Inherits="Member_Trade_MemberProductList"
    Title="Untitled Page" %>

<%@ Register Src="../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="Server">

    <script type="text/javascript">
    
         function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
    </script>

    <div class="itemtitle">
        产品管理
    </div>
    <div class="itemtitle_tect">
        <ul>
            <li>通过供应信息管理，您可以进行编辑信息审核、推荐、修改和删除等操作；</li></ul>
    </div>
    <div class="clr">
    </div>
    <div class="partition">
        <div class="Option">
            <asp:Label ID="Label5" runat="server"><strong>快捷操作</strong></asp:Label>
            <asp:Label ID="Label1" runat="server"><a href="?v=0">所有信息</a></asp:Label>
            <asp:Label ID="Label2" runat="server"><a href="?v=1">产品已审核</a></asp:Label>
            <asp:Label ID="Label3" runat="server"><a href="?v=2">产品未审核</a></asp:Label>
            <asp:Label ID="Label4" runat="server"><a href="?v=3">请求靠前</a></asp:Label>
            <asp:Label ID="Label6" runat="server"><a href="?v=4">已请求靠前</a></asp:Label>
        </div>
    </div>
    <div class="talbe_border">
        <asp:GridView ID="gvProducts" runat="server" CssClass="talbe_list" CellPadding="0"
            GridLines="None" AutoGenerateColumns="False" DataKeyNames="ID" OnRowDataBound="gvProducts_RowDataBound">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox1" runat="server" />
                    </ItemTemplate>
                    <HeaderStyle CssClass="th20 tou" />
                    <ItemStyle CssClass="nolet" />
                </asp:TemplateField>
                <asp:TemplateField Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="lblId" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="公司名称">
                    <ItemTemplate>
                        <%# Eval("CompanyName") %>
                    </ItemTemplate>
                    <ItemStyle CssClass="left2" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="产品名称">
                    <ItemTemplate>
                        <%# Eval("Name") %>
                    </ItemTemplate>
                    <ItemStyle CssClass="th80" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="是否靠前">
                    <ItemTemplate>
                        <%# DataBinder.Eval(Container.DataItem, "IsTop").ToString()== "True" ? "是" : "否"%>
                    </ItemTemplate>
                    <ItemStyle CssClass="th30" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="要求">
                    <ItemTemplate>
                        <%# Eval("Ask") %>
                    </ItemTemplate>
                    <ItemStyle CssClass="th30" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="有效期至">
                    <ItemTemplate>
                        <asp:Label ID="Label9" runat="server" Text='<%# GetShortDate(Eval("LastDate").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle CssClass="th30" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="申请日期">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# GetShortDate(Eval("AddDate").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle CssClass="th30" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="产品审核">
                    <ItemTemplate>
                        <span>
                            <%#  ShowVerify(Eval("Verify").ToString())  %>
                        </span>
                    </ItemTemplate>
                    <ItemStyle CssClass="th30" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <a href='MemberProductEdit.aspx?productID=<%# Eval("ID") %>'>编辑</a> |
                        <asp:LinkButton ID="lbtnDelete" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID")%>'
                            Font-Underline="false" Text="删除" OnCommand="lbtnDelete_Command" OnClientClick="return confirm('你确定要删除吗?')"></asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle CssClass="th80" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="header" />
        </asp:GridView>
        <div class="Paging">
            <p>
                <uc1:PageNo ID="PageNo1" runat="server" />
            </p>
            <input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" />全选
            <asp:Button ID="btnDelete" runat="server" Font-Size="9pt" Text="批量删除" CssClass="i_button"
                OnClientClick="return confirm('你确定要删除吗？')" OnClick="btnDelete_Click" />
            <asp:Label ID="lblMessage" runat="server" Visible="false"></asp:Label>
        </div>
    </div>
</asp:Content>
