<%@ page language="C#" autoeventwireup="true" inherits="Admin_ProjectEditPayment, 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: 364px; 
        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 id="editPanel" style=" display:none">
            <br />
            <fieldset>
            <legend>编辑</legend>
            <label>
                【金额：】</label><asp:TextBox ID="txtAmount"  CssClass="ac_input" runat="server" Width="300px"></asp:TextBox><br />
                【备注：】<asp:TextBox ID="txtBeizhu" runat="server" Width="300px"></asp:TextBox><br />
            <asp:Button ID="btnSubmit" runat="server" Text="保存编辑" OnClick="btnQuery_Click" CssClass="btn"  style="margin-left:60px" OnClientClick="return CheckInsert();" />
                </fieldset>
        </div>    
        <fieldset>
        <legend>内容区域</legend>
        <div  id="view" style="overflow-x:auto">
        <asp:GridView
            ID="TableView" runat="server" AutoGenerateColumns="False"
             EmptyDataText="没有可显示的数据记录。"  BorderStyle="Solid" DataKeyNames="CID" OnRowDataBound="TableView_RowDataBound" ShowFooter="True">
             <Columns>
                 <asp:TemplateField HeaderText="选择"> 
                     <ItemTemplate>
                         <asp:CheckBox ID="CBSelect" runat="server" />
                     </ItemTemplate>
                     <HeaderStyle Height="30px" Width="30px"  Wrap="False"/>
                     <ItemStyle Height="30px"  Wrap="False" />
                 </asp:TemplateField>
                 <asp:TemplateField HeaderText="操作" SortExpression="EID">
                     <ItemTemplate>
                         <a href="#" onclick="edit('<%#Eval("CID") %>','<%#Eval("Payment") %>','<%#Eval("Beizhu") %>');" >编辑</a>
                     </ItemTemplate>
                     <HeaderStyle Width="50px"  Wrap="False"/>
                     <ItemStyle   Wrap="False" />
                 </asp:TemplateField>
                <asp:BoundField DataField="Payment" HeaderText="金额" SortExpression="Payment" >
                     <HeaderStyle  Width="100px" Wrap="False"/>
                     <ItemStyle  Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="PName" HeaderText="项目名" SortExpression="PID" >
                     <HeaderStyle  Wrap="False"/>
                     <ItemStyle Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="Beizhu" HeaderText="备注" SortExpression="Beizhu" >
                     <HeaderStyle  Wrap="False"/>
                     <ItemStyle  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="btnDeleteAll_Click"
                OnClientClick="if(confirm('确定删除所有选中吗？')){return isSelect('view')}else{return false;}"
                Text="删除选中" />
      
        </div>  
      </fieldset>
        <asp:HiddenField ID="hfEditID" runat="server" />
        <div align="center" style="width: 100%; background-color: lightgrey">
            &nbsp;<asp:Button ID="btnBack" runat="server" CssClass="btn" OnClick="btnback_Click"
                Text="返回" Width="133px" /></div>
                
          <div  onclick="$(this).hide()" id="cuePanel" style="z-index: 101; position: absolute; 
           border:1px solid #E6594E; background-color: #FCEAE8;  padding:7px; display:none;
            color:#E6594E;">
            <span id="operCue"></span>
        </div>
    </form>
    <script>
function edit(cid, payment,beizhu){
    $('#editPanel').show();
    $('#txtAmount').val(payment);
    $('#txtBeizhu').val(beizhu);
    $('#hfEditID').val(cid);
}
function isEmpty(obj){
     var input= $("#"+obj+"");
     if($.trim(input.val())==""){
            input.get(0).focus();
            cue(input,"请填写！");
            return true;
     }
     return false;
}
function isIValid(obj){
    var input= $("#"+obj+"");
    if(!isInt($.trim(input.val()))){
        input.get(0).focus();
        cue(input,"输入无效！");return true;
    }
    return false;
}
function CheckInsert(){
       if(isEmpty("txtAmount"))return false;
       if(isIValid("txtAmount"))return false;
       return true;
    
}
function isInt(sText){
      var reg =/^\d*$/;
      return sText.match(reg);
}
function cue(obj,txt){
       var Y = obj.offset().top;
       var X = obj.offset().left;
       var p = $("#cuePanel");

       p.css("top",Y);
       p.css("left",X);
       $("#operCue").text(txt);
       p .show();
}
    </script>
</body>
</html>