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

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%: Html.Language("BrushCardRecord")%>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<div class="easyui-layout" data-options="fit:true">
		<div title='<%: Html.Language("BrushCardRecord")%>' 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: '#tb',
						border: false,
						pagination: true,
						pageSize: 20,
						rownumbers: true,
						striped: true,
						sortName: 'ID',
						sortOrder: 'asc',
						fit: true,
						fitColumns: true,
						idField: 'ID',
						url: '/HostRoomCard/LoadAllByPage/',
						method: 'post',
						onDblClickRow: function(index, row) { edit(row); }
					">
				<thead>
					<tr>
						<th data-options="field:'RoomNumber'">
							<%: Html.Language("RoomNumber")%>
						</th>
						<th data-options="field:'CardNumber',sortable:true">
							<%: Html.Language("CardNumber")%>
						</th>
						<th data-options="field:'CardType',sortable:true">
							<%: Html.Language("CardType")%>
						</th>
						<th data-options="field:'UserNumber',sortable:true">
							<%: Html.Language("UserNumber")%>
						</th>
						<th data-options="field:'UserName',sortable:true">
							<%: Html.Language("UserName")%>
						</th>
						<th data-options="field:'InCardTime',sortable:true,formatter:$.tools.formatDateTime">
								<%: Html.Language("InCardTime")%>
						</th>
						<th data-options="field:'OutCardTime',sortable:true,formatter:$.tools.formatDateTime">
							<%: Html.Language("OutCardTime")%>
						</th>
						<th data-options="field:'Duration',sortable:true">
							<%: Html.Language("DurationMinute")%>
						</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
<div id="tb" style="position:relative;">
	<span style="padding-left:5px;">
		<%: Html.Language("RoomNumber")%>：<input id="txtRoomNumber" class="easyui-textbox" style="width:60px;" />
		员工姓名：<input id="txtUserName" class="easyui-textbox" style="width:60px;" />
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="query()"><%: Html.Language("Query")%></a>
		<a href="/HostRoomCard/Export/" class="easyui-linkbutton" data-options="iconCls:'icon-excel',plain:true" target="_blank">导出</a>
	</span>
	<span style="position:absolute;right:10px;">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="refresh()"><%: Html.Language("Refresh")%></a> 
	</span>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
	<script type="text/javascript">
		function refresh() {
			$('#dg').datagrid('load', {});
			$("#txtRoomNumber").textbox("reset");
		}
		function query() {
			$('#dg').datagrid('reload', { roomNumber: $("#txtRoomNumber").val(), userName: $("#txtUserName").val() });
		}
	</script>
</asp:Content>
