<%@ page autoeventwireup="true" inherits="_N25_Basic_Term, App_Web_sfvup29m" language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>学期管理</title>
    <link href="../css/main.css" rel="stylesheet" />
    <link href="../css/GridView.css" rel="stylesheet" />
    <link href="../css/pager.css" rel="stylesheet" type="text/css" />

    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript">
    </script>

    <link href="../css/main.css" rel="stylesheet" type="text/css" />

    <script src="../jquery-1.5.js" type="text/javascript">
    </script>

    <link href="../window/_css/window.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="../window/message/jquery.message.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery/jquery.min.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery.bgiframe.pack.js" type="text/javascript"></script>

    <link href="../window/_css/jqueryui/blitzer/jquery-ui-1.8.12.custom.css" rel="stylesheet"
        type="text/css" />
    <link href="../alert/jquery.alert.css" rel="stylesheet" type="text/css" />

    <script src="../alert/jquery.easydrag.js" type="text/javascript"></script>

    <script src="../alert/jquery.alert.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
   
    
    
function   isnum() 
{ 
if(event.keyCode <48   ||   event.keyCode> 57) 
{ 
event.keyCode=0; 
} 
} 
   
   
      $(function(){
      
        $("#div_win").dialog({
                autoOpen:false,
                modal: false, 
                width:550,
                height:160,
                bigframe:true
                
        });
          $("#div1").dialog({
                autoOpen:false,
                modal: true, 
                width:800,
                height:250,
                bigframe:true
                
        });
        $("#btnAdd").click(function(page){
        
       
           $("#div_win").dialog({ title: '学期管理-添加' });
           $("#div_win").dialog({ draggable: true,resizable:true });

          $("#IsEdit").val("0");

//              $("#TextBox2").val("");
//                $("#TextBox1").val("");
//                  $("#TextBox3").val("");
//                    $("#TextBox4").val("");
//                      $("#TextBox5").val("");
//                          $("#d1").val("");
//                           $("#CascadingDropDown2").val("");                     
         // $("#div_win").dialog("open");

        });
          $("#btnModify").click(function(page){
     
          $("#div_win").dialog({ title: '学期管理-修改' });
           $("#div_win").dialog({ draggable: true,resizable:true });
       //   $("#div_win").dialog("open");
              
        });
                   
    });
    </script>

    <script language="JavaScript" type="text/JavaScript">

