<%@ page language="C#" autoeventwireup="true" inherits="Admin_CustomerList, App_Web_qxuvifui" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>角色</title>
    <link href="../CSS/All.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/pager.css" rel="stylesheet" type="text/css" />
    <script src="../JS/xzOper.js" type="text/javascript"></script>
    <script src="../JS/jquery.min.js" type="text/javascript"></script>
    <script src="../JS/jquery.autocomplete.pack.js" type="text/javascript"></script>
    <link href="../CSS/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    
</head>
<body>
    <form id="Myform" runat="server" >
        <div class="title" >
            客户信息</div>
        <div >
            <asp:Literal ID="litNew" runat="server"></asp:Literal>
            <br />
            <fieldset>
            <legend>查询</legend>【查询：】<asp:DropDownList ID="ddlQueryClass" runat="server" Width="110px">
                <asp:ListItem Value="1">QQ</asp:ListItem>
                <asp:ListItem Value="2">阿里旺旺</asp:ListItem>
                <asp:ListItem Value="3">客户名</asp:ListItem>
            </asp:DropDownList>
                <asp:TextBox ID="txtQuery" runat="server" Width="214px" ></asp:TextBox>&nbsp;
            <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" CssClass="btn" />
                <asp:Button ID="btnShowAll" runat="server" Text="全部显示" OnClick="btnShowAll_Click" CssClass="btn" />
           </fieldset>
        </div>    
        <fieldset>
        <legend>内容区域</legend>
        <div  id="view">
        <asp:GridView
            ID="TableView" runat="server" AutoGenerateColumns="False"
             EmptyDataText="没有可显示的数据记录。" Width="100%" BorderStyle="Solid" DataKeyNames="CID" OnRowDataBound="TableView_RowDataBound">
             <Columns>
                 <asp:TemplateField HeaderText="选择"> 
                     <ItemTemplate>
                         <asp:CheckBox ID="CBSelect" runat="server" />
                     </ItemTemplate>
                     <HeaderStyle Height="30px"  Wrap="False"/>
                     <ItemStyle Height="30px"  Wrap="False" />
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="操作" SortExpression="EID">
                     <ItemTemplate>
                         <asp:Literal ID="litCustEdit" runat="server"></asp:Literal>
                         <asp:Literal ID="litProjectNew" runat="server"></asp:Literal>
                         <asp:Literal ID="ListIntenProjectNew" runat="server"></asp:Literal>
                        
                     </ItemTemplate>
                     <HeaderStyle Wrap="False"/>
                     <ItemStyle Wrap="False"/>
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="客户名" SortExpression="CustName">
                     <ItemTemplate>
                       <%--  <a href="ProjectList.aspx?CustID="></a>--%>
                         <asp:Label ID="Label2" runat="server" Text='<%# Bind("CustName") %>'></asp:Label>
                     </ItemTemplate>
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="网址" SortExpression="CustUrl">
                     <ItemTemplate>
                         <asp:Literal ID="litUrl" runat="server"></asp:Literal>
                     </ItemTemplate>
         
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="EMAIL" SortExpression="CustEMAIL">
                     <ItemTemplate>
                         <asp:Literal ID="litEmail" runat="server"></asp:Literal>
                       
                     </ItemTemplate>
         
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="QQ" SortExpression="CustQQ">
                     <ItemTemplate>
                     <%--    <asp:Label ID="Label1" runat="server" Text='<%# Bind("CustQQ") %>'></asp:Label>--%>
                           <asp:Literal ID="litQQ" runat="server"></asp:Literal>
                     
                        
                     </ItemTemplate>
    
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="阿里旺旺">
                     <ItemTemplate>
                         <asp:Literal ID="litWW" runat="server"></asp:Literal>
                        
                     </ItemTemplate>
                 </asp:TemplateField>
                 <asp:BoundField DataField="linkMan" HeaderText="联系人" />
                 <asp:BoundField DataField="LinkManPhone" HeaderText="联系方式" />
                 <asp:BoundField DataField="City" HeaderText="所在地" />
                 <asp:BoundField DataField="Sales" HeaderText="客户所属" />
                 <asp:BoundField DataField="CustSourse" HeaderText="客户来源" >
               
                     </asp:BoundField >
                 <asp:BoundField DataField="CustClass" HeaderText="客户类型" >
             
                     </asp:BoundField >
                 <asp:BoundField DataField="CustGrade" HeaderText="客户等级" >
          
                     </asp:BoundField >
                 <asp:BoundField DataField="CustIndustry" HeaderText="行业类型" >
           
                     </asp:BoundField >
                 <asp:BoundField DataField="IDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="录入日期" />
                </Columns>
                  <FooterStyle CssClass="GridViewFooterStyle" />
                 <RowStyle CssClass="GridViewRowStyle" />   
                 <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                 <PagerStyle CssClass="GridViewPagerStyle" />
                 <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                 <HeaderStyle CssClass="GridViewHeaderStyle" />
                 
        </asp:GridView>
        </div>
        <div style="border-top:ridge 1px #F6F6F6; margin-top:10px" >
        
            <input id="Button12" class="btn" onclick="Opposite('view')" type="button" value="反选"  />
            <asp:Button ID="btnPTestAll" runat="server" CssClass="btn" OnClick="btnPTestAll_Click"
                OnClientClick="if(confirm('确定删除所有选中吗？')){return isSelect('view')}else{return false;}"
                Text="删除选中" />&nbsp;
      
        </div>  
      </fieldset>
    <webdiyer:aspnetpager id="PagerButtom" runat="server" alwaysshow="True" cssclass="paginator"
                currentpagebuttonclass="cpb" custominfohtml="当前第%CurrentPageIndex%/%PageCount%页 共%RecordCount%条记录 每页%PageSize%条 "
                firstpagetext="首页" lastpagetext="尾页" layouttype="Table" nextpagetext="下一页" numericbuttoncount="8"
                onpagechanged="Pager_PageChanged" pagesize="25" prevpagetext="上一页" showcustominfosection="Left"
                showpageindexbox="Always">
      </webdiyer:aspnetpager>
        
    </form>
    <script>
    $(function(){

function findValue(li)
{ 
    if (li == null) return alert("No match!");
    if (!!li.extra)
    var sValue =unescape(li.extra[0]);
     
}
function selectItem(li)
{
    findValue(li);
}
    $("#txtQuery").autocomplete("autocomplete/QueryCustomer.ashx",
      {
        delay: 500,
        max: 15,
        minChars: 2,
        extraParams: {selectClass:function(){return $('#ddlQueryClass').val();}},  
        matchSubset: 1,
        cacheLength: 1,
        onItemSelect: selectItem,
        onFindValue: findValue,
        autoFill: true,
        maxItemsToShow: 20
    });

 });
  function locationUrl(url,cid){
    window.location.href=url+"?cid="+cid+"&where=<%=Server.UrlEncode(ViewState["where"].ToString()) %>&pageindex=<%=PagerButtom.CurrentPageIndex %>";
    
 }
 
    </script>
</body>
</html>