<%@ Page Language="c#" CodeBehind="StudentList.aspx.cs" AutoEventWireup="True" Inherits="SWTraining.Consultant.StudentList"
    Title="顾问工作台-我的学员" %>

<%@ 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/Orange/css.css" rel="stylesheet"
        type="text/css" />

    <script type="text/javascript">
        function Checks(checkbox) {
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var e = document.forms[0].elements[i];
                if (e.type == "checkbox" && e.id == "id") {
                    e.checked = checkbox.checked;
                }
            }
        }



        function Send() {
            var StudentID = "";
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var e = document.forms[0].elements[i];
                if (e.type == "checkbox" && e.id == "id") {
                    if (e.checked) {
                        StudentID += "," + e.value;
                    }
                }
            }

            if (StudentID.length > 0) {
                StudentID = StudentID.substring(1, StudentID.length);
                document.getElementById("StudentID").value = StudentID;
                document.formStudent.action = "../SMS/SendToStudent.aspx";
                document.formStudent.submit();
            }
        }
    </script>

</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div id="sw_content">
        <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">
            <div class="divpanel" style="text-align: left">
                <div style="float: left">
                    <fieldset style="width: auto; padding-bottom: 5px">
                        <legend style="font-size: 10px">控制面板</legend>
                        <ul class="grouptools">
                            <li style="float: left">
                                <input onclick="Checks(this)" type="checkbox">
                            </li>
                            <li style="float: left">全选 </li>
                            <li style="float: left" class="ico_sms"></li>
                            <li style="float: left">
                                <asp:HyperLink ID="hlkSMS" runat="server" NavigateUrl='<%#string.Format("javascript:Send();void(0);") %>'
                                    Text="发短信" /></li>
                        </ul>
                    </fieldset>
                </div>
                <div style="clear: both">
                </div>
            </div>
        </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>
                            <span runat="server" id="spanBox">
                                <input type="checkbox" id="id" value='<%#Eval("StudentID")%>' /></span>
                            <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:TemplateField HeaderText="类别">
                        <ItemTemplate>
                            <%#Rs.Items.GetStudentType(Eval("StudentType"))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="DateAndTime" DataFormatString="{0:d}" HeaderText="报名日期" />
                    <asp:TemplateField HeaderText="校区">
                        <ItemTemplate>
                            <%#Eval("SchoolName")%>
                        </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>)
                            <asp:HyperLink ID="hlkStuClass" runat="server" Text="查看" NavigateUrl='<%# string.Format("StuClass.aspx?StudentID={0}&GetURL={1}",Eval("StudentID"),swq.Web.PathAndQuery()) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="浏览" SortExpression="edit">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlkShow" runat="server" Text="浏览" NavigateUrl='<%# string.Format("StudentShow.aspx?StudentID={0}&GetURL={1}",Eval("StudentID"),swq.Web.PathAndQuery()) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="咨询记录">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlkR" runat="server" Text="咨询记录" NavigateUrl='<%# string.Format("StuPotentials.aspx?StudentID={0}&GetURL={1}",Eval("StudentID"),swq.Web.PathAndQuery()) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="新增咨询">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlkControlPanel" runat="server" Text="新增咨询" NavigateUrl='<%# string.Format("PostPotential.aspx?StudentID={0}&GetURL={1}",Eval("StudentID"),swq.Web.PathAndQuery()) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
    <div class="divpanel">
        <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
    </div>
    <iframe id="PrintWeb" width="0" height="0"></iframe>
    </form>
    <form id="formStudent" name="formStudent" method="post">
    <input id="StudentID" name="StudentID" type="hidden" value="" />
    </form>
</body>
</html>
