<%@ page language="C#" autoeventwireup="true" inherits="Admin_ProjectList, 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" />
    <script src="../JS/Popup.js" type="text/javascript"></script>

    <link href="../CSS/MenuCss.css" rel="stylesheet" type="text/css" />
    <style>
    .popupPanel{
        z-index: 101;
        left: 200px;  width: 500px; 
        position: absolute;
        top: 190px; 
        height: 63px; 
        display:none;
        background-color: whitesmoke; 
        border-right: #5d7b9d 10px solid;
        border-top: #5d7b9d 10px solid; 
        border-left: #5d7b9d 10px solid; 
        border-bottom: #5d7b9d 10px solid;
    }
     .close{
        border-right: medium none;
        border-top: medium none; float: right; border-left: medium none; border-bottom: medium none;
        background-color: darkgray
    }


    </style>
</head>
<body>
    <form id="Myform" runat="server">
        <div class="title" >
            已审核项目列表</div>
        <div >
            <asp:Literal ID="litNew" runat="server"></asp:Literal>
            <br />
            <fieldset>
            <legend>查询</legend>
            <label>
                【项目名：】</label><asp:TextBox ID="txtQuery"  CssClass="ac_input" runat="server" Width="300px"></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" />
                <asp:CheckBox ID="cbComplete" runat="server" AutoPostBack="True" OnCheckedChanged="cbComplete_CheckedChanged"
                    Text="已审核完成" /></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" ShowFooter="True">
             <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="litEdit" runat="server"></asp:Literal>
                    
                        <%-- <div id="vertmenu"  >
                           <a onmouseover="$(this).siblings('ul').show();" onmouseout="$(this).siblings('ul').hide()"  >操作菜单</a>
                            <br />
                            <ul onmouseover="$(this).show();$(this).siblings('a').toggleClass('select');" onmouseout="$(this).hide();$(this).siblings('a').toggleClass('select');" >
                            <li><a href="Javascript:void(0)" onclick="locationUrl('ProjectEdit.aspx','<%#Eval("CID") %>')"  tabindex="1">编辑项目信息</a></li>
                            <li><a href="Javascript:void(0)" onclick="locationUrl('ProjectEditEmployee.aspx','<%#Eval("CID") %>')" tabindex="1">编辑项目人员</a></li>
                            <li><a href="Javascript:void(0)" onclick="locationUrl('ProjectEditPayment.aspx','<%#Eval("CID") %>')" tabindex="3">编辑付款记录</a></li>

                            </ul>
                            </div>--%>
                     </ItemTemplate>
                     <HeaderStyle Height="30px"  Wrap="False"/>
                     <ItemStyle Height="30px"  Wrap="False" />
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="功能">
                     <ItemTemplate>
                         <asp:Literal ID="litFunList" runat="server"></asp:Literal>
                         <asp:Literal ID="litNewFunction" runat="server"></asp:Literal>
                     </ItemTemplate>
                       <HeaderStyle Height="30px"  Wrap="False"/>
                     <ItemStyle Height="30px"  Wrap="False" />
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="审核状态">
                     <ItemTemplate>
                         <asp:Label ID="labVerityComplete" runat="server" Text='<%# SetState(Eval("VerifyComplete")) %>' ></asp:Label>
                     </ItemTemplate>
                        <HeaderStyle Height="30px"  Wrap="False"/>
                     <ItemStyle Height="30px"  Wrap="False" />
                 </asp:TemplateField>
          
                <asp:BoundField DataField="PName" HeaderText="项目名" SortExpression="PName" >
                 
                <HeaderStyle  Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="PClass" HeaderText="商品类型" SortExpression="PClass" >
                 
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                <asp:BoundField DataField="Amount" HeaderText="金额" SortExpression="Amount" DataFormatString="{0:C2}" >
                 
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                 <asp:TemplateField HeaderText="已付款">
                     <ItemTemplate>
                        <%# Eval("SumPayment", "{0:C}") %>：<asp:Literal ID="litPaymentEdit" runat="server"></asp:Literal>
                     </ItemTemplate>
                     <HeaderStyle Wrap="False" />
                     <ItemStyle Font-Bold="True" ForeColor="Maroon" Wrap="False" />
                 </asp:TemplateField>
                <asp:BoundField DataField="CustID" HeaderText="对应客户" SortExpression="CustID" >
                 
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                <asp:BoundField DataField="beginDate" HeaderText="开发周期" SortExpression="beginDate" DataFormatString="{0:yyyy-MM-dd}" >
                 
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                <asp:BoundField DataField="endDate" HeaderText="—" SortExpression="endDate" DataFormatString="{0:yyyy-MM-dd}" >
                 
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                <asp:BoundField DataField="RebateBudget" HeaderText="回扣预算" SortExpression="RebateBudget" DataFormatString="{0:C2}" >
                 
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                </Columns>
                 
                 <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="5"
                onpagechanged="Pager_PageChanged" pagesize="25" prevpagetext="上一页" showcustominfosection="Left"
                showpageindexbox="Always">
   </webdiyer:aspnetpager>
       
        <div id="EditPanel" class="popupPanel" style="height:288px; left: 202px; top: 496px;">
            <table border="0" cellspacing="5"  width="100%">
                <tr>
                    <td colspan="3" style="height: 33px">
                        <div id="_addCoursePanelDorp" style="width: 100%; border-bottom: gray 1px solid;
                            height: 25px; background-color: whitesmoke">
                            <input id="btnAddCourseClose" class="close" onclick='$("#EditPanel").hide();' type="button"
                                value="关闭" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="height: 211px" valign="top">
                    <div id="FunctionList" style="overflow:scroll; width: 490px; height:210px" >
                    
                    </div>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="3" valign="top">
                        <input id="btnNewFunction" class="btn" type="button" value="新增功能需求"  onclick="newFunction(currentPid)"/></td>
                </tr>
            </table>
        </div>
       
    </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/ProjectName.ashx",
      {
        delay: 500,
        max: 15,
        minChars: 2,
        matchSubset: 1,
        cacheLength: 1,
        onItemSelect: selectItem,
        onFindValue: findValue,
        autoFill: true,
        maxItemsToShow: 20
    });

 });
 function locationUrl(url,cid){
    location.href=url+'?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>';
 }
 
 function newFunction(cid){
    location.href='FunctionNew.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>';
 }
 
  
 function DetailsProgress(cid){
       location.href='FunctionProgress.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=l';
 }
 function showFunction(cid){
    location.href='FuntionLook.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=l';
 }
 function editFunction(cid){
    location.href='FunctionEdit.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=l';
 }
 function FunctionCode(cid){
    location.href='FunctionCodeList.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=l';
 }
function editPayment(cid)
{
       location.href="ProjectEditPayment.aspx?cid=" +cid + "&where=&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=l";
}

 
 
function showFunPanel(cid){
    $.ajax({
           type: "POST",
           dataType:"text",
           processData:false,
           async:false,
           url: "ashx/FunctionList.ashx",
           data: "cid="+cid,
           success: function(msg){
              $("#FunctionList").html(msg);
                showPanel($("#EditPanel"));
           },
           error:function (XMLHttpRequest, textStatus, errorThrown) { 
            alert("加载功能需求列表失败 "+textStatus +" "+errorThrown+" "+XMLHttpRequest);
           }
        }); 
}
    </script>
</body>
</html>