<%@ page language="C#" masterpagefile="~/HL_Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ShopBuyMoney, HoWaveVGO" title="预付款管理" enableEventValidation="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/getdate.js" type="text/javascript"></script>   
<script src="Js/Function.js" type="text/javascript"></script>  
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>
<table class="adminheading" >
     <tr>
        <th valign="middle" class="inbox">预付款管理</th>                  
     </tr>
  </table> 

 <table class="nick"><tr><td colspan="4" class="tit">快速查找</td></tr>
    <tr><td class="ltd">状态:</td><td class="rtd" style="width:35%"><asp:DropDownList ID="DropStatus" runat="server" AutoPostBack="true" >
         <asp:ListItem Value="-1" Text="所有"/> 
         <asp:ListItem  Value="1" Text="提交" />
         <asp:ListItem Value="2" Text="预交订金" />
         <asp:ListItem Value="3" Text="完成" />
         <asp:ListItem Value="4" Text="作废" />
         </asp:DropDownList></td>
         <td class="ltd">支付方式:</td><td class="rtd" style="width:35%"><asp:DropDownList ID="DropPayType" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="ObjectDataSource3" DataTextField="TypeName" 
         DataValueField="TypeID"> 
        <asp:ListItem Value="-2">充值卡预付</asp:ListItem>
         </asp:DropDownList>
        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="GetPayTypeByUserID"
             TypeName="Shop_PayType">
             <SelectParameters>
                 <asp:Parameter DefaultValue="-2" Name="UserID" Type="Int32" />
             </SelectParameters>
         </asp:ObjectDataSource></td></tr>
     <tr><td class="ltd">开始日期:</td><td class="rtd" style="width:35%"><asp:TextBox runat="server"  ID="begindate" Width="100px" AutoPostBack="True" /></td>
        <td class="ltd">结束日期:</td><td class="rtd" style="width:35%"><asp:TextBox runat="server"  ID="EndDate" Width="100px" AutoPostBack="True" /></td>
     </tr>
          <tr style="display:none;"><td class="ltd">商家:</td><td class="rtd" style="width:35%">
          <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate> 
          <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" Width="40px"/>
         <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource2"
                  DataTextField="username" DataValueField="userid" AppendDataBoundItems="True">
                
            </asp:DropDownList>
              </ContentTemplate> 
           <Triggers>  
             <asp:AsyncPostBackTrigger ControlID="TextBox1" EventName="TextChanged"/>
           </Triggers> 
       </asp:UpdatePanel>
       <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetUserLikeUserName"
                TypeName="UserBLL" OldValuesParameterFormatString="original_{0}">
                <SelectParameters>
                    <asp:ControlParameter ControlID="TextBox1" Name="UserName" PropertyName="Text" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            </td><td class="ltd"> </td><td class="rtd" style="width:35%"></td>
         </tr></table><br />
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate> 
<asp:GridView id="GridView1"  OnRowDataBound="GridView1_RowDataBound" runat="server" Width="100%" DataSourceID="ObjectDataSource1" 　 CssClass="adminlist" 
PageSize="15" AllowPaging="True" DataKeyNames="ID"
 AutoGenerateColumns="False" OnDataBound="GridView1_DataBound">
        <Columns>
             <asp:TemplateField>
                <ItemTemplate>                                        
                    <input type="checkbox" name="chk_select" value='<%# Eval("id") %>' />                                    
                </ItemTemplate>
                <HeaderTemplate>
                   <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />                                     
                </HeaderTemplate>
                   <ItemStyle HorizontalAlign="Center" Width="5%" />
            </asp:TemplateField> 
            <asp:BoundField DataField="id" HeaderText="编号" ReadOnly="True" />
            <asp:BoundField DataField="orderNum" HeaderText="支付编号" />
            <asp:BoundField DataField="TypeName" HeaderText="支付方式" />
            <asp:TemplateField HeaderText="商家">
            <ItemTemplate >
                <a href="Admin_UserDetail.aspx?UserID=<%# Eval("UserID") %>" target="_blank" >
                  <asp:Literal runat="server" ID="UserName"  Text='<%# Bind("UserName")%>' />
                </a>           
             </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="createdate"  HeaderText="创建日期" />
            <asp:BoundField DataField="UpdateDate"   HeaderText="修改日期" />
            <asp:BoundField DataField="money" HeaderText="预付总额" />
            <asp:BoundField DataField="PayedMoney" HeaderText="已付款" />
            <asp:BoundField DataField="Status" HeaderText="状态" />
            <asp:BoundField HeaderText="备注" DataField="Remark" ReadOnly="True" >
                <ItemStyle Width="20%" />
            </asp:BoundField>
        </Columns>
        <EmptyDataTemplate>
                <tr>
                   <th>编号</th>
                   <th>支付编号</th>
                   <th>支付方式</th>
                   <th>商家</th>
                   <th>创建日期</th>
                   <th>修改日期</th>
                   <th>预付总额</th>
                   <th>已付款</th>
                   <th>状态</th>
                   <th>备注</th>
                </tr>
                <tr><td colspan="10">暂无信息！</td></tr>
        </EmptyDataTemplate>
    </asp:GridView> 
    <br />
    <asp:Label ID="msg" runat="server" />
    <br />
</ContentTemplate> 
           <Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="DropStatus" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="DropPayType" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="begindate" EventName="TextChanged"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="EndDate" EventName="TextChanged"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="ButDel" EventName="Click"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="ButSetRablishi" EventName="Click"></asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="ButPayed" EventName="Click"></asp:AsyncPostBackTrigger>
</Triggers>
         
       </asp:UpdatePanel>
   
    <div class="div_btm">
    <asp:Button Text="删除" CommandName="del" ID="ButDel" OnClientClick="if(confirm('确定删除吗？'))return true;return false;" runat="server" OnCommand="ButtonOnCommon" />
    <asp:Button CommandName="rab" Text="作废"  ID="ButSetRablishi" runat="server" OnCommand="ButtonOnCommon" />
    <asp:Button  CommandName="com" Text="完成付款" ID="ButPayed" runat="server" OnClick="ButPayed_Click" />
    </div><br />
    
 
   
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetBuyMoneyList"
    TypeName="Shop_BuyMoney" UpdateMethod="GetBuyMoneyList">
    <SelectParameters>
        <asp:ControlParameter ControlID="DropDownList1" DefaultValue="-1" Name="UserID" PropertyName="SelectedValue"
            Type="Int32" />
        <asp:ControlParameter ControlID="DropStatus" DefaultValue="-1" Name="Status" PropertyName="SelectedValue"
            Type="Int32" />
        <asp:ControlParameter ControlID="DropPayType" DefaultValue="-1" Name="PayType" PropertyName="SelectedValue"
            Type="Int32" />
        <asp:ControlParameter ControlID="begindate" DefaultValue="2007-01-01" Name="BeginDate"
            PropertyName="Text" Type="String" />
        <asp:ControlParameter ControlID="EndDate" DefaultValue="2100-01-01" Name="EndDate"
            PropertyName="Text" Type="String" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="UserID" Type="Int32" />
        <asp:Parameter Name="Status" Type="Int32" />
        <asp:Parameter Name="PayType" Type="Int32" />
        <asp:Parameter Name="BeginDate" Type="String" />
        <asp:Parameter Name="EndDate" Type="String" />
    </UpdateParameters>
</asp:ObjectDataSource>

   

</asp:Content>