//-----------------------------------------------------------------------------------
       $("#chk_all").click(function() {
        $("input[name='chk_list']").attr("checked", $(this).attr("checked"));
    });
    //全选 
    function CheckedAll() {
        $(':checkbox').attr('checked', 'checked');

    }

    //全不选 
    function CheckedNo() {
        $(':checkbox').attr('checked', '');
          var GridView1= document.getElementById("<%=GridView1.ClientID %>");
          for(i = 1;i < GridView1.rows.length; i++)
            {              
             GridView1.rows[i].style.backgroundColor='#FFFFFF';
        }
        
        
        
    }

    //反选 
    function CheckedRev(objCheckBox, strId) {
 var GridView1= document.getElementById("<%=GridView1.ClientID %>");
        if (objCheckBox.tagName == "INPUT" && objCheckBox.type == "checkbox") {
            var allInput = document.getElementsByTagName("input");
            var k=0;
            for (var i = 0; i < allInput.length; i++) {
                if (allInput[i].type == "checkbox" && allInput[i].id.indexOf(strId) >= 0) {
                    k=k+1;
                    
                      if  (allInput[i].disabled==true)
                      {}
                      else 
                      {
                    allInput[i].checked = !allInput[i].checked;
                    
                     if   ( allInput[i].checked)
                    {
                     GridView1.rows[k].style.backgroundColor='#ffff99';
                    }         
                    else
                    {
                     GridView1.rows[k].style.backgroundColor='#FFFFFF';                
                    }
                    }
                }
            }
        }
        
        
        
        //objCheckBox.checked = false;
        document.getElementById ("chk_all").checked=false;
        
    }
    function ChangeAllCheckStatus(objCheckBox, strId) //全选
    {
    
    
     var GridView1= document.getElementById("<%=GridView1.ClientID %>");
        if (objCheckBox.tagName == "INPUT" && objCheckBox.type == "checkbox") {
            var allInput = document.getElementsByTagName("input");
            var k=0;
            for (var i = 0; i < allInput.length; i++) {
                if (allInput[i].type == "checkbox" && allInput[i].id.indexOf(strId) >= 0) {
                  k=k+1
                if  (allInput[i].disabled==true)
                 {
                   GridView1.rows[k].style.backgroundColor='#FFFFFF';
                 }
                 else 
                 {
                   allInput[i].checked = objCheckBox.checked;  
                   if     (objCheckBox.checked)
                   {
                  
                            
                GridView1.rows[k].style.backgroundColor='#ffff99';
                 }
                 else 
                 {
                    GridView1.rows[k].style.backgroundColor='#FFFFFF';
                     
                 }
                 }
      
                      document.getElementById ("cb3").checked=false;
                   
                    
                }
            }
        }

    }
   //---------------------------------------------------------------------------------------------------- 

  var prevselitem=null;
      function selectx(row)
      {
             if(prevselitem!=null)
              {
                  prevselitem.style.backgroundColor='#ffffff';
              }
              row.style.backgroundColor='PeachPuff';
             prevselitem=row;
             
     }
     
     
     function l_out(p,m)
{

if (m<10)
{

var ck= document.getElementById("GridView1_ctl0"+m+"_checkbox1");
}
else 
{
var ck= document.getElementById("GridView1_ctl"+m+"_checkbox1");

}



 if (ck.checked==true)
 {
//document.getElementById("ll").style.backgroundColor='red';
p.style.backgroundColor='#ffff99';
}
else
{
//document.getElementById("ll").style.backgroundColor= '#FFFFFF';
p.style.backgroundColor='#FFFFFF';
}



}

function l_in(p,m)
{


if (m<10)
{

var ck= document.getElementById("GridView1_ctl0"+m+"_checkbox1");
}
else 
{
var ck= document.getElementById("GridView1_ctl"+m+"_checkbox1");

}

 if (ck.checked==true)
 {

 //document.getElementById("ll").style.backgroundColor='red';
 p.style.backgroundColor='#ffff99';
 }
 else
 {

//document.getElementById("ll").style.backgroundColor= '#ffffcc'; 

p.style.backgroundColor='#bce774'; 
 }


}




