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

<%@ Register Src="~/admin/MyHeader.ascx" TagPrefix="uc1" TagName="MyHeader" %>
<%@ Register Src="~/admin/MyFooter.ascx" TagPrefix="uc1" TagName="MyFooter" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会议室预约系统</title>
    <link href="/control/plugin/bootstrap3/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/admin/css/style.css?v=201721" rel="stylesheet" />
    <script src="/control/js/jquery.js"></script>
    <script src="/control/plugin/bootstrap3/js/bootstrap.min.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>

</head>
<body>
    <uc1:MyHeader runat="server" ID="MyHeader1" />
    <div class="container">
        <div class="row">
            <div class="col-xs-12 ">
                <h3 class="page-header" style="margin: 15px 0 20px;">新增会议室<small> 添加新的会议室</small></h3>
            </div>
        </div>
        <div class="row">
            <div class="panel">
                <div class="panel-body">
                    <form id="from1" runat="server">
                        <!-- Add.aspx -->
                        <div>
                            <div id="tree"></div>
                            <script type="text/javascript">
                                $(function(){
                                   $('#tree').treeview({
                                                levels: 1000,
                                                showTags: true,
                                                onNodeSelected: function(event, node) {
                                                    $("#hfEmpID").val(node.id);
                                                },
                                                onNodeUnselected: function (event, node) {
                                                    $("#hfEmpID").val("");
                                                },
                                                data: <%=BuilderTree()%>
                                     });
                              
                                });
                            </script>


                            <asp:TextBox ID="hfEmpID" runat="server" Style="display: none"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvEmp" runat="server" ForeColor="Red" ErrorMessage="请选择所属机构" ControlToValidate="hfEmpID"></asp:RequiredFieldValidator>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">
                                会议室名称<span class='rd'>*</span>：  
                                <asp:RequiredFieldValidator ID="rfvr_name" runat="server" ForeColor="Red" ErrorMessage="请填写会议室名称" ControlToValidate="txtr_name"></asp:RequiredFieldValidator>
                            </label>
                            <asp:TextBox ID="txtr_name" runat="server" MaxLength="50" CssClass="form-control"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">
                                预订限制：  
                            </label>
                            <div>
                                <div class="radio-inline">
                                    <label>
                                        <asp:RadioButton ID="rbAll" Checked="true" GroupName="xz" runat="server" />
                                        允许所有用户预订
                                    </label>
                                </div>
                                <div class="radio-inline">
                                    <label>
                                        <asp:RadioButton ID="rbZhuanyuan" GroupName="xz" runat="server" />
                                        会议室专员预订
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">
                                面积<span class='rd'>*</span>： 
                                <asp:RequiredFieldValidator ID="rfvr_size" runat="server" ForeColor="Red" ErrorMessage="请填写面积" ControlToValidate="txtr_size"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revr_size" ForeColor="Red" runat="server" ErrorMessage="必须为数字" ControlToValidate="txtr_size" ValidationExpression="^[0-9]\d*$"></asp:RegularExpressionValidator></label>

                            <asp:TextBox ID="txtr_size" runat="server" MaxLength="8" CssClass="form-control"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">
                                可容纳人数<span class='rd'>*</span>：    
                                <asp:RequiredFieldValidator ID="rfvr_maxNumber" runat="server" ForeColor="Red" ErrorMessage="请填写可容纳人数" ControlToValidate="txtr_maxNumber"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revr_maxNumber" ForeColor="Red" runat="server" ErrorMessage="必须为数字" ControlToValidate="txtr_maxNumber" ValidationExpression="^[0-9]\d*$"></asp:RegularExpressionValidator>
                            </label>

                            <asp:TextBox ID="txtr_maxNumber" runat="server" MaxLength="8" CssClass="form-control"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">
                                所在位置<span class='rd'>*</span>：  
                                <asp:RequiredFieldValidator ID="rfvr_position" runat="server" ForeColor="Red" ErrorMessage="请填写所在位置" ControlToValidate="txtr_position"></asp:RequiredFieldValidator>
                            </label>

                            <asp:TextBox ID="txtr_position" runat="server" MaxLength="255" CssClass="form-control"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">会议室设置</label>
                            <div class="checkbox">
                                <label>
                                    <asp:CheckBox ID="cbDisable" runat="server" />
                                    禁止预订
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">
                                使用注意事项<span class='rd'>*</span>：  
                                <asp:RequiredFieldValidator ID="rfvr_note" runat="server" ForeColor="Red" ErrorMessage="请填写使用注意事项" ControlToValidate="txtr_note"></asp:RequiredFieldValidator>
                            </label>

                            <asp:TextBox ID="txtr_note" runat="server" MaxLength="255" TextMode="MultiLine" Rows="2" CssClass="form-control"></asp:TextBox>

                        </div>

                        <div class="form-group">
                            <label class=" control-label">
                                会议室设备：  
                            </label>
                            <div>
                                <asp:CheckBoxList ID="cblEquipment" runat="server" RepeatColumns="4" Width="100%"></asp:CheckBoxList>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class=" control-label">
                                会议室照片<span class='rd'>*</span>：  
                            
                            </label>
                            <asp:FileUpload ID="txtr_photo" runat="server" />

                        </div>

                        <div class="form-group">

                            <asp:Button ID="btnSubmit" runat="server" Text="新增会议室" CssClass="btn  btn-primary btn-lg btn-block " OnClick="btnSubmit_Click" />

                        </div>
                    </form>

                </div>

            </div>

            <asp:Literal ID="litPage" runat="server"></asp:Literal>
        </div>
    </div>

    <uc1:MyFooter runat="server" ID="MyFooter1" />

    <script type="text/javascript">
        function rd(key) {
            if (confirm('确定删除该项！')) {
                ZENG.msgbox.show('删除中...', 6);
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    data: { "did": key },
                    success: function (result) {
                        ZENG.msgbox._hide();
                        if (result.state == 1) {
                            location.reload();
                        } else {
                            alert(result.data);
                        }
                    }
                });
            }
        }
    </script>


</body>
</html>
