<%@ Page Title="" Language="C#" EnableEventValidation = "false" MasterPageFile="~/Admin/SiteMenu.Master" AutoEventWireup="true" CodeBehind="BS_Remark.aspx.cs" Inherits="Project25175.BS_Remark" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="../assets/css/jquery-ui-1.10.3.full.min.css" />

    <script type="text/javascript">
        //后台调用,区分提示信息底色
        //Danger,Info
        function ChangeMsgClass(MsgType) {
            if (MsgType == "Danger") 
            {
                DivMsg.className = 'alert alert-danger';
            }
            else 
            {
                DivMsg.className = 'alert alert-info';
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
		</script>
		<ul class="breadcrumb">
			<li>
				<i class="<%=PageIcon %>"></i>
                学期评语维护
			</li>
		</ul>
	</div>

    <div class="page-content">
        <div class="row col-xs-12">
            <div id="DivMsg" class="alert alert-info">
                <i class="icon-hand-right"></i>
                <asp:Label ID="LabMsg" runat="server" Text=" "></asp:Label>
			    <button class="close" data-dismiss="alert">
                <i class="icon-remove"></i>
                </button>
            </div>
        </div>

        <div class="page-header">
            <div class="col-xs-12 widget-box">
                <div class="row col-xs-12">
                    <asp:Button ID="BtMenuList" runat="server" OnClick="BtMenuList_Click" Text="数据列表" CssClass="btn btn-info btn-sm" />
                    <asp:Button ID="BtMenuEdit" runat="server" OnClick="GridView1_AllRowEditMode" Text="编辑模式" CssClass="btn btn-primary btn-sm" />
                    <asp:Button ID="BtMenuSave" runat="server" OnClick="BtMenuSave_Click" Text="保存" CssClass="btn btn-info btn-sm hidden" />
                    <a href="#" id="id-btn-dialog-del" class="btn btn-purple btn-sm">保存</a> 
                    <asp:Button ID="BtMenuDel" runat="server" OnClick="BtMenuDel_Click" Text="删除" CssClass="btn btn-info btn-sm hidden" />
                    <asp:Button ID="BtDel" runat="server" Text="删除" CssClass="btn btn-danger btn-sm"/>
                    <asp:Button ID="BtExport" runat="server" Text="导出" Visible="false"
                        CssClass="btn btn-success btn-sm" onclick="BtExport_Click" />
                <%--</div>
                <div class="row col-xs-12"> --%> 
                    <asp:DropDownList ID="DDLProfession" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="DDLProfession_SelectedIndexChanged">                       
                    </asp:DropDownList>
                    <asp:DropDownList ID="DDLClass" runat="server">                       
                    </asp:DropDownList>
                    <asp:DropDownList ID="DDLGrade" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="DDLGrade_SelectedIndexChanged">                       
                    </asp:DropDownList>
                    <asp:DropDownList ID="DDLTerm" runat="server">                       
                    </asp:DropDownList>


                    <%--<asp:DropDownList ID="DDLSchTimeID" runat="server">                       
                    </asp:DropDownList>                
                    <asp:DropDownList ID="DDLGrade" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="DDLGrade_SelectedIndexChanged">                       
                    </asp:DropDownList>
                    <asp:DropDownList ID="DDLClass" runat="server">                       
                    </asp:DropDownList>--%>
                    <asp:TextBox runat="server" ID="TxtSearchUser" placeholder="姓名..." CssClass="input-mini"></asp:TextBox>
                    <asp:Button ID="BtSearch" runat="server"  CssClass="btn btn-success btn-sm hidden" 
                        Text="查找" onclick="BtSearch_Click" />
				    <span>
					    <a href="#"><i class="icon-search nav-search-icon green bigger-140 sender" id="idsearch" title="查找"></i></a>
				    </span> 
                </div>
                
            </div>
        </div>
		
        <div id="dialog-save" class="hide">
			<div class="alert alert-info bigger-110">
				当前勾选的数据将被保存或更新到数据库。
			</div>
			<div class="space-6"></div>
			<p class="bigger-110 bolder center grey">
				<i class="icon-hand-right blue bigger-120"></i>
				确定操作吗?
			</p>
		</div><!-- #dialog-confirm -->

        <div id="dialog-del" class="hide">
		    <div class="alert alert-warning bigger-110">
			    当前勾选的数据将被删除。
		    </div>
		    <div class="space-6"></div>
		    <p class="bigger-110 bolder center grey">
			    <i class="icon-hand-right blue bigger-120"></i>
			    确定删除吗?
		    </p>
	    </div><!-- #dialog-confirm -->

        <asp:Panel runat="server" Visible="false" ID="PanelData">
            <div class="row">
	            <div class="col-xs-12">
		            <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" 
                            CssClass="table table-striped table-bordered table-hover" 
                            AutoGenerateColumns="False" DataKeyNames="ID" 
                            OnRowDataBound="GridView1_RowDataBound" AllowPaging="True" 
                            OnPageIndexChanging="GridView1_PageIndexChanging" >
                            <Columns>
                                <asp:TemplateField HeaderText="选取">
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="CheckBoxTitle" runat="server" CssClass="ace"/>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckSelect" runat="server" />                                        
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="SchTimeName" HeaderText="学期" ReadOnly="True"/>                                
                                <asp:BoundField DataField="ClassName" HeaderText="班级" ReadOnly="True"/>
                                <asp:BoundField DataField="StuNumber" HeaderText="学号" ReadOnly="True"/>
                                <asp:BoundField DataField="StuName" HeaderText="姓名" ReadOnly="True"/>                                                                                            
                                <asp:TemplateField HeaderText="评语内容">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TxtRemarkContent" runat="server" Text='<%# Bind("RemarkContent") %>' 
                                             CssClass="col-xs-12" TextMode="MultiLine"></asp:TextBox>
                                        <asp:Label ID="LabRemarkContent" runat="server" Text='<%#Bind("RemarkContent") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="col-xs-5"/>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="已评">
                                    <ItemTemplate>
                                        <asp:Label ID="LabState" runat="server" CssClass='<%#Eval("State")%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="StudentID" HeaderText="StudentID">
                                <FooterStyle CssClass="hidden" />
                                <HeaderStyle CssClass="hidden" />
                                <ItemStyle CssClass="hidden" />
                                </asp:BoundField>
                                <asp:BoundField DataField="SchTimeID" HeaderText="SchTimeID" >
                                <FooterStyle CssClass="hidden" />
                                <HeaderStyle CssClass="hidden" />
                                <ItemStyle CssClass="hidden" />
                                </asp:BoundField>
                            </Columns>
                            <PagerSettings Mode="NumericFirstLast" />
                        </asp:GridView>
		            </div><!-- /.table-responsive -->
	            </div><!-- /span -->
            </div>
        </asp:Panel>
    </div>
    
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_Footer" runat="server">

    <script type="text/javascript" src="../assets/js/jquery-2.0.3.min.js"></script>

	<script type="text/javascript">
		window.jQuery || document.write("<script src='../assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
	</script>

	<script type="text/javascript">
		if ("ontouchend" in document) document.write("<script src='../assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
	</script>
	<script type="text/javascript" src="../assets/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../assets/js/typeahead-bs2.min.js"></script>

	<!-- page specific plugin scripts -->
    <!-- page specific plugin scripts -->

	<script type="text/javascript" src="../assets/js/jquery-ui-1.10.3.full.min.js"></script>
	<script type="text/javascript" src="../assets/js/jquery.ui.touch-punch.min.js"></script>

	<!-- ace scripts -->

	<script type="text/javascript" src="../assets/js/ace-elements.min.js"></script>
	<script type="text/javascript" src="../assets/js/ace.min.js"></script>
    <script type="text/javascript" src="../assets/js/bootbox.min_25175.js"></script>

    <script type="text/javascript">

        jQuery(function ($) {
            //全选确认框
            $('table th input:checkbox').on('click', function () {
                var that = this;
                $(this).closest('table').find('tr > td:first-child input:checkbox')
	            .each(function () {
	                this.checked = that.checked;
	                $(this).closest('tr').toggleClass('selected');
	            });
            });

            //对话框全局
            $.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
                _title: function (title) {
                    var $title = this.options.title || '&nbsp;'
                    if (("title_html" in this.options) && this.options.title_html == true)
                        title.html($title);
                    else title.text($title);
                }
            }));

            //修改
//            $(document.getElementById('<%=BtMenuSave.ClientID %>')).on('click', function (e) {
            $("#id-btn-dialog-del").on('click', function (e) {
                e.preventDefault();
                $("#dialog-save").removeClass('hide').dialog(
                {
                    resizable: false,
                    modal: true,
                    title: "<div class='widget-header'><h4 class='smaller'><i class='icon-ok'></i>保存</h4></div>",
                    title_html: true,
                    buttons: [
						{
						    html: "<i class='icon-ok bigger-110'></i>&nbsp; 确定",
						    "class": "btn btn-primary btn-xs",
						    click: function () {
						        document.getElementById('<%=BtMenuSave.ClientID %>').click();
						    }
						}
						,
						{
						    html: "<i class='icon-remove bigger-110'></i>&nbsp; 取消",
						    "class": "btn btn-xs",
						    click: function () {
						        $(this).dialog("close");
						    }
						}]
                });
            });


            //删除
            $(document.getElementById('<%=BtDel.ClientID %>')).on('click', function (e) {
                e.preventDefault();
                $("#dialog-del").removeClass('hide').dialog(
                    {
                        resizable: false,
                        modal: true,
                        title: "<div class='widget-header'><h4 class='smaller'><i class='icon-warning-sign red'></i>删除</h4></div>",
                        title_html: true,
                        buttons: [
				            {
				                html: "<i class='icon-trash bigger-110'></i>&nbsp; 确定",
				                "class": "btn btn-danger btn-xs",
				                click: function () {
				                    //DoubleDelClick();
				                    document.getElementById('<%=BtMenuDel.ClientID %>').click();
				                }
				            }
				            ,
				            {
				                html: "<i class='icon-remove bigger-110'></i>&nbsp; 取消",
				                "class": "btn btn-xs",
				                click: function () {
				                    $(this).dialog("close");
				                }
				            }]
                    });
            });


            //查询
            $('#idsearch').on('click', function (e) {
                bootbox.dialog({
                    //图片和文字提示
                    //message: "<img src='../assets/css/images/loading.gif'> 执行中……"
                    //进度条提示
                    message: " <div id='progressbar'></div>"
                });

                //progressbar 进度条样式
                $("#progressbar").progressbar({
                    value: 100,
                    create: function (event, ui) {
                        $(this).addClass('progress progress-striped active')
							   .children(0).addClass('progress-bar progress-bar-success');
                    }
                });

                //执行按钮事件
                document.getElementById('<%=BtSearch.ClientID %>').click();

            });

        });
    </script>
    

</asp:Content>
