<%@ page language="C#" masterpagefile="~/Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_JXC_AccountSubjectTotal, WebApp_deploy" title="总分类账" %>

<asp:Content ID="cphContent" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="sm" runat="server">
    </asp:ScriptManager>
    <div id="MainMenu">
        <div class="TabText">
            <table class="nick" id="table_item" runat="server">
                <tr>
                    <td class="tit left1">
                        &nbsp;&nbsp;<asp:Literal ID="ltrTitle" runat="server">总分类账</asp:Literal>
                    </td>
                </tr>
            </table>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <table class="nick">
                        <tr>
                            <td colspan="4" class="tit left1">
                                &nbsp;<b>高级查询：</b>
                            </td>
                        </tr>
                        <tr>
                            <td class="ltd">
                                &nbsp;会计年度：
                            </td>
                            <td class="rtd">
                                &nbsp;
                                <asp:DropDownList ID="ddlYear" runat="server">
                                </asp:DropDownList>
                            </td>
                            <td class="ltd">
                                &nbsp;会计期间：
                            </td>
                            <td class="rtd">
                                &nbsp;<asp:DropDownList ID="ddlBeginMonth" runat="server" Width="60px">
                                    <asp:ListItem Value="1" Text="1"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="2"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="3"></asp:ListItem>
                                    <asp:ListItem Value="4" Text="4"></asp:ListItem>
                                    <asp:ListItem Value="5" Text="5"></asp:ListItem>
                                    <asp:ListItem Value="6" Text="6"></asp:ListItem>
                                    <asp:ListItem Value="7" Text="7"></asp:ListItem>
                                    <asp:ListItem Value="8" Text="8"></asp:ListItem>
                                    <asp:ListItem Value="9" Text="9"></asp:ListItem>
                                    <asp:ListItem Value="10" Text="10"></asp:ListItem>
                                    <asp:ListItem Value="11" Text="11"></asp:ListItem>
                                    <asp:ListItem Value="12" Text="12"></asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;月 &nbsp; &nbsp;至&nbsp; &nbsp;
                                <asp:DropDownList ID="ddlEndMonth" runat="server" Width="60px">
                                    <asp:ListItem Value="1" Text="1"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="2"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="3"></asp:ListItem>
                                    <asp:ListItem Value="4" Text="4"></asp:ListItem>
                                    <asp:ListItem Value="5" Text="5"></asp:ListItem>
                                    <asp:ListItem Value="6" Text="6"></asp:ListItem>
                                    <asp:ListItem Value="7" Text="7"></asp:ListItem>
                                    <asp:ListItem Value="8" Text="8"></asp:ListItem>
                                    <asp:ListItem Value="9" Text="9"></asp:ListItem>
                                    <asp:ListItem Value="10" Text="10"></asp:ListItem>
                                    <asp:ListItem Value="11" Text="11"></asp:ListItem>
                                    <asp:ListItem Value="12" Text="12"></asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;月
                            </td>
                        </tr>
                        <tr>
                            <td class="ltd">
                                &nbsp;会计科目：
                            </td>
                            <td class="rtd">
                                &nbsp;
                                <asp:DropDownList ID="ddlSubject" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSubject_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td class="ltd">
                                &nbsp;拥有者：
                            </td>
                            <td class="rtd">
                                &nbsp;<asp:TextBox ID="txtSearchSalerName" runat="server"></asp:TextBox>
                                &nbsp;<asp:Button ID="btnSearch" runat="server" Text="查询" OnClientClick="return getMonthValue()"
                                    OnClick="btnSearch_Click" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="ddlSubject" EventName="SelectedIndexChanged" />
                </Triggers>
            </asp:UpdatePanel>
            <asp:UpdatePanel ID="upList" runat="server">
                <ContentTemplate>
                    <asp:Repeater ID="rptList" runat="server">
                        <HeaderTemplate>
                            <table class="adminlist" cellspacing="0" cellpadding="0">
                                <tr>
                                    <th>
                                        行号
                                    </th>
                                    <th>
                                        拥有者
                                    </th>
                                    <th>
                                        科目编号
                                    </th>
                                    <th>
                                        科目名称
                                    </th>
                                    <th>
                                        日期
                                    </th>
                                    <th>
                                        借方金额
                                    </th>
                                    <th>
                                        贷方金额
                                    </th>
                                    <th>
                                        借贷方向
                                    </th>
                                    <th>
                                        金额
                                    </th>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#E7EDFE'"
                                onmouseout="this.style.backgroundColor=c;">
                                <td>
                                    <asp:Label ID="lblRow" runat="server"></asp:Label>
                                </td>
                                <td>
                                    <%# Eval("OwnerName") == DBNull.Value ? "" : Eval("OwnerName")%>
                                </td>
                                <td align="left">
                                    <asp:HiddenField ID="hfAAItemAccountSID" runat="server" Value='<%# Eval("AAItemAccountSID") %>' />
                                    &nbsp;&nbsp;
                                    <asp:Label ID="lblAccountSNumber" runat="server" Text='<%# Eval("AccountSNumber")%>'></asp:Label>
                                </td>
                                <td align="left">
                                    &nbsp;&nbsp;<asp:Label ID="lblAccountSName" runat="server" Text='<%# Eval("AccountSName")%>'></asp:Label>
                                </td>
                                <td align="center">
                                    <%#Eval("yearNum")%><asp:Literal ID="ltrAppend" runat="server" Text="-"></asp:Literal><%# Eval("monthNum")%>
                                </td>
                                <td align="right">
                                    <asp:Label ID="lblBorrowPrice" runat="server" ForeColor="Green"></asp:Label>&nbsp;&nbsp;
                                    <asp:HiddenField ID="hfBorrowPrice" runat="server" Value='<%# Eval("BorrowPrice") %>' />
                                </td>
                                <td align="right">
                                    <asp:Label ID="lblLoanPrice" runat="server" ForeColor="Green"></asp:Label>&nbsp;&nbsp;
                                    <asp:HiddenField ID="hfLoanPrice" runat="server" Value='<%# Eval("LoanPrice") %>' />
                                </td>
                                <td align="center">
                                    <asp:Label ID="lblLend" runat="server"></asp:Label>&nbsp;&nbsp;
                                </td>
                                <td align="right">
                                    <asp:Label ID="lblMoney" runat="server"></asp:Label>&nbsp;&nbsp;
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:Label ID="lblFooterDate" runat="server"></asp:Label>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </ContentTemplate>
            </asp:UpdatePanel>
            <div style="line-height: 6px;">
                &nbsp;</div>
        </div>
    </div>
    <script type="text/javascript">
        //会计期间
        function getMonthValue() {
            var objSelect = document.getElementById("<%=ddlBeginMonth.ClientID %>");
            var objSelect2 = document.getElementById("<%=ddlEndMonth.ClientID %>");
            var objvalue1 = "";
            var objvalue2 = "";
            for (var i = 0; i < objSelect.options.length; i++) {
                if (objSelect[i].selected == true) {
                    objvalue1 = objSelect[i].value;
                }
            }
            for (var i = 0; i < objSelect2.options.length; i++) {
                if (objSelect2[i].selected == true) {
                    objvalue2 = objSelect2[i].value;
                }
            }
            if (objvalue1 != "" && objvalue2 != "") {
                if (parseInt(objvalue1) > parseInt(objvalue2)) {
                    alert("开始的月份不能大于结束月份！");
                    return false;
                }
            }
            return true;
        }
    </script>
</asp:Content>
