<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PostSellBill.aspx.cs" Inherits="SWTraining.Finance.PostSellBill" Title="财务管理-编辑消费单" %>

<%@ Register Src="../UserCol/Remark.ascx" TagName="Remark" 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">
    <title></title>
    <link id="linkStyle" runat="server" href="../Themes/Orange/css.css" rel="stylesheet"
        type="text/css" />

    <script type="text/javascript">
        function StudentBox() {
            window.showModelessDialog('../Tools/StudentBox.aspx', window, 'dialogWidth=750px;dialogHeight=500px');
        }
    </script>

    <script type="text/javascript"> 
<!--

        function Focus() {
            if (!document.getElementById("tbxBarcode").disabled) {
                document.getElementById("tbxBarcode").focus();
            }
        }

//--> 
    </script>

</head>
<body onload="Focus();">

    <iframe id="PrintWeb" width="0" height="0"></iframe>
    <form id="form1" runat="server">
    <div id="sw_content">
        <div class="divpanel">
            <table class="table" cellspacing="0">
                <tr>
                    <th colspan="3">
                        收费明细单
                    </th>
                </tr>
                <tr>
                    <td style="width: 100px">
                        学号：
                    </td>
                    <td style="width: 100px">
                        <asp:TextBox ID="tbxStudentID" runat="server" ReadOnly="True"></asp:TextBox>
                    </td>
                    <td rowspan="2">
                        <asp:Image ID="imgPhoto" runat="server" ImageUrl='../Images/Pic.gif' ToolTip="学员相片"
                            Visible="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        姓名：
                    </td>
                    <td>
                        <asp:TextBox ID="tbxStudentName" runat="server" ReadOnly="True"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td rowspan="2">
                        已选产品：
                    </td>
                    <td colspan="2">
                        条形码：<asp:TextBox ID="tbxBarcode" runat="server" Width="90px"></asp:TextBox>
                        <asp:DropDownList ID="ddlProductType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlProductType_SelectedIndexChanged">
                            <asp:ListItem Value="0$0">请选择</asp:ListItem>
                            <asp:ListItem Value="1$0">课程</asp:ListItem>
                            <asp:ListItem Value="2$0">收费项</asp:ListItem>
                            <asp:ListItem Value="8$0">商品</asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="ddlProduct" runat="server" DataTextField="ProductName" DataValueField="ProductID"
                            AutoPostBack="True" OnSelectedIndexChanged="ddlProduct_SelectedIndexChanged">
                        </asp:DropDownList>
                        单价：<asp:TextBox ID="tbxUnitPrice" runat="server" Width="65px"></asp:TextBox>
                        数量：<asp:TextBox ID="tbxAmount" runat="server" Width="51px"></asp:TextBox>
                        <asp:Label ID="labUnitName" runat="server"></asp:Label>
                        <span id="panSto" runat="server">仓库：<asp:DropDownList ID="ddlStoreroom" runat="server"
                            DataTextField="StoreroomName" DataValueField="StoreroomID">
                        </asp:DropDownList>
                        </span>
                        <asp:Button ID="btnAddItem" runat="server" Text="增加" OnClick="btnAddItem_Click" />
                    </td>
                </tr>
                <tr>
                    <td style="height: 20px" colspan="2">
                        <div style="width: 60%">
                            <asp:GridView ID="GridView1" runat="server" CssClass="smallgridview" AutoGenerateColumns="False"
                                DataKeyNames="BillItemID" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing"
                                OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting">
                                <Columns>
                                    <asp:BoundField DataField="ProductID" ReadOnly="True" HeaderText="编号" />
                                    <asp:TemplateField HeaderText="收费项目">
                                        <ItemTemplate>
                                            <asp:Label ID="labProductName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="单价">
                                        <ItemTemplate>
                                            <asp:Label ID="labUnitPrice" runat="server" Text='<%# Eval("UnitPrice","{0:c2}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="tbxUnitPrice" runat="server" Text='<%# Eval("UnitPrice") %>' Width="60"></asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="数量">
                                        <ItemTemplate>
                                            <asp:Label ID="labAmount" runat="server" Text='<%# Eval("Amount") %>'></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="tbxAmount" runat="server" Text='<%# Eval("Amount") %>' Width="60"></asp:TextBox>
                                        </EditItemTemplate>
                                    </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="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>
                                    <asp:CommandField HeaderText="编辑" EditText="编辑" CancelText="取消" UpdateText="更新" ShowEditButton="true" />
                                    <asp:TemplateField HeaderText="删除">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        单号：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxBillID" runat="server" Width="184px" Enabled="False"></asp:TextBox>
                        <asp:Label ID="Label3" runat="server" ForeColor="red" Text="*" ToolTip="必填项"></asp:Label><asp:CheckBox
                            ID="cbxAutoID" runat="server" AutoPostBack="True" Checked="True" OnCheckedChanged="cbxAutoID_CheckedChanged"
                            Text="自动" />
                    </td>
                </tr>
                <tr>
                    <td>
                        日期：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxDateAndTime" runat="server" Width="152px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        总价：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxTotalPay" runat="server" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        优惠：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxFavourable" runat="server" OnTextChanged="tbxFavourable_TextChanged"
                            AutoPostBack="True">0</asp:TextBox>
                        折扣：<asp:DropDownList ID="ddlDiscount" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDiscount_SelectedIndexChanged">
                            <asp:ListItem Value="10" Text=""></asp:ListItem>
                            <asp:ListItem>9</asp:ListItem>
                            <asp:ListItem>8</asp:ListItem>
                            <asp:ListItem>7</asp:ListItem>
                            <asp:ListItem>6</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>1</asp:ListItem>
                            <asp:ListItem>0</asp:ListItem>
                        </asp:DropDownList>
                        .<asp:DropDownList ID="ddlDiscountDecimal" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDiscount_SelectedIndexChanged">
                            <asp:ListItem Value="0"> </asp:ListItem>
                            <asp:ListItem Text="">1</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                            <asp:ListItem>6</asp:ListItem>
                            <asp:ListItem>7</asp:ListItem>
                            <asp:ListItem>8</asp:ListItem>
                            <asp:ListItem>9</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        金额：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxPayed" runat="server" ReadOnly="True"></asp:TextBox>
                        <span runat="server" id="spanAcc" visible="false">帐户金额不足：需充入<asp:Label ID="labMissing"
                            runat="server" ForeColor="Red" Text=""></asp:Label>元 您想即充即扣？<asp:CheckBox ID="cbxInstant"
                                runat="server" Text="是" />
                            &nbsp;支付方式：<asp:DropDownList ID="ddlPayMethod" runat="server">
                                <asp:ListItem Value="现金">现金</asp:ListItem>
                                <asp:ListItem Value="刷卡">刷卡</asp:ListItem>
                                <asp:ListItem Value="转账">转账</asp:ListItem>
                                <asp:ListItem Value="支票">支票</asp:ListItem>
                                <asp:ListItem Value="其它">其它</asp:ListItem>
                            </asp:DropDownList>
                        </span>
                    </td>
                </tr>
                <tr>
                    <td>
                        备注：
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="tbxRemark" runat="server" Width="387px" Height="53px" TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        办理点：
                    </td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddlPostSchool" runat="server" DataTextField="SchoolName" DataValueField="SchoolID">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        录入员：
                    </td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddlUser" runat="server" DataTextField="TrueName" DataValueField="UserID">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td colspan="2">
                        <asp:Button ID="btnPost" runat="server" Text="确定结账" OnClick="btnPost_Click" />
                        <input causesvalidation="false" type="button" runat="server" onclick="back()" value="返回" />
                        <asp:HyperLink ID="hlkPayment" runat="server" NavigateUrl="StuPayment.aspx" Target="_blank">账户充值</asp:HyperLink>
                    </td>
                </tr>
            </table>
        </div>
        <div class="divremark">
            <b>注意事项：</b><br />
            1、“即充即扣”，即不用人工去充值，直接在这里收费，系统自动在充值面板增加一条记录。使用“即充即扣”时按需充入金额收费。欠费学员不能使用此功能。</div>
    </div>
    <uc1:Remark ID="imgBig" runat="server" />
    </form>
</body>
</html>
