<%@ Page Title="" Language="C#" MasterPageFile="~/Master/officeMaster.master" AutoEventWireup="true"
    CodeFile="Detail_Loan.aspx.cs" Inherits="A_Detail_Detail_Loan" EnableEventValidation="false" %>

<%@ Register Src="~/Ucontrol/UcAccount.ascx" TagName="Account" TagPrefix="ucl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <%--<table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th>
                借贷
            </th>
        </tr>
    </table>--%>
    <div>
        <asp:Button ID="btnAllDetail" runat="server" Text="全 部" Style="
            width: 80px; height: 30px;" OnClick="btnAllDetail_Click" />
        <asp:Button ID="btnExpenditure" runat="server" Text="支 出" Style="
            width: 80px; height: 30px;" OnClick="btnExpenditure_Click" />
        <asp:Button ID="btnIncome" runat="server" Text="收 入" Style="width: 80px; height: 30px;"
            OnClick="btnIncome_Click" />
        <asp:Button ID="btnTransfer" runat="server" Text="转 账" Style="width: 80px; height: 30px;"
            OnClick="btnTransfer_Click" />
        <asp:Button ID="btnLoan" runat="server" Text="借 贷" Style="font-weight: bold;width: 80px; height: 30px;"
            OnClick="btnLoan_Click" />
    </div>
    <br />
    <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <td>
                从
                <asp:TextBox ID="txtStateTime" runat="server" onfocus="WdatePicker()" Width="140"></asp:TextBox>
                到
                <asp:TextBox ID="txtEndTime" runat="server" onfocus="WdatePicker()" Width="140"></asp:TextBox>
                借入：￥<span id="spanBorrowCount" runat="server"></span>&nbsp;&nbsp; 
                借出：￥<span id="spanLendCount" runat="server"></span>&nbsp;&nbsp; 
                收款：￥<span id="spanReceiveCount" runat="server"></span>&nbsp;&nbsp;
                还款：￥<span id="spanBackCount" runat="server"></span>
            </td>
        </tr>
        <tr>
            <td>
                借贷类型：<asp:DropDownList ID="ddlLoanType" runat="server">
                    <asp:ListItem Text="借贷类型" Value="0"></asp:ListItem>
                    <asp:ListItem Text="借入" Value="1"></asp:ListItem>
                    <asp:ListItem Text="借出" Value="2"></asp:ListItem>
                    <asp:ListItem Text="收款" Value="3"></asp:ListItem>
                    <asp:ListItem Text="还款" Value="4"></asp:ListItem>
                </asp:DropDownList>
                债务(权)人：<asp:DropDownList ID="ddlLoanAccount" runat="server">
                    <asp:ListItem Text="债务(权)人" Value="0"></asp:ListItem>
                </asp:DropDownList>
                <asp:Button ID="btnSelect" runat="server" Text="查 询"  Width="72" BackColor="#CCCCCC" OnClick="btnSelect_Click" />
            </td>
        </tr>
    </table>
    <br />
    <table class="usertableborder" cellspacing="1" cellpadding="3" width="90%" border="0">
        <tr>
            <td width="15%">
                时间
            </td>
            <td width="10%">
                |金额
            </td>
            <td width="10%">
                |利息
            </td>
            <td width="10%">
                |类别
            </td>
            <td width="15%">
                |债务(权)人
            </td>
            <td width="10%">
                |账户
            </td>
            <td width="15%">
                |备注
            </td>
            <td width="15%">
                |操作
            </td>
        </tr>
        <asp:Repeater ID="rptDetailLoan" runat="server" OnItemCommand="rptDetailLoan_ItemCommand">
            <ItemTemplate>
                <tr onmousemove="this.style.backgroundColor='#0099CC'" onmouseout="this.style.backgroundColor='white'">
                    <td>
                        <%#Eval("RLoanDateTime")%>
                    </td>
                    <td style="color:Orange;">
                        ￥<%#Eval("RecordLoanMoney")%>
                    </td>
                    <td>
                        ￥<%#Eval("RLoanInterest")%>
                    </td>
                    <td>
                        <%#GetLoanTypeName(Eval("RecordLoanTypeId"))%>
                    </td>
                    <td>
                        <%#Eval("LoanAccountName")%>
                    </td>
                    <td>
                        <span id="spanAccountName" runat="server"></span>
                    </td>
                    <td>
                        <%#Eval("RecordLoanRemarks")%>
                    </td>
                    <td>
                        <asp:HiddenField ID="hfRecordLoanId" runat="server" Value='<%#Eval("RecordLoanId") %>' />
                        <asp:HiddenField ID="hfRLOutsideAccountId" runat="server" Value='<%#Eval("RLOutsideAccountId") %>' />
                        <asp:HiddenField ID="hfRLInsideAccountTypeId" runat="server" Value='<%#Eval("RLInsideAccountTypeId") %>' />
                        <asp:HiddenField ID="hfRLInsideAccountId" runat="server" Value='<%#Eval("RLInsideAccountId") %>' />
                        <asp:HiddenField ID="hfRecordLoanMoney" runat="server" Value='<%#Eval("RecordLoanMoney") %>' />
                        <asp:HiddenField ID="hfRLoanInterest" runat="server" Value='<%#Eval("RLoanInterest") %>' />
                        <asp:HiddenField ID="hfRecordLoanTypeId" runat="server" Value='<%#Eval("RecordLoanTypeId") %>' />
                        <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="edit" Text="编辑"></asp:LinkButton>
                        <asp:LinkButton ID="lbtnDelete" runat="server" CommandName="delete" Text="删除" OnClientClick="return confirm('确认要删除吗？')"></asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <td colspan="8" align="center">
                <span>当前<span id="spanPageCurrent" runat="server">1</span>/<span id="spanPageCount"
                    runat="server"></span>页</span>
                <asp:LinkButton ID="lbtnPageFirst" runat="server" Text="首页" BackColor="Silver" Width="56px" OnClick="lbtnPageFirst_Click"></asp:LinkButton>
                <asp:LinkButton ID="lbtnPageUp" runat="server" Text="上页" BackColor="Silver" Width="56px" OnClick="lbtnPageUp_Click"></asp:LinkButton>
                <asp:LinkButton ID="lbtnPageDown" runat="server" Text="下页" BackColor="Silver" Width="56px" OnClick="lbtnPageDown_Click"></asp:LinkButton>
                <asp:LinkButton ID="lbtnPageLast" runat="server" Text="末页" BackColor="Silver" Width="56px" OnClick="lbtnPageLast_Click"></asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
