<%@ page language="C#" autoeventwireup="true" inherits="Emp_NotCompleteProject, App_Web_wasovt3g" %>


<%@ 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; 

        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 >
            <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" />
                </fieldset>
        </div>    
        <fieldset>
        <legend>任务列表</legend>
        <div  id="view" style="overflow-x:auto">
        <asp:GridView
            ID="TableView" runat="server" AutoGenerateColumns="False"
             EmptyDataText="没有可显示的数据记录。" Width="100%" BorderStyle="Solid" DataKeyNames="CID">
             <Columns>
                 <asp:TemplateField HeaderText="操作菜单" SortExpression="EID">
                     <ItemTemplate>
                     <a href="Javascript:void(0)" onclick="showFunList('<%#Eval("CID") %>');" tabindex="1">功能列表</a>
                       <%--  <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="showFunList('<%#Eval("CID") %>');" tabindex="1">功能列表</a></li>
                            <li><a href="Javascript:void(0)" onclick="FunProgress('<%#Eval("CID") %>');"  tabindex="2">进度设置</a></li>
                            <li><a href="Javascript:void(0)" onclick="CodeUp('<%#Eval("CID") %>')" tabindex="3">代码上传</a></li>
                            </ul>
                            </div>--%>
                     </ItemTemplate>
                     <HeaderStyle Height="30px"  Wrap="False"/>
                     <ItemStyle Height="30px"  Wrap="False" />
                 </asp:TemplateField>
                <asp:BoundField DataField="PName" HeaderText="项目名" SortExpression="PName" >
                <ItemStyle Wrap="False" />
                <HeaderStyle  Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="PClass" HeaderText="商品类型" SortExpression="PClass" >
                <ItemStyle Wrap="False" />
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                <asp:BoundField DataField="beginDate" HeaderText="开发周期" SortExpression="beginDate" DataFormatString="{0:yyyy-MM-dd}" >
                <ItemStyle Wrap="False" />
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                <asp:BoundField DataField="endDate" HeaderText="—" SortExpression="endDate" DataFormatString="{0:yyyy-MM-dd}" >
                <ItemStyle Wrap="False" />
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                <asp:BoundField DataField="BeiZhu" HeaderText="备注" SortExpression="BeiZhu" >
                <ItemStyle Wrap="False" />
                <HeaderStyle  Wrap="False" />
                 </asp:BoundField>
                </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" >
            &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="PopupPanel" class="popupPanel" style="height:288px; left: 2px; top: 700px;">
            <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='$("#PopupPanel").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>
            </table>
        </div>
       
       
    </form>
    
    <script>
$(function()  {
    function findValue(li)
    { 
        if (li == null) return alert("没有相关项目信息!");
        if (!!li.extra)
        var sValue =unescape(li.extra[0]);
     
    }
    function selectItem(li)
    {
        findValue(li);
    }
  
    $("#txtQuery").autocomplete("../Admin/autocomplete/ProjectName.ashx",
      {
        delay: 500,
        max: 15,
        minChars: 2,
        matchSubset: 1,
        cacheLength: 1,
        onItemSelect: selectItem,
        onFindValue: findValue,
        autoFill: true,
        maxItemsToShow: 20
    });
    
 });
 
 function showFunction(cid){
     location.href='../Admin/FuntionLook.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=p';
 }
 function editProgress(cid){
     location.href='ProgressNew.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=p';
 }
 function UpCode(cid){
     location.href='CodeUp.aspx?cid='+cid+'&where=<%=Server.UrlEncode(ViewState["PName"].ToString()) %>&pageindex=<%= PagerButtom.CurrentPageIndex %>&s=p';
 }
 function showFunList(cid){
         $.ajax({
           type: "POST",
           dataType:"text",
           processData:false,
           async:false,
           url: "../Admin/ashx/FunctionList.ashx",
           data: "cid="+cid+"&type=programmer",
           success: function(msg){
              $("#FunctionList").html(msg);
               showPanel($('#PopupPanel'))
           },
           error:function (XMLHttpRequest, textStatus, errorThrown) { 
            alert("加载功能列表失败 "+textStatus +" "+errorThrown+" "+XMLHttpRequest);
           }
        }); 
       
}
 
function FunProgress(cid){
         $.ajax({
           type: "POST",
           dataType:"text",
           processData:false,
           async:false,
           url: "ashx/FunctionProgressList.ashx",
           data: "cid="+cid,
           success: function(msg){
              $("#FunctionList").html(msg);
              showPanel($('#PopupPanel'));
           },
           error:function (XMLHttpRequest, textStatus, errorThrown) { 
            alert("加载功能列表失败 "+textStatus +" "+errorThrown+" "+XMLHttpRequest);
           }
        }); 
        
 }
 function CodeUp(cid){
         $.ajax({
           type: "POST",
           dataType:"text",
           processData:false,
           async:false,
           url: "ashx/FunctionUpList.ashx",
           data: "cid="+cid,
           success: function(msg){
              $("#FunctionList").html(msg);
               showPanel($('#PopupPanel'));
           },
           error:function (XMLHttpRequest, textStatus, errorThrown) { 
            alert("加载功能列表失败 "+textStatus +" "+errorThrown+" "+XMLHttpRequest);
           }
        }); 
       
 }
    </script>
</body>
</html>