<%@ page autoeventwireup="true" debug="true" inherits="_N25_User_Tongxl_add, App_Web_tsyy9ur1" language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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/StyleSheet.css" rel="stylesheet" type="text/css" />
    <link href="../css/main.css" rel="stylesheet" />
    <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:750,
height:355,
bigframe:true
});


$("#div1").dialog({
autoOpen:false,
modal: true,
width:800,
height:250,
bigframe:true
});
$("#div_4").dialog({
autoOpen:false,
modal: true,
width:250,
height:300,
bigframe:true
});
$("#div_5").dialog({
autoOpen:false,
modal: true,
width:250,
height:300,
bigframe:true
});

$("#div_6").dialog({
autoOpen:false,
modal: false,
width:750,
height:300,
bigframe:true
});



$('#div_win').bind('dialogbeforeclose', function(event, ui) {

var IsShow=document.getElementById ("IsShow");


if (IsShow!=null)
{
IsShow.value="0";
}
});
$("#btnAdd").click(function(page){
$("#div_win").dialog({ title: '用户管理-添加' });
$("#div_win").dialog({ draggable: true,resizable:true });
$("#IsEdit").val("0");
});
$("#btnModify").click(function(page){
$("#div_win").dialog({ title: '用户管理-修改' });
$("#div_win").dialog({ draggable: true,resizable:true });
});
});
</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 NormalColor = "#fff";
 var AlterColor = "#eee";
var SelectColor = "#ffff99";
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 = k % 2 == 0 ? NormalColor : AlterColor;   
}
}
}
}
}
document.getElementById ("chk_all").checked=false;
}
function ChangeAllCheckStatus(objCheckBox, strId) //全选
{
var NormalColor = "#fff";
 var AlterColor = "#eee";
var SelectColor = "#ffff99";
var GridView1= document.getElementById("<%=GridView1.ClientID %>");
if (objCheckBox.tagName == "INPUT" && objCheckBox.type == "checkbox") {
var allInput = GridView1.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 = k % 2 == 0 ? NormalColor : AlterColor;
}
}
//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,NormalColor,AlterColor,HoverColor,SelectColor)
{
if (m<10)
{
var ck= document.getElementById("GridView1_ctl0"+m+"_checkbox1");
}
else
{
var ck= document.getElementById("GridView1_ctl"+m+"_checkbox1");
}
p.style.background = m % 2 == 1 ? NormalColor : AlterColor; 
if (ck!=null)if (ck.checked==true)
{
p.style.backgroundColor = SelectColor;
}
else
{
p.style.backgroundColor = m % 2 == 1 ? NormalColor : AlterColor; 
}
}
function l_in(p,m,NormalColor,AlterColor,HoverColor,SelectColor)
{
if (m<10)
{
var ck= document.getElementById("GridView1_ctl0"+m+"_checkbox1");
}
else
{
var ck= document.getElementById("GridView1_ctl"+m+"_checkbox1");
}
if (ck!=null)if (ck.checked==true)
{
p.style.backgroundColor = SelectColor;
}
else
{
p.style.backgroundColor = HoverColor; 
}
}
//--------------------------------------------------------------------------------------
</script>
      <script language="javascript" type="text/javascript">




function choose(s1,s2)
{

var IsShow=document.getElementById ("IsShow");
if (IsShow.value=="1")
{
var t1=document.getElementById ("t_value");
var h1=document.getElementById ("h_value");
var t1_bk=document.getElementById ("t_value_bk");
t1_bk.value=s1;

t1.value=s1;
h1.value=s2;
//---------------------------------------------
}
else if (IsShow.value=="0")
{
var t2=document.getElementById ("t_2");
var h2=document.getElementById ("h_2");
if (t2!=null)
{
t2.value=s1;
}
if (h2!=null)
{
h2.value=s2;
}
}
$('#div_4').dialog('close');

}

function choose1(s1,s2)
{

var IsShow=document.getElementById ("IsShow");
if (IsShow.value=="1")
{
var t1=document.getElementById ("Gw_name");
var h1=document.getElementById ("Gw_value");
var t1_bk=document.getElementById ("Gw_name_bk");

t1_bk.value=s1;

t1.value=s1;
h1.value=s2;
//---------------------------------------------
}
else if (IsShow.value=="0")
{
var t2=document.getElementById ("G_name_2");
var h2=document.getElementById ("G_value_2");
if (t2!=null)
{
t2.value=s1;
}
if (h2!=null)
{
h2.value=s2;
}
}
$('#div_5').dialog('close');

}



function serch_clear()
{
var t2=document.getElementById ("t_2");
var h2=document.getElementById ("h_2");
t2.value="";
h2.value=""; 

}

function serch_clear1()
{
var t2=document.getElementById ("G_name_2");
var h2=document.getElementById ("G_value_2");
t2.value="";
h2.value=""; 

}



 function refresh() {
 document.getElementById('<%= Button3.ClientID %>').click();

    }

    </script>
 
    
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        
            <asp:Panel ID="btnSerch" runat="server">
