<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="UserUpdate.aspx.vb" Inherits="Dingtai.Website.UserUpdate"  EnableEventValidation="false" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>鼎太播客 &gt; 后台管理 &gt; 新增用户</title>   
   </head>
<body id="tag2_right">
<form id="Form1"  runat ="server" >
<div id="body">
<div id="title">
    <h5>您现在的位置：<a href="#">后台管理</a> &gt; 添加/修改标签页面</h5>
</div>
<div id="box">
 <br />
<div id="Div1">
<a href ="UserList.aspx"><img alt="" src="/Skins/default/images/fhlb.gif" /></a> <input type="button" value="角色分配" onClick="locking();" style="" runat="server" id="addFriend"></a>                 
</div> 

    <p ><asp:Label ID="lblID" Visible ="false"  runat="server" Text="Label"></asp:Label></p>
<div class="center">    
    <div class="center_left"> <span>用户名称：</span><asp:TextBox ID="txtUserName" runat="server"  class="wbk" ReadOnly></asp:TextBox></div>
    <div class="center_right"><span>昵&nbsp;&nbsp;&nbsp;&nbsp;称：</span><asp:TextBox ID="txtNick" runat="server" class="wbk" ></asp:TextBox></div>
   <%-- <div class="center_left" visible="false"><span>密&nbsp;&nbsp;&nbsp; 码：</span><asp:TextBox ID="txtPwd" runat="server" TextMode="Password"  class="wbk" ></asp:TextBox></div>
    <div class="center_right" visible="false"><span>确认密码：</span><asp:TextBox ID="txtPwd2" runat="server" TextMode="Password"  class="wbk"></asp:TextBox></div>
    <div class="center_left" visible="false"><span>密码提示问题：</span><asp:TextBox ID="txtQus" runat="server"   class="wbk"></asp:TextBox></div>
    <div class="center_right" visible="false"><span>密码提示答案：</span><asp:TextBox ID="txtAns" runat="server"   class="wbk"></asp:TextBox></div>--%>
    <div class="center_left"><span>邮&nbsp;&nbsp;&nbsp; 箱：</span><asp:TextBox ID="txtEmail" runat="server"  class="wbk"></asp:TextBox></div>
    <div class="center_right"><span>电话号码：</span><asp:TextBox ID="txtTEL" runat="server" class="wbk"></asp:TextBox></div>
    <div class="center_left"><span>省&nbsp;&nbsp;&nbsp; 份：</span><asp:DropDownList ID="ctl00_ContentPlaceHolder1_Province" runat="server" class="wbk"  onchange="getCity(this.options[this.selectedIndex].value)" ></asp:DropDownList></div>
    <div class="center_right"><span>城&nbsp;&nbsp;&nbsp; 市：</span><asp:DropDownList ID="ctl00_ContentPlaceHolder1_City"  class="wbk" runat="server"></asp:DropDownList></div>
    <script >InitSelect();</script>
    <div class="center_left"><span>真实姓名：</span><asp:TextBox ID="txtRealName" runat="server" class="wbk"></asp:TextBox></div>
    <div class="center_right"><span>性别：</span><asp:RadioButtonList ID="radGender" runat="server" RepeatDirection="Horizontal"><asp:ListItem Text="男" Value="0" Selected></asp:ListItem><asp:ListItem Text="女" Value="1"></asp:ListItem></asp:RadioButtonList></div>
    <div class="center_left"><span>通讯工具：</span><asp:TextBox ID="txtIM" runat="server" class="wbk"></asp:TextBox></div>
    <div class="center_right"><span>出生日期：</span><asp:TextBox ID="calBirthday" class="wbk" onclick ="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" runat="server"></asp:TextBox></div>
	
	<div class="center_buttom"><asp:ImageButton ID="btnSumbit" runat="server" ImageUrl="/Skins/default/images/tj_an.gif" />
	<%--<asp:ImageButton ID="imgChong" runat="server" ImageUrl ="/Skins/default/images/box_an13.GIF" />--%> 
	<input type="image" onclick="javascript:document.forms['<%= Form1.ClientID %>'].reset(); return false;" src="/Skins/default/images/box_an13.GIF" />

	</div>
</div>

</div>
</div>


<div id="pop_bg"></div>

<!--浮层框架开始-->
<div id="pop_body">
<div id="pop_box">
<div id="pop_title">
<a href="JavaScript:;" class="style1" onClick="Lock_CheckForm(this);">关闭</a><span>角色分配</span>
</div>
<div id="pop_content" style="padding-top:11px;margin-left:8px;">
<div class="Reply_left">
<ul>
    <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate><li><input name="" type="checkbox" value='<%# Eval ("ID") %>'><%# Eval ("RoleName") %></li></ItemTemplate>
    </asp:Repeater>
</ul>
</div>
<div class="Reply_conter"><input name="" type="button" value="添&nbsp;加" onclick="Add_Role();"><input name="" type="button" value="移&nbsp;除" onclick="Del_Role();"></div>
<div class="Reply_right">
<div class="Reply_right_box">
<ul>
     <asp:Repeater ID="Repeater2" runat="server">
        <ItemTemplate><li><input name="" type="checkbox" value='<%# Eval ("ID") %>'><%# Eval ("RoleName") %></li></ItemTemplate>
    </asp:Repeater>
</ul>
</div>
<input name="" type="button" value="确&nbsp;定" onclick='Update("<%=userID %>");' style="margin-top:9px;">
</div>

</div>

</div>
</div>
</div>
<!--浮层框架结束-->

</form>


<script type="text/javascript" src="/js/jquery-1.6.js"></script>
<script language="javascript">
function locking(){
 document.all.pop_bg.style.display="block";
 document.all.pop_bg.style.width=document.body.clientWidth;
 document.all.pop_bg.style.height=document.body.clientHeight;
 document.all.pop_body.style.display='block';
}
function Lock_CheckForm(theForm){
 document.all.pop_bg.style.display='none';document.all.pop_body.style.display='none';
 return false;
}
function Add_Role() {
    var lefts = $("#pop_content .Reply_left ul");
    var rights =  $("#pop_content .Reply_right ul");
    lefts.find("li").each(function (i){
        if($(this).find("input")[0].checked){
            rights.append($(this).clone());
            $(this).remove();
        }
    });
}

function Del_Role() {
    var lefts = $("#pop_content .Reply_left ul");
    var rights =  $("#pop_content .Reply_right ul");
    rights.find("li").each(function (i){
        if($(this).find("input")[0].checked){
            lefts.append($(this).clone());
            $(this).remove();
        }
    });
}

function Update(id) {
    var rights =  $("#pop_content .Reply_right ul");
    var objs ="";
    rights.find("li").each(function (i){        
        objs = objs + $(this).find("input")[0].value + " , "
    });

    if (objs != "" ) { objs = objs.substr(0,objs.length - 3);objs = objs.split(","); }
    else { objs = [""];}
//    alert(objs);    
//    alert(id);    
        
    var rst = false;
    rst = UserUpdate.UpdateRoles(id,objs).value;
    if (rst = true ) { alert("分配成功!"); location.reload(); }
    Lock_CheckForm(this);
}
</script>
</body>
</html>
