<%@ Page Language="c#" CodeBehind="StuClass.aspx.cs" AutoEventWireup="True" Inherits="MTCUN.Affairs.StuClass"
    Title="选班列表-教务" %>

<%@ Register Src="../UserCol/ReportControl.ascx" TagName="ReportControl" TagPrefix="uc2" %>
<%@ Register Src="../UserCol/Progress.ascx" TagName="Progress" TagPrefix="uc1" %>
<%@ Import Namespace="MTCUN" %>
<%@ Register Src="../UserCol/Menu.ascx" TagName="Menu" TagPrefix="uc2" %>
<%@ Register src="../UserCol/ReportServer.ascx" tagname="ReportServer" tagprefix="uc3" %>
<!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" />
</head>
<body>
    <form id="Form1" method="post" runat="server">
    <script type="text/javascript">
        function __Control_Prints(id) {

            var KeyID = "";
            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) {
                        KeyID += "," + e.value;
                    }
                }
            }

            if (KeyID.length > 0) {
                KeyID = KeyID.substring(1, KeyID.length);
            }
            __Control_Print(id, KeyID);
        }

        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;
                }
            }
        }

    </script>
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False"
                DataKeyNames="StuClassID" OnRowDeleting="GridView1_RowDeleting" OnRowDataBound="GridView1_RowDataBound">
                <SelectedRowStyle CssClass="selected" />
                <Columns>
                    <asp:TemplateField HeaderText="选班号">
                        <ItemTemplate>
                            <input type="checkbox" id="id" value='<%#Eval("StuClassID")%>' />
                            <%#Eval("StuClassID")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="班号">
                        <ItemTemplate>
                            <%#Eval("ClassID")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="班级名称">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlkClassShow" runat="server" Text='<%#Eval("ClassName")%>' NavigateUrl='<%# string.Format("../Class/ClassControlPanel.aspx?ClassID={0}&GetURL={1}",Eval("ClassID"),swq.Web.PathAndQuery()) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="上课地点">
                        <ItemTemplate>
                            <%#Eval("SchoolName")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="DateAndTime" ReadOnly="True" HeaderText="选班日期" />
                    <asp:TemplateField HeaderText="选班状态">
                        <ItemTemplate>
                            <%#Rs.Items.GetScState(Eval("ScStateID"))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="类型">
                        <ItemTemplate>
                            <%#Rs.Items.GetStuClassType(Eval("ContinueReg"))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="课时进度">
                        <ItemTemplate>
                            <uc1:Progress ID="Progress1" QuantifiedType='<%#(QuantifiedType)Eval("QuantifiedType") %>' runat="server" MaxNum='<%#Eval("Lessons") %>' MinNum='<%#Eval("CourseProgress") %>' StartDate='<%#Eval("DateAndTime") %>' ExpiryDate='<%#Eval("ExpiryDate") %>'
                                ProgressWidth="65%" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="PostSchoolName" ReadOnly="True" HeaderText="报名点" />
                    <asp:TemplateField HeaderText="课时库存">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divbuy" runat="server">
                                <asp:HyperLink ID="hlkBuy" runat="server" Text="课时库存" NavigateUrl='<%# string.Format("BuyLessonsLog.aspx?StuClassID={0}",Eval("StuClassID")) %>' />
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="异动办理">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divedit1" runat="server">
                                <a href="#" onclick="Menu1_Show(this,<%#Eval("StuClassID")%>,<%#Eval("StudentID")%>)">选择</a>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="评价">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divopinion" runat="server">
                                <asp:HyperLink runat="server" ID="hlkOpinion" Text="评价" NavigateUrl='<%# string.Format("PostOpinion.aspx?StuClassID={0}&GetURL={1}",Eval("StuClassID"),swq.Web.PathAndQuery()) %>'></asp:HyperLink>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="浏览">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divshow" runat="server">
                                <asp:HyperLink ID="hlkShow" runat="server" Text="浏览" NavigateUrl='<%# string.Format("StuClassShow.aspx?StuClassID={0}&GetURL={1}",Eval("StuClassID"),swq.Web.PathAndQuery()) %>' />
                            </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("PostStuClass.aspx?StuClassID={0}&StudentID={1}&ClassID={2}&GetURL={3}",Eval("StuClassID"),Eval("StudentID"),Eval("ClassID"),swq.Web.PathAndQuery()) %>' />
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除">
                        <ItemTemplate>
                            <div class="lab_button_sub" id="divDelete" runat="server">
                                <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" CommandArgument='<%#Eval("UserID")%>'
                                    OnClientClick="<%# Rs.Messages.确定删除%>"></asp:LinkButton>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div class="tool_ControlPanel">
            <table>
                <tr>
                    <td>
                        <input onclick="Checks(this)" type="checkbox">全选
                    </td>
                    <td>
                        <uc2:ReportControl ID="ReportControl1" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="both">
        </div>
        <div class="backpanel">
            <label class="lab_button" id="__mt_labBack" runat="server">
                <input causesvalidation="false" type="button" runat="server" onclick="back(this)" value="返回" />
            </label>
        </div>

        <uc2:Menu ID="Menu1" runat="server" />
        <uc3:ReportServer ID="ReportServer1" runat="server" />
    </form>
</body>
</html>
