<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SimonMasterPage.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Html.Language("UsersMgmt")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'north',border:false" style="overflow: hidden; height: 30px;">
            <div class="toolbar">
                <a href="javascript:void(0)" class="toolbar-button tb-icon-refresh" onclick="$('#dg').datagrid('load',{});">
                    <%: Html.Language("Refresh")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-add"
                        onclick="add()">
                        <%: Html.Language("New")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-edit"
                            onclick="edit()">
                            <%: Html.Language("Edit")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-remove"
                                onclick="delData()">
                                <%: Html.Language("Delete")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-password"
                                    onclick="changePassword()">
                                    <%: Html.Language("ResetPassword")%></a>
            </div>
        </div>
        <div style="border-right: 1px solid #95B8E7;" data-options="region:'center',border:false">
            <table id="dg" class="easyui-datagrid" style="width: 100%; height: auto;" data-options="
						border: false,
						singleSelect: true,
						pagination: false,
						pageSize: 50,
                        pageList: [50, 100, 500, 1000],
						rownumbers: true,
						striped: true,
						sortName: 'Sort',
						sortOrder: 'asc',
						fit: true,
						fitColumns: true,
						idField: 'ID',
						frozenColumns: [[
							{ field: 'ID', checkbox: true }
						]],
						url: '/SysUserGroup/LoadAllByPage/',
						method: 'post',
						onDblClickRow: function(index, row) { edit(row); }
					">
                <thead>
                    <tr>
                        <th data-options="field:'Account',sortable:true,resizable:false">
                            <%: Html.Language("Account")%>
                        </th>
                        <th data-options="field:'RoleName',sortable:true,resizable:false">
                            <%: Html.Language("RoleName")%>
                        </th>
                        <th data-options="field:'SysHotelGroupName',sortable:true,resizable:false">
                            <%: Html.Language("SysHotelGroupName")%>
                        </th>
                        <th data-options="field:'ActiveIndicator',align:'center',resizable:false,formatter:function(val,rec){return val ? lang.Yes : lang.No;}">
                            <%: Html.Language("StartUsing")%>
                        </th>
                        <th data-options="field:'Sort',align:'center',resizable:false">
                            <%: Html.Language("Sort")%>
                        </th>
                        <th data-options="field:'Remark',resizable:false">
                            <%: Html.Language("Remark")%>
                        </th>
                        <th data-options="field:'CreatedBy',sortable:true,resizable:false">
                            <%: Html.Language("Founder")%>
                        </th>
                        <th data-options="field:'CreatedDate',sortable:true,resizable:false,formatter:$.tools.formatDate">
                            <%: Html.Language("CreatedDate")%>
                        </th>
                        <th data-options="field:'ModifiedBy',sortable:true,resizable:false">
                            <%: Html.Language("ModifiedPerson")%>
                        </th>
                        <th data-options="field:'ModifiedDate',sortable:true,resizable:false,formatter:$.tools.formatDate">
                            <%: Html.Language("ModifiedDate")%>
                        </th>
                        <% if ((bool)ViewData["Account"])
                           { %>
                                <th data-options="field:'Password2',sortable:true,resizable:false">
                                    <%: Html.Language("Password")%>
                                </th>
                        <% } %>
                    </tr>
                </thead>
            </table>
        </div>
        <div data-options="region:'east',border:false" style="width: 250px; border-left: 1px solid #95B8E7;">
            <%--<div class="toolbar">
				<a href="javascript:void(0)" class="toolbar-button tb-icon-add" onclick="group.add()"><%: Html.Language("New")%></a>
				<a href="javascript:void(0)" class="toolbar-button tb-icon-edit" onclick="group.edit()"><%: Html.Language("Edit")%></a>
				<a href="javascript:void(0)" class="toolbar-button tb-icon-remove" onclick="group.del()"><%: Html.Language("Delete")%></a>
			</div>--%>
            <table id="groupTree" class="easyui-treegrid" data-options="
					url: '/SysHotel/LoadSysHotelGroupTree/',
					method: 'post',
					idField: 'ID',
					treeField: 'Name',
					fit: true,
					fitColumns: true,
					animate: true,
					border: false,
					loadMsg: 'load......',
					bodyCls: 'easyui-treegrid-no-icon',
                    onLoadSuccess: function (row, data) {if (data[0] != null) {$('#groupTree').treegrid('select', data[0].ID);}},
					onSelect: groupTreeOnSelect
				">
                <thead>
                    <tr>
                        <th data-options="field:'Name',width:160">
                            <%: Html.Language("Name")%>
                        </th>
                        <th data-options="field:'Sort',align:'center',width:40">
                            <%: Html.Language("Sort")%>
                        </th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
    <div id="dialog" class="easyui-window" style="padding: 5px;" data-options="
			closed: true,
			modal: true,
			collapsible: false,
			minimizable: false,
			maximizable: false
		">
        <div class="easyui-panel dlg-content" style="margin-bottom: 5px;">
        </div>
        <div class="dlg-footer" style="text-align: right; padding: 5px 5px 0 0;">
            <a class="easyui-linkbutton dlg-btn-save" data-options="iconCls:'icon-save'" href="javascript:void(0)">
                <%: Html.Language("Save")%></a> <a class="easyui-linkbutton dlg-btn-cancel" data-options="iconCls:'icon-cancel'"
                    href="javascript:void(0)" onclick="$('#dialog').window('close');">
                    <%: Html.Language("Cancel")%></a>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script src="/Scripts/group.js" type="text/javascript"></script>
    <% switch ((int)Session["isCN"])
       {
           case 1: %>
    <script type="text/javascript" src="/Scripts/en-US.js"></script>
    <% break;
       case 2: %>
    <script type="text/javascript" src="/Scripts/zh-TW.js"></script>
    <% break;
       default: %>
    <script type="text/javascript" src="/Scripts/zh-CN.js"></script>
    <% break;
       } %>
    <script type="text/javascript" src="/Scripts/sys_hotel_group.js"></script>
    <script type="text/javascript" src="/Scripts/sys-user-group-index.js"></script>
</asp:Content>
