<%@ Page Language="C#" AutoEventWireup="true"  MasterPageFile="~/User/Main.Master"
    EnableViewState="true" CodeBehind="ProductList.aspx.cs" Inherits="OAWeb.User.ProductList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="/UserControls/UserLeft.ascx" TagName="TaskNav" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlace" runat="server">
<script type="text/javascript" language="javascript">
    function OpenWin() {

        OpenRadioDialog('/User/CustomerDialog.aspx?AgentId=<%= UserModel.CustomerID %>', '选择客户', CallbackFun);

        return false;
    }

    function CallbackFun(text, value) {
        $('#<%=txtCustomerName.ClientID %>').val(text);
        $('#<%=txtCustomerID.ClientID %>').val(value);

        document.getElementById('<% =Button2.ClientID %>').click();
    }     
    </script>
 <style>
        .data_field ul li
        {
            float: left;
            margin-right: 3px;
        }
    </style>
    <div class="w main">
        <div class="right">
            <table class="data_title" cellspacing="3" style=" border:none">
                <tr>
                    <td class="data_caption">
                        产品和服务
                       
                    </td>
                </tr>
                <tr>
                    <td class="data_field">
                        
                        <ul>
                        
                            
                            <li>产品名称:
                                <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
                            </li>
                          
                            <li>&nbsp;
                                <asp:Button ID="btnSearch" runat="server" Text="查  询" class="btn_77px" /></li>

                                <li id="LiCustomer" runat="server" visible="false">&nbsp;选择客户：<asp:TextBox ID="txtCustomerName" runat="server" ReadOnly="true"></asp:TextBox> 
                                    <asp:HiddenField ID="txtCustomerID" runat="server" />
                                    <asp:Button ID="Button1" runat="server" Text="选择" CssClass="btn_77px" OnClientClick=" return OpenWin()"  />
                                    <span style=" display:none"><asp:Button ID="Button2" runat="server" Text="Button" 
                                        onclick="Button2_Click"   /></span>
                                </li>
                        </ul>
                    </td>
                </tr>
            </table>
          
            <div class="list">
                <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" 
                    GridLines="None" CellPadding="0" CssClass="table_list" EnableModelValidation="True"
                    OnRowDataBound="gvData_RowDataBound">
                    <RowStyle HorizontalAlign="Left" />
                    <Columns>
                        
                        <asp:TemplateField HeaderText="名称">
                        <ItemStyle HorizontalAlign="Left" />
                            <ItemTemplate>
                                <%# Eval("ProductName") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="已购买数量">
                        <ItemStyle HorizontalAlign="Left" />
                            <ItemTemplate>
                                <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
                                <asp:Label ID="lblProductId" runat="server" Text='<%# Eval("Id") %>' Visible="false"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
     
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkView" runat="server">详细</asp:LinkButton>
                               
                                <a id="LinkOrder" runat="server">订购</a>
                                <a href='' id="LinkManage" runat="server">进入管理</a>
                                
                                
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="pager-bar">
                    <webdiyer:AspNetPager ID="pager" runat="server" CssClass="anpager" currentpagebuttonclass="cpb"
                        PageSize="20" NextPageText="下一页" LastPageText="页 尾" FirstPageText="第一页" PrevPageText="上一页"
                        ShowBoxThreshold="10" SubmitButtonText="跳 转" UrlPaging="True">
                    </webdiyer:AspNetPager>
                </div>
            </div>
        </div>
        <div class="left">
            <uc1:TaskNav ID="TaskNav1" runat="server" />
        </div>
    </div>
</asp:Content>
