<%@ page language="C#" autoeventwireup="true" inherits="user_user_UserManager_Edit, ALL" enableEventValidation="false" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会议室预约系统</title>
    <link href="/control/plugin/bootstrap3/css/bootstrap.min.css" rel="stylesheet" />
    <script src="/control/js/jquery.js"></script>
  
    <script src="/control/plugin/bootstrap3/js/bootstrap.min.js"></script>
    <script src="/control/plugin/bootstrap-select-1.12.2/js/bootstrap-select.js"></script>
    <link href="/control/plugin/bootstrap-select-1.12.2/dist/css/bootstrap-select.css" rel="stylesheet" />
    <script src="/control/plugin/bootstrap-select-1.12.2/js/i18n/defaults-zh_CN.js"></script>

    <link href="/control/plugin/bootstrap-treeview/bootstrap-treeview.min.css" rel="stylesheet" />
    <script src="/control/plugin/bootstrap-treeview/bootstrap-treeview.min.js"></script>

    <style>
        .dt {
            float: left;
            font-size: 20px;
            margin-right: 10px;
            margin-top: 5px;
        }
    </style>
</head>
<body>
    <div class=" container-fluid">
        <form id="from1" runat="server">
            <!-- Add.aspx -->
            <div class="form-group">
                <label class=" control-label">
                    机构<span class='rd'>*</span>：
                </label>

                <div>
                    <div id="tree"></div>
                    <script>
                        $(function(){
                            $('#tree').treeview({
                                levels: 1000,
                                multiSelect:true,
                                showTags: true,
                                onNodeSelected: function(event, node) {
                                    showSelect();
                                },
                                onNodeUnselected: function (event, node) {
                                    $('#'+node.id).remove();
                                },
                                data: <%=BuilderTree()%>
                            });
                            showSelect();
                        });
                        function showSelect(){
                            $('#depart').html("");
                            var selecteds = $('#tree').treeview('getSelected');
                            for (var i = 0; i < selecteds.length; i++) {
                                appendDepart(selecteds[i].id,selecteds[i].text);
                            }
                        }
                        function appendDepart(id,text)
                        {  
                            $('#depart').append('<span class="label label-default dt"  id="'+id+'">' + text + ' <input name="depart" value="'+id+'" type="hidden" /></span>');
                        }
                    </script>
                </div>
                <div id="depart" class="clearfix">
                </div>
                <asp:HiddenField ID="hfDepart" runat="server" />
            </div>

            <div class="form-group">
                <div class="row">
                    <div class="col-xs-6">
                        <label class=" control-label">
                            姓名<span class='rd'>*</span>：   
                        <asp:RequiredFieldValidator ID="rfvee_name" runat="server" ForeColor="Red" ErrorMessage="必填" ControlToValidate="txtee_name"></asp:RequiredFieldValidator></label>
                        <asp:TextBox ID="txtee_name" runat="server" MaxLength="50" CssClass="form-control"></asp:TextBox>
                    </div>
                    <div class="col-xs-6">
                        <label class=" control-label">
                            职位<span class='rd'>*</span>：
                        </label>
                        <asp:TextBox ID="txtjob" runat="server" MaxLength="50" CssClass="form-control"></asp:TextBox>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="row">
                    <div class="col-xs-6">
                        <label class=" control-label">手机号码<span class='rd'>*</span>：<asp:RequiredFieldValidator ID="rfvee_phone" runat="server" ForeColor="Red" ErrorMessage="必填" ControlToValidate="txtee_phone"></asp:RequiredFieldValidator></label>
                        <asp:TextBox ID="txtee_phone" runat="server" MaxLength="50" CssClass="form-control"></asp:TextBox>
                    </div>
                    <div class="col-xs-6">
                        <label class=" control-label">
                            电子邮箱<span class='rd'>*</span>：
                            <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ForeColor="Red" ErrorMessage="必填" ControlToValidate="txtEmail"></asp:RequiredFieldValidator></label>
                        <asp:TextBox ID="txtEmail" runat="server" MaxLength="50" CssClass="form-control"></asp:TextBox>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class=" control-label">
                    用户名<span class='rd'>*</span>： 
                <asp:RequiredFieldValidator ID="rfvt_user" runat="server" ForeColor="Red"
                    Display="Dynamic" ErrorMessage="必填" ControlToValidate="txtee_user"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revUser" runat="server" ErrorMessage="只允许数字字母@_." Display="Dynamic" ForeColor="Red" ControlToValidate="txtee_user" ValidationExpression="^[0-9a-zA-Z_@]{1,50}$"></asp:RegularExpressionValidator>

                </label>
                <div>
                    <asp:TextBox ID="txtee_user" runat="server" MaxLength="50" CssClass="form-control"></asp:TextBox>
                </div>
                <p class="help-block">用户名只允许数字字母@_.组成</p>
            </div>
            <label class=" control-label">
                权限角色<span class='rd'>*</span>：
            </label>
            <label class="radio-inline">
                <asp:RadioButton ID="rbManger" GroupName="role"  Enabled="false" runat="server" />
                管理员
            </label>
            <label class="radio-inline">
                <asp:RadioButton ID="rbDepart" GroupName="role"  Enabled="false" runat="server" />
                机构主管
            </label>
            <label class="radio-inline">
                <asp:RadioButton ID="rbUser" GroupName="role"  Enabled="false" runat="server" />
                普通用户
            </label>
          
            <p class="help-block">选择用户角色，不同角色将存在不同操作权限(管理员设置机构主管权限)</p>
              <div class="checkbox">
                <label>
                    <asp:CheckBox ID="cbLogin"  runat="server" Enabled="false" />
                    禁止用户登录
                </label>
            </div>
            <div class="form-group">
                <label class=" control-label">
                    密码：
                   
                </label>
                <div>
                    <asp:TextBox ID="txtee_pass" runat="server" MaxLength="20" CssClass="form-control" TextMode="Password"></asp:TextBox>
                    <p class="help-block">如需修改密码，请重新填写密码,否则留空</p>
                </div>
            </div>

            <div class="form-group">
                <label class=" control-label">
                    密码验证<span class='rd'>*</span>：
           <asp:CompareValidator ID="cvtxtt_pass2" ControlToValidate="txtee_pass2" ControlToCompare="txtee_pass" runat="server" ErrorMessage="两次密码输入不一致" ForeColor="Red"></asp:CompareValidator>
                </label>
                <div>
                    <asp:TextBox ID="txtee_pass2" runat="server" MaxLength="20" CssClass="form-control" TextMode="Password"></asp:TextBox>
                </div>
                <p class="help-block">再次输入密码</p>
            </div>

            <div class="checkbox">
                <label>
                    <asp:CheckBox ID="cbZhuanyuan" GroupName="xk" runat="server" />
                    会议室专员 (部分会议室只允许专员才能预订)
                </label>
            </div>

            <div class="form-group">
                <label class=" control-label">
                    备注：   
                </label>
                <asp:TextBox ID="txtee_note" runat="server" MaxLength="255" CssClass="form-control"></asp:TextBox>
            </div>

            <div class="form-group">
                <asp:Button ID="btnSubmit" runat="server" Text="保存编辑" CssClass="btn  btn-block btn-primary" OnClick="btnSubmit_Click" />
            </div>
        </form>
        <script type="text/javascript">        $(function () { window.parent.ShowDialog(); });    </script>
    </div>
</body>
</html>
