<%@ Page Language="c#" CodeBehind="StuBill.aspx.cs" AutoEventWireup="True" Inherits="MTCUN.Finance.StuBill"
    Title="财务管理-学员消费单" %>

<%@ Register Src="../UserCol/Progress.ascx" TagName="Progress" TagPrefix="uc2" %>
<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../UserCol/ReportServer.ascx" TagName="ReportServer" TagPrefix="uc1" %>
<!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 runat="server">
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
    <script src="../Jscript/CreateSubMenu.js" type="text/javascript"></script>
</head>
<body>
    <form id="Form1" runat="server">
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
                DataKeyNames="BillID" OnRowEditing="GridView1_RowEditing" OnRowDeleting="GridView1_RowDeleting"
                OnRowDataBound="GridView1_RowDataBound" OnSelectedIndexChanging="GridView1_SelectedIndexChanging"
                OnRowCommand="GridView1_RowCommand">
                <SelectedRowStyle CssClass="selected" />
                <Columns>
                    <asp:TemplateField InsertVisible="False" HeaderText="单号" SortExpression="BillID">
                        <ItemTemplate>
                            <asp:ImageButton ID="ibnSelect" CommandName="Select" ImageUrl='<%# accTheme("node_close.gif") %>'
                                runat="server" />
                            <asp:LinkButton ID="lbnSelect" runat="server" Text='<%# Eval("BillID") %>' CommandName="Select" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="日期">
                        <ItemTemplate>
                            <asp:Label ID="labDateAndTime" runat="server" Text='<%#Eval("DateAndTime")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="类型">
                        <ItemTemplate>
                            <asp:Label ID="labBillTypeID" runat="server" Text='<%#(int)Eval("BillTypeID") == 1 ? "购买" : "退货"%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="应交金额">
                        <ItemTemplate>
                            <asp:Label ID="labPay" runat="server" Text='<%# Eval("Pay","{0:c2}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="优惠">
                        <ItemTemplate>
                            <asp:Label ID="labFavourable" runat="server" Text='<%# Eval("Favourable","{0:c2}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="实收金额">
                        <ItemTemplate>
                            <asp:Label ID="labPayed" runat="server" Text='<%# Eval("Payed","{0:c2}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="备注">
                        <ItemTemplate>
                            <asp:Literal runat="server" ID="litRemark" Text='<%# Eval("Remark") %>' Mode="Encode"></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="PostSchoolName" HeaderText="交费点" ReadOnly="true" />
                    <asp:TemplateField HeaderText="录入员">
                        <ItemTemplate>
                            <%#Eval("TrueName")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <%--                    <asp:TemplateField HeaderText="已打">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbnPrint" runat="server" CommandName="Print" CommandArgument='<%#Eval("BillID") %>'
                                Text='<%# (int)Eval("PrintCount") > 0 ? "已" : "未" %>' Font-Size="9pt"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="打印">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlkPrint" runat="server" NavigateUrl='<%#string.Format("javascript:Print({0});void(0);",Eval("BillID")) %>'
                                ImageUrl='<%# accTheme("print.gif")%>' CssClass="noborder"></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderText="打印">
                        <ItemTemplate>
                            <div class=" lab_button_sub">
                                <asp:HyperLink ID="hlkPrint" runat="server" NavigateUrl='<%#string.Format("javascript:Print({0});void(0);",Eval("BillID")) %>'><div class="inline_block">打印</div>
                                <div class="inline_block orgnum"><%#Eval("PrintCount") %></div></asp:HyperLink>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divEdit" runat="server">
                                <asp:HyperLink ID="hlkEdit" runat="server" Text="编辑" NavigateUrl='<%# string.Format("../Register/{3}.aspx?module=2&StudentID={0}&BillID={1}&GetUrl={2}",Eval("StudentID"),Eval("BillID"),swq.Web.PathAndQuery(),(int)Eval("BillTypeID") == 1 ? "PostSellBill" : "PostOutBill") %>' />
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divDelete" runat="server">
                                <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandArgument='<%#Eval("UserID")%>'
                                    CommandName="Delete" OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div class="backpanel">
            <label class="lab_button" id="__mt_labBack" runat="server">
                <input id="Button1" causesvalidation="false" type="button" runat="server" onclick="back(this)"
                    value="返回" />
            </label>
        </div>

        <div id="divItems" style="visibility: hidden">
            <div style="width: 50%">
                <asp:GridView ID="gvItems" runat="server" AutoGenerateColumns="false" CssClass="smallgridview">
                    <Columns>
                        <asp:BoundField DataField="ProductID" HeaderText="编号" ReadOnly="True" />
                        <asp:BoundField DataField="ProductName" HeaderText="项目" ReadOnly="True" />
                        <asp:TemplateField HeaderText="单价">
                            <ItemTemplate>
                                <asp:Label ID="labUnitPrice" runat="server" Text='<%# Bind("UnitPrice","{0:c2}") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="数量">
                            <ItemTemplate>
                                <asp:Label ID="labAmount" runat="server" Text='<%# Bind("Amount") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="单位">
                            <ItemTemplate>
                                <asp:Label ID="labUnitName" runat="server" Text='<%# Eval("UnitName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="优惠">
                            <ItemTemplate>
                                <asp:Label ID="labFavorable" runat="server" Text='<%# Eval("Favorable","{0:c2}") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="合计">
                            <ItemTemplate>
                                <asp:Label ID="labTotalPrice" runat="server" Text='<%# Bind("TotalPrice","{0:c2}") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="仓库">
                            <ItemTemplate>
                                <asp:Label ID="labStoreroomName" runat="server" Text='<%# Bind("StoreroomName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>
        </div>

        <uc1:ReportServer ID="ReportServer1" runat="server" />

    </form>
    <div class="divremark">
        <b>注意事项：</b><br />
        1、如果您想寻找“增加消费单”按钮，请到客服模块：学员控制面板-消费单-增加消费单，因为消费录入工作由客服负责。<br />
    </div>
</body>
</html>
