<%@ Page Language="C#" MasterPageFile="~/Main.Master" EnableViewState="true" Theme="Default"
    AutoEventWireup="true" CodeBehind="PrePaidItem.aspx.cs" Inherits="OAWeb.crm.orders.PrePaidItem" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="../../UserControls/OrderNav.ascx" TagName="OrderNav" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlace" runat="server">
    <!--主体左侧-->
    <table id="plc_profile" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td class="main_left">
                <uc1:OrderNav ID="OrderNav1" runat="server" />
            </td>
            <td class="main_center">
                <!--主体-->
                <div class="page_main">
                    <div class="page_content">
                        <table class="data_title" style="margin-top: 10px;">
                            <tr>
                                <td class="data_caption">
                                    客户预付款
                                </td>
                            </tr>
                            <tr>
                                <td class="data-field">
                                    <table width="100%">
                                        <tr>
                                            <td class="tb-label" colspan="2">
                                                &nbsp; <a href="/crm/orders/prepaidlist.aspx">预付款余额</a> <a style="margin-left: 15px"
                                                    href="/crm/orders/PrePaidItem.aspx">预付款明细</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="tb-label">
                                                
                                            </td>
                                            <td class="tb-editor" nowrap="nowrap">
                                                客户名称：
                                                <asp:TextBox ID="txtCustomerName" runat="server"></asp:TextBox>
                                                会员ID：<asp:TextBox ID="txtCustomerId" runat="server" Width="100"></asp:TextBox>
                                                
                                                日期：<asp:TextBox ID="txtBeginDate" runat="server" onfocus="WdatePicker()"></asp:TextBox> 至 
                                                <asp:TextBox ID="txtEndDate" runat="server"  onfocus="WdatePicker()" ></asp:TextBox> 
                                                业务员：<asp:TextBox ID="txtTrackUserName" runat="server" CssClass="text" ReadOnly="True" Width="80"></asp:TextBox>&nbsp;<input
                        id="btnSelect" type="button" value="选择" onclick="OpenRadioDialog('/Dialog/EmploySelectDialog.aspx?user=0','选择负责人',CallRadioFun);" />

                                                <asp:Button ID="btnSearch" runat="server" TabIndex="1"
                                                    Text=" 查 询 " CssClass="btn_77px" onclick="btnSearch_Click" />
                  
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <div class="buttons-bar" style="margin-bottom: 10px;">
                            <table class="w100p" style="width: 100%">
                                <tr>
                                    <td align="left">
                                    <a href="PrePaidItem.aspx?state=1" id="LinkAudit1" runat="server">已审核</a> 
                                    <a href="PrePaidItem.aspx?state=0" style="  margin-left:15px;" id="LinkAudit2" runat="server">未审核</a>
                                    </td>
                                    
                                </tr>
                            </table>
                        </div>
                        <div class="list">
                            <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" DataKeyNames=""
                                GridLines="None" CellPadding="0" CssClass="table_list" EnableModelValidation="True"
                                OnRowDataBound="gvData_RowDataBound" OnRowCommand="gvData_RowCommand">
                                <RowStyle HorizontalAlign="Left" />
                                <Columns>
                                    <asp:BoundField DataField="paid_time" HeaderText="发生时间"></asp:BoundField>
                                    <asp:BoundField DataField="CustomerName" HeaderText="客户名称"></asp:BoundField>
                                    <asp:BoundField DataField="Income" HeaderText="录入"></asp:BoundField>
                                    <asp:BoundField DataField="Expenses" HeaderText="支出"></asp:BoundField>
                                    <asp:TemplateField HeaderText="方式">
                                        <ItemTemplate>
                                            <asp:Label ID="lblPayWay" runat="server" Text=""></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="当期余额">
                                        <ItemTemplate>
                                            <asp:Label ID="lblBalance" runat="server" Text=""></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="备注">
                                        <ItemTemplate>
                                            <%# base.getStr1(ObjToStr( Eval("Remark")),20) %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="状态">
                                        <ItemTemplate>
                                            <asp:Label ID="lblState" runat="server" Text=""></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="业务员">
                                        <ItemTemplate>
                                            <%# OACore.Caches.UsersCache.Instance.GetNickName(ObjToInt( Eval("TrackUserId"))) %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="操作">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbtnPaid" CommandName="Paid" 
                                                CommandArgument='<%# Eval("Id") %>' runat="server">审核</asp:LinkButton>
                                            <asp:LinkButton ID="lbtnView" CommandName="View" CommandArgument='<%# Eval("Id") %>'
                                                runat="server">查看</asp:LinkButton>
                                            <asp:LinkButton ID="lbtnEdit" CommandName="Edit" CommandArgument='<%# Eval("Id") %>'
                                                runat="server">编辑</asp:LinkButton>
                                            <asp:LinkButton ID="lbtnDel" OnClientClick="return confirm('确定要删除？')" CommandName="Del"
                                                CommandArgument='<%# Eval("Id") %>' runat="server">删除</asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <div class="pager-bar">
                                <webdiyer:AspNetPager ID="plCustomer" runat="server" OnPageChanged="plCustomer_PageChanged"
                                    PageSize="10">
                                </webdiyer:AspNetPager>
                            </div>
                        </div>
                        <asp:HiddenField ID="hdfSql" runat="server" />
                        <asp:HiddenField ID="hdfOwnerId" runat="server" />
                        <asp:HiddenField ID="hdfTrackUserID" runat="server" />
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <script>
        function CallRadioFun(text, value) {
            $('#<%=txtTrackUserName.ClientID %>').val(text);
            $('#<%=hdfTrackUserID.ClientID %>').val(value);
        }
    </script>
</asp:Content>
