<%@ Page Language="c#" CodeBehind="StudentBox.aspx.cs" AutoEventWireup="True" Inherits="SWTraining.Tools.StudentBox"
    Title="学员查询Box" %>

<%@ Import Namespace="SWTraining" %>
<!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" />
    <base target="_self">

    <script type="text/javascript">
        function Select(StudentID) {
            var parent = window.dialogArguments;
            window.returnValue = StudentID;
            var fileName = parent.location + "";
            if (fileName.indexOf("?") != -1) {
                fileName = fileName.substring(0, fileName.indexOf("?"));
            }

            parent.location = fileName + "?StudentID=" + StudentID;
            parent.window.focus()
            self.close();
        }
    </script>

</head>
<body onkeydown="if (event.keyCode==116){reload.click()};">
    <a id="reload" href="StudentBox.aspx" style="display: none">reload...</a>
    <div style="margin: 10px;">
        <form id="Form1" method="post" runat="server">
        <div class="divpanel">
            ＩＤ卡号：<asp:TextBox ID="tbxSignInID" runat="server" Width="114px"></asp:TextBox>
            学号：<asp:TextBox ID="tbxStudentID" runat="server" Width="84px"></asp:TextBox>
            姓名：<asp:TextBox ID="tbxStudentName" runat="server" Width="88px"></asp:TextBox>
            电话：<asp:TextBox ID="tbxTel" runat="server" Width="94px"></asp:TextBox>
            <asp:DropDownList ID="ddlSchool" runat="server" DataTextField="SchoolName" DataValueField="SchoolID">
            </asp:DropDownList>
            <asp:Button ID="btnSelect" runat="server" Text="查询" OnClick="btnSelect_Click"></asp:Button></div>
        <span runat="server" id="spanAllBox"></span>
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
                DataKeyNames="StudentID" OnRowDeleting="GridView1_RowDeleting" OnRowDataBound="GridView1_RowDataBound">
                <Columns>
                    <asp:TemplateField HeaderText="学号">
                        <ItemTemplate>
                            <asp:Label ID="labStudentID" runat="server" Text='<%# Eval("StudentID") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="姓名">
                        <ItemTemplate>
                            <%#Eval("StudentName")%><%# (Convert.IsDBNull(Eval("Byname")) || Eval("Byname").ToString().Trim() == "") ? "" : "(" + Eval("Byname").ToString() + ")"%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="DateAndTime" DataFormatString="{0:d}" HeaderText="报名日期" />
                    <asp:TemplateField HeaderText="欠费金额">
                        <ItemTemplate>
                            <%#Eval("CreditMoney", "{0:c2}")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="可用余额">
                        <ItemTemplate>
                            <%#Eval("AvailableMoney", "{0:c2}")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="最新选班">
                        <ItemTemplate>
                            <%#Eval("LastClassName")%>
                            (<span style="color: Red"><b><%#Eval("StuClassCount")%></b></span>)
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="选择" SortExpression="edit">
                        <ItemTemplate>
                            <a onclick="Select(<%#Eval("StudentID")%>);">选择</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div class="divpanel">
            <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
        </div>
        </form>
    </div>
</body>
</html>