//--------------------------------------------------------------------------------------

    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div class="title">
            <asp:Label ID="lblList" runat="server" Text="学期信息"></asp:Label>
        </div>
        <div class="panel">
            <asp:Button ID="btnAdd" runat="server" class="addnew" OnClick="btnAdd_Click" Text="添加"
                ToolTip="添加" />
            <asp:Button ID="btnModify" runat="server" class="modify" OnClick="btnModify_Click"
                Text="修改" ToolTip="修改" />
            <asp:Button ID="btnDelete" runat="server" CssClass="delete" OnClick="LinkButton6_Click"
                Text="删除" />
            <asp:Panel ID="chkpanel" runat="server" style="display:inline">
          
           
                <input id="chk_all" name="chk_all" onclick="ChangeAllCheckStatus(this,'checkbox1')"
                    type="checkbox" />全选
                <%--    <input id="cb2" name="chk_all" onclick="javascript:CheckedNo();" type="checkbox" />
            取消全选--%>
                <input id="cb3" name="btnCheckedRev" onclick="CheckedRev(this,'checkbox1')" type="checkbox"
                    value="反　选" />
                反 选
                  </asp:Panel>
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GridView1" runat="server" AllowSorting="true" AutoGenerateColumns="False"
                    CssClass="gv" DataKeyNames="TerId" GridLines="Horizontal" OnRowCommand="GridView1_RowCommand"
                    Width="100%">
                    <RowStyle CssClass="gvRow" />
                    <HeaderStyle CssClass="gvHeader" />
                    <AlternatingRowStyle CssClass="gvAlternatingRow" />
                    <Columns>
                        <asp:TemplateField HeaderText="选"    >
                        <HeaderStyle Width="50px"  HorizontalAlign ="Center" />
                        <ItemStyle Width="50px" HorizontalAlign ="Center"  Wrap="false"  />
                            <ItemTemplate>
                                <asp:CheckBox ID="checkbox1" runat="server" />
                                <asp:HiddenField ID="TerId" runat="server" Value='<%# Eval("TerId") %>' />
                              
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="kk" HeaderText="学期" ItemStyle-HorizontalAlign="Center" />
                      <asp:TemplateField HeaderText="是否当期学期">
                    <ItemTemplate>
                        <asp:Button ID="Button3" runat="server" CommandArgument='<%# Eval("TerId") %>' CommandName="ffx"   Text="设置当前学期" />
                     <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                    
                    </ItemTemplate>
                      
                      </asp:TemplateField>
                      
                      
                      
                     
                    
                    </Columns>
                </asp:GridView>
                <asp:Panel ID="Panel1" runat="server" Visible="false" Width="100%">
                    <div class="paginator">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="left">
                                    <webdiyer:aspnetpager id="PagerButtom" runat="server" alwaysshow="True" bordercolor="Aqua"
                                        cssclass="paginator" custominfoclass="" custominfohtml="当前第%CurrentPageIndex%/%PageCount%页 共%RecordCount%条记录 每页%PageSize%条 "
                                        custominfosectionwidth="" firstpagetext="首页" horizontalalign="Right" lastpagetext="尾页"
                                        layouttype="Table" morebuttonsclass="" nextpagetext="下一页" numericbuttoncount="10"
                                        onpagechanged="Pager_PageChanged" pageindexboxclass="cpb" pagesize="20" prevpagetext="上一页"
                                        showcustominfosection="Right" showpageindexbox="Always">
                            </webdiyer:aspnetpager>
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:Panel>
                <asp:HiddenField ID="IsEdit" runat="server" />
                <asp:HiddenField ID="modify" runat="server" />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnModify" />
                <asp:AsyncPostBackTrigger ControlID="btnDelete" />
            </Triggers>
        </asp:UpdatePanel>
        <div id="div_win" style="display: none">
            <iframe frameborder="0" src="about:blank" style="position: absolute; z-index: -1;
                width: 100%; height: 100%; top: 0; left: 0;"></iframe>
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <table border="0" cellpadding="0" cellspacing="0" class="table" width="100%">
                        <tr>
                            <td align="right" style="width: 130px">
                                学年：
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="year_name"  Width="158" runat="server">
                                </asp:DropDownList>
                            </td>
                            
                        </tr>
                        <tr>
                            <td align="right" style="width: 130px">
                               学期名称：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="ter_name" runat="server" Width="158"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 130px">
                                是否当前学期：
                            </td>
                            <td align="left">
                                <asp:CheckBox ID="is_Ter"   runat="server" />
                            </td>
                        </tr>
                     
                       
                    </table>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="click" />
                    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            <div class="panel" style="padding-left: 130px; width: 74%">
                <asp:Button ID="Button1" runat="server" CssClass="input" OnClick="LinkButton1_Click"
                    Text="确 定" />
                <asp:Button ID="Button2" runat="server" CssClass="input" OnClick="LinkButton2_Click"
                    Text="取 消" />
            </div>
        </div> 
      
      
      
      
      
      
      
          </form>
    <asp:Label ID="lb_pageid" runat="server" Text="" Visible="false"></asp:Label>
    <asp:Label ID="recordcount" runat="server" Visible="false"></asp:Label>
    <asp:Label ID="page_indexpage" runat="server" Text="1" Visible="false"></asp:Label>
    <asp:Label ID="page_count" runat="server" Text="0" Visible="false"></asp:Label>
</body>
</html>
