<%@ Page Language="C#" MasterPageFile="~/Views/Shared/MasterPage.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 title='<%: Html.Language("UsersMgmt")%>' 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="
						toolbar: '#tbSysUser',
						border: false,
						singleSelect: false,
						pagination: true,
						pageSize: 20,
						rownumbers: true,
						striped: true,
						sortName: 'Sort',
						sortOrder: 'asc',
						fit: true,
						fitColumns: true,
						idField: 'ID',
						frozenColumns: [[
							{ field: 'ID', checkbox: true }
						]],
						url: '/SysUser/LoadAllByPage/',
						method: 'post',
						onDblClickRow: function(index, row) { edit(row); }
					">
				<thead>
					<tr>
						<th data-options="field:'Account',sortable:true">
							<%: Html.Language("Account")%>
						</th>
						<th data-options="field:'RoleName',sortable:true">
								<%: Html.Language("RoleName")%>
						</th>
						<th data-options="field:'GroupName',sortable:true,width:60">
							<%: Html.Language("Group")%>
						</th>
						<th data-options="field:'ActiveIndicator',align:'center',formatter:function(val,rec){return val ? lang.Yes : lang.No;}">
								<%: Html.Language("StartUsing")%>
						</th>
						<th data-options="field:'Sort',align:'center'">
							<%: Html.Language("Sort")%>
						</th>
						<th data-options="field:'Remark'">
							<%: Html.Language("Remark")%>
						</th>
						<th data-options="field:'CreatedBy',sortable:true">
							<%: Html.Language("Founder")%>
						</th>
						<th data-options="field:'CreatedDate',sortable:true,formatter:$.tools.formatDate">
							<%: Html.Language("CreatedDate")%>
						</th>
						<th data-options="field:'ModifiedBy',sortable:true">
							<%: Html.Language("ModifiedPerson")%>
						</th>
						<th data-options="field:'ModifiedDate',sortable:true,formatter:$.tools.formatDate">
							<%: Html.Language("ModifiedDate")%>
						</th>
					</tr>
				</thead>
			</table>
		</div>   

		<div title='<%: Html.Language("Floor")%>' style="width:200px;border-left:1px solid #95B8E7;"
			data-options="
				region: 'east',
				split: true,
				border: false
			">
			<table id="groupTree" class="easyui-treegrid"
				data-options="
					toolbar: '#tbGroup',
					url: '/Group/LoadGroupTree/',
					method: 'post',
					idField: 'ID',
					treeField: 'Name',
					fit: true,
					fitColumns: true,
					animate: true,
					border: false,
					loadMsg: lang.LoadingData,
					bodyCls: 'easyui-treegrid-no-icon',
					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="tbSysUser">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="$('#dg').datagrid('load',{});"><%: Html.Language("Refresh")%></a> 
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="add()"><%: Html.Language("New")%></a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="edit()"><%: Html.Language("Edit")%></a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="delData()"><%: Html.Language("Delete")%></a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-reset-password',plain:true" onclick="changePassword()"><%: Html.Language("ChangePassword")%></a>
	</div>
	<div id="tbGroup">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="group.add()"><%: Html.Language("New")%></a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="group.edit()"><%: Html.Language("Edit")%></a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="group.del()"><%: Html.Language("Delete")%></a>
	</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 src="/Scripts/sys-user-index.js" type="text/javascript"></script>
</asp:Content>