<div class="panel">
<asp:DropDownList ID="role" style="display:none ;" runat="server">

    </asp:DropDownList>
    部门：
    <asp:TextBox ID="t_2" runat="server" CssClass="text1" ReadOnly="true" Width="100"></asp:TextBox>
    <asp:HiddenField ID="h_2" runat="server" />
    <img alt='部门' onclick="$('#div_4').dialog('open');$('#div_4').dialog({ title: '部门分类-选择' });$('#div_4').dialog({ draggable: true,resizable:true });"
        src="../images/select.gif" style="cursor: pointer;" />
    <a alt='清空部门' onclick="serch_clear();" style="color: Red; cursor: pointer;">清空</a>
    
    
    岗位：
    <asp:TextBox ID="G_name_2" runat="server" CssClass="text1" ReadOnly="true" Width="100"></asp:TextBox>
    <asp:HiddenField ID="G_value_2" runat="server" />
    <img alt='岗位' onclick="$('#div_5').dialog('open');$('#div_5').dialog({ title: '岗位分类-选择' });$('#div_5').dialog({ draggable: true,resizable:true });"
        src="../images/select.gif" style="cursor: pointer;" />
    <a alt='清空岗位' onclick="serch_clear1();" style="color: Red; cursor: pointer;">清空</a>
    性别：
    <asp:DropDownList ID="sex" runat="server">
    <asp:ListItem Value="">请选择性别...</asp:ListItem>
    <asp:ListItem >男</asp:ListItem>
        <asp:ListItem>女</asp:ListItem>
    </asp:DropDownList>
    
    用户名、昵称、中文名、英文名：<asp:TextBox ID="name" runat="server" CssClass="text1" Width="158px"></asp:TextBox>
    <asp:Button ID="Button3" runat="server"  CssClass="button_b" Text="搜索" OnClick="Button3_Click" />
    
    <asp:Button ID="Button1" runat="server"   CssClass="button_b" Text="添加" OnClick="Button1_Click" />

  <input id="chk_all" name="chk_all" onclick="ChangeAllCheckStatus(this,'checkbox1')"
            type="checkbox"  style="display:none;"/>

</div>
    </asp:Panel>

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
  
 <asp:HiddenField ID="IsShow" runat="server" Value="0" />
<asp:GridView ID="GridView1"    runat="server"  AutoGenerateColumns="False" CssClass="gv" DataKeyNames="TeaId" GridLines="Horizontal"  Width="100%" OnRowCommand="GridView1_RowCommand">
<RowStyle CssClass="gvRow" />
<HeaderStyle CssClass="gvHeader" />
<AlternatingRowStyle CssClass="gvAlternatingRow" />
<Columns>
<asp:TemplateField HeaderText="选">

 <HeaderTemplate>
                     <input id="chk_all" name="chk_all" onclick="ChangeAllCheckStatus(this,'checkbox1')"
                         type="checkbox" />
                 </HeaderTemplate>

<HeaderStyle Width="50px"  HorizontalAlign ="Center" />
<ItemStyle Width="50px" HorizontalAlign ="Center"  Wrap="False"  />
<ItemTemplate>
<asp:CheckBox ID="checkbox1" runat="server" />
<asp:HiddenField ID="TeaId" runat="server" Value='<%# Eval("TeaId") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField  SortExpression="TeaItemNo"   DataField="TeaItemNo" HeaderText="用户名" >
    <ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
    <asp:BoundField DataField="Tea_nicheng" HeaderText="昵称"
        SortExpression="Tea_nicheng" >
        <ItemStyle HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:BoundField DataField="TeaName" HeaderText="中文名"
        SortExpression="TeaName" >
        <ItemStyle HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:BoundField DataField="Tea_Englishname" HeaderText="英文名"
        SortExpression="Tea_Englishname" >
        <ItemStyle HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:BoundField DataField="TeaSex" HeaderText="性别"
        SortExpression="TeaSex" >
        <ItemStyle HorizontalAlign="Center" />
    </asp:BoundField>
        
<asp:BoundField DataField="Dep_Name" HeaderText="部门"
    SortExpression="Dep_Name" >
    <ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
    <asp:BoundField DataField="Gw_Name" HeaderText="岗位"
        SortExpression="Gw_Name" >
        <ItemStyle HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:BoundField DataField="RoleName" HeaderText="角色"
        SortExpression="RoleName" >
        <ItemStyle HorizontalAlign="Center" />
    </asp:BoundField>
    <asp:TemplateField HeaderText="批量删除">
    
    <HeaderTemplate>
       
        
     <asp:Button ID="LinkButton1" runat="server"    BackColor="red" CssClass="button_r_s"  Text="删除" OnClick="LinkButton1_Click"></asp:Button>
       
        
    </HeaderTemplate>
    <HeaderStyle Width="50px"  HorizontalAlign="Left"   />
    <ItemTemplate   >
      
      
        <asp:Button ID="dell" runat="server" BackColor="yellowGreen" CommandArgument='<%# Eval("Txl_Id") %>'
            CommandName="dell" CssClass="button_r_s" Text="删除"></asp:Button>
    
    </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 ="Button3" />
<asp:AsyncPostBackTrigger ControlID ="Button1" />



</Triggers>
</asp:UpdatePanel>

      
       
        <div id="div_4" style="display: none">
        <iframe frameborder="0" src="about:blank" style="position: absolute; z-index: -1;
            width: 100%; height: 100%; top: 0; left: 0;"></iframe>
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <asp:TreeView ID="TreeView1" runat="server" CollapseImageUrl="~/images/folder.gif"
                        ExpandImageUrl="~/images/folder-closed.gif" NoExpandImageUrl="~/images/file.gif">
                    </asp:TreeView>
                </td>
            </tr>
        </table>
    </div>
    <div id="div_5" style="display: none">
        <iframe frameborder="0" src="about:blank" style="position: absolute; z-index: -1;
            width: 100%; height: 100%; top: 0; left: 0;"></iframe>
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <asp:TreeView ID="TreeView2" runat="server" CollapseImageUrl="~/images/folder.gif"
                        ExpandImageUrl="~/images/folder-closed.gif" NoExpandImageUrl="~/images/file.gif">
                    </asp:TreeView>
                </td>
            </tr>
        </table>
    </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>
 <asp:Label ID="l2" runat="server" ></asp:Label> 
</body>
</html>
