<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="WebSite.Controllers" %>
<%
	List<SceneState> SceneList = ViewData["SceneList"] as List<SceneState>;       
%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
	<meta http-equiv="cache-control" content="max-age=0" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
	<meta http-equiv="pragma" content="no-cache" />
	<title>房间号：<%=ViewData["RoomNumber"] %></title>
	<link type="text/css" rel="stylesheet" href="/Styles/WeiXin/common.css" />
	<link type="text/css" rel="stylesheet" href="/Styles/WeiXin/scene.css" />
	<link type="text/css" rel="stylesheet" href="/Styles/WeiXin/tip.css" />
	<script type="text/javascript" src="/Scripts/jquery.min.js"></script>
	<script type="text/javascript" src="/Scripts/WeiXin/tip.js"></script>
	<script type="text/javascript">
	    $(function () {

	        function setScene(ID) {
	            $.ajax({
	                url: "/WeiXin/SceneControl/",
	                data: { RoomNumber: document.getElementById("hidRoomNumber").value, SceneID: ID },
	                type: "POST",
	                dataType: "JSON",
	                success: function (r) {
	                    showTip(r.Message);
	                }
	            });
	        }

	        $('#scene-list li a').click(function () {
	            $(this).parents('ul').find('.selected').removeClass('selected');
	            $(this).addClass('selected');
	            setScene($(this).attr("modal"));
	        });

	        $('#menu li a').click(function () {
	            $(this).parents('ul').find('.selected').removeClass('selected');
	            $(this).addClass('selected');
	        });
	    });
	</script>
</head>
<body>
	<input id="hidRoomNumber" type="hidden" value='<%=ViewData["RoomNumber"] %>' />
	<div id="cmain">
		<ul id="scene-list" class="clearfix">
			<% 
				var index = 0;
				for (var i = 0; i < SceneList.Count; i++)
				{
					index = (i < 6) ? i : (i - 6);					
			%>
			<li><a href="javascript:void(0)" modal='<%=SceneList[i].SceneID %>'><i class='icon icon-list<%= index %>'>
			</i><em class="text">
				<%=SceneList[i].Name%></em> </a></li>
			<% } %>
		</ul>
	</div>
	<% Html.RenderPartial("Footer"); %>
</body>
</html>
