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

<%@ Import Namespace="MTCUN" %>
<!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()};" style="overflow-x: hidden">
    <a id="reload" href="StudentList.aspx" style="display: none">reload...</a>
    <div style="width: 90%; margin-left: auto; margin-right: auto">
        <form id="Form1" method="post" runat="server">
            <div class="tool_Search">
                ＩＤ卡号：<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>
                <label class="lab_button">
                    <asp:Button ID="btnSelect" runat="server" Text="查询" OnClick="btnSelect_Click"></asp:Button>
                </label>
            </div>
            <div class="both"></div>
            <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>
                                <div class="lab_button_sub" id="divEdit" runat="server">
                                    <a onclick="Select(<%#Eval("StudentID")%>);">选择</a>
                                </div>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>
            <div class="divpanel">
                <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
            </div>
        </form>
    </div>
</body>
</html>
