<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_Room.aspx.vb" Inherits="TourEx.Web.Admin_Room" %>
<%@ Import Namespace="TourEx.BLL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="Css/Style.css"/>
<script type="text/javascript" src="../Sys/Js/jquery.js"></script>
<script type="text/javascript" src="../Sys/Js/jquery.validate.js"></script>
<script type="text/javascript" src="../Sys/Js/jquery.validate.check.js"></script>
</head>
<body>
<form runat="server" id="TourExForm">
<ul class="navLocation">
	<li>您当前位置：<a href="Admin_Main.aspx">首页</a> > <a href="Admin_HotelList.aspx">酒店管理</a> > 
    <asp:HyperLink ID="ListUrl" runat="server">房型管理</asp:HyperLink> >
	<asp:Label ID="navIgation" runat="server" Text=""></asp:Label></li>
</ul>
<div class="infoBox">
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td class="infoBoxTd">房型名称：</td>
		<td>
		    <div id="Placeholder" style="float:left"></div>
			<asp:TextBox ID="R_Name" runat="server" MaxLength="30" style="z-index:100; border:1px solid #7F9DB9; border-right:none;"></asp:TextBox>
		    <asp:DropDownList ID="R_RoomCategory" runat="server" onchange="$('#R_Name').val($(this).val());" style="z-index:1; position:absolute ">
            </asp:DropDownList>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">床型：</td>
		<td>
            <asp:RadioButtonList ID="R_BedCategory" runat="server" 
                RepeatDirection="Horizontal" RepeatLayout="Flow">
            </asp:RadioButtonList>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">门市价：</td>
		<td>
            <asp:TextBox ID="R_RackRate" runat="server" 
                onkeyup="this.value=this.value.replace(/\D/g,'');" Width="50px" CssClass="formTitle"></asp:TextBox> 元
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">平日优惠价：</td>
		<td>
            <asp:TextBox ID="R_Price" runat="server" onkeyup="WeekendPrice(this,0);" 
                maxlength="6" Width="50px" CssClass="formTitle"></asp:TextBox> 元
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">价格附加选项：</td>
		<td><a href="javascript:void(0);" onclick="Open(this,'Price');">开启</a></td>
	</tr>
	<tr id="Price_1" style="display:none;">
		<td class="infoBoxTd">周末价：</td>
		<td>
            周五：<asp:TextBox ID="R_Friday" runat="server" onkeyup="WeekendPrice(this,1);" 
                maxlength="6" box="box_R_Friday" Width="50px" CssClass="formTitle"></asp:TextBox> 元；
            周六：<asp:TextBox ID="R_Saturday" runat="server" onkeyup="WeekendPrice(this,2);" 
                maxlength="6" box="box_R_Friday" Width="50px" CssClass="formTitle"></asp:TextBox> 元；
            周日：<asp:TextBox ID="R_Weekend" runat="server" 
                onkeyup="this.value=this.value.replace(/\D/g,'');" maxlength="6" 
                box="box_R_Friday" Width="50px" CssClass="formTitle"></asp:TextBox> 元
            <label></label>
		</td>
	</tr>
	<tr id="Price_2" style="display:none;">
		<td class="infoBoxTd">特殊价：</td>
		<td>
            <asp:TextBox ID="R_SpecialPrice" runat="server" Height="74px" TextMode="MultiLine" CssClass="formTextarea"></asp:TextBox>
            格式：“月-日:价格”，每行一条记录
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">早餐：</td>
		<td>
            <asp:RadioButtonList ID="R_Breakfast" runat="server" 
                RepeatDirection="Horizontal" RepeatLayout="Flow">
                <asp:ListItem Value="0" Selected="True">无</asp:ListItem>
                <asp:ListItem Value="1">含早</asp:ListItem>
                <asp:ListItem Value="2">双早</asp:ListItem>
                <asp:ListItem Value="3">有(收费)</asp:ListItem>
            </asp:RadioButtonList>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">宽带：</td>
		<td>
            <asp:RadioButtonList ID="R_Internet" runat="server" 
                RepeatDirection="Horizontal" RepeatLayout="Flow">
                <asp:ListItem Value="0" Selected="True">无</asp:ListItem>
                <asp:ListItem Value="1">有(免费)</asp:ListItem>
                <asp:ListItem Value="2">有(收费)</asp:ListItem>
            </asp:RadioButtonList>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">点评<%=WebSet.BonusName %>：</td>
		<td>
            <asp:TextBox ID="R_Bonus" runat="server" Width="50px" CssClass="formTitle"></asp:TextBox> 元
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">其它附加选项：</td>
		<td><a href="javascript:void(0);" onclick="Open(this,'Other');">开启</a></td>
	</tr>
	<tr id="Other_2" style="display:none;">
		<td class="infoBoxTd">面积：</td>
		<td>
            <asp:TextBox ID="R_Area" runat="server" Width="50px"></asp:TextBox> 平方</td>
	</tr>
	<tr id="Other_3" style="display:none;">
		<td class="infoBoxTd">楼层：</td>
		<td>
			<asp:TextBox ID="R_Floor" runat="server" Width="50px"></asp:TextBox> 层
		</td>
	</tr>
	<tr id="Other_4" style="display:none;">
		<td class="infoBoxTd">窗户：</td>
		<td>
			<asp:RadioButtonList ID="R_Windows" runat="server" RepeatDirection="Horizontal" 
                RepeatLayout="Flow">
			<asp:ListItem Value="有窗" text="有窗" Selected="True"></asp:ListItem>
			<asp:ListItem Value="内窗" text="内窗"></asp:ListItem>
			<asp:ListItem Value="无窗" text="无窗"></asp:ListItem>
            </asp:RadioButtonList>
        </td>
	</tr>
	<tr id="Other_5" style="display:none;">
		<td class="infoBoxTd">卫浴：</td>
		<td>
			<asp:RadioButtonList ID="R_Bathroom" runat="server" 
                RepeatDirection="Horizontal" RepeatLayout="Flow">
			<asp:ListItem Value="独立卫浴" text="独立卫浴" Selected="True"></asp:ListItem>
			<asp:ListItem Value="公用卫浴" text="公用卫浴"></asp:ListItem>
            </asp:RadioButtonList>
		</td>
	</tr>
	<tr id="Other_6" style="display:none;">
		<td class="infoBoxTd">加床：</td>
		<td>
            <asp:TextBox ID="R_AddBed" runat="server" onkeyup="this.value=this.value.replace(/\D/g,'');" maxlength="6" Width="50px" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))" Text="0"></asp:TextBox> 元/床
        </td>
	</tr>
	<tr>
		<td class="infoBoxTd">排序：</td>
		<td>
			<asp:TextBox ID="R_OrderID" runat="server" onkeyup="this.value=this.value.replace(/\D/g,'');" maxlength="6" Width="50px" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))" CssClass="formTitle"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;
		</td>
		<td>
			<asp:Button ID="Button1" runat="server" Text="确定" CssClass="formInput01" />
		</td>
	</tr>
</table>
</div>
</form>

<script language="javascript" type="text/javascript">
	<!--//
	function Open(obj,n)
	{
	    if($(obj).text()=='关闭')
	    {
	        $(obj).text('开启');
	        $("tr:[id^='"+n+"_']").hide();
	    }else{
	        $(obj).text('关闭');
	        $("tr:[id^='"+n+"_']").show();
	    }
	}
	function WeekendPrice(obj,t)
	{
	    obj.value=obj.value.replace(/\D/g,'');
	    if(t==0)
	    {
	        $('#R_Friday,#R_Saturday,#R_Weekend').val($(obj).val());
	    }else if(t==1){
	        $('#R_Saturday,#R_Weekend').val($(obj).val());
	    }else if(t==2){
	        $('#R_Weekend').val($(obj).val());
	    }
	}
	$(function(){
	    var H1 = $('#R_RoomCategory').height();
	    $('#R_Name').height($('#R_RoomCategory').height());
	    var H=$('#R_Name').parent().height();
	    var W=$('#R_Name').width();
	    var R_Name_offset = $('#R_Name').offset();
	    var L=R_Name_offset.left;
	    var T=R_Name_offset.top;
	    var W1=$('#R_RoomCategory').width();
	    if(W1>W+23)
	    {
	        W=W1-23;
	        $('#R_Name').width(W);
	    }else if(W>W1-23){
	        W1=W+23;
	        $('#R_RoomCategory').width(W1);
	    }
	    $('#R_Name').css({position:'absolute',top: T+'px',left:L+'px',height:H1+'px',lineHeight:H1+'px'});
	    $('#R_RoomCategory').css({top: T+'px',left:L+'px'});
	    $('#R_Name').parent().height(H);
	    $('#Placeholder').width(W1+5);
	    
		$("#TourExForm").validate({
			rules:{
				R_Name: {required: true},
				R_BedCategory:{required: true},
				R_RackRate: {required: true,min:1},
				R_Price: {required: true,min:1},
				R_Friday:{required: true,min:1},
				R_SpecialPrice:{CheckSpecialPrice:true},
				R_Saturday:{required: true,min:1},
				R_Weekend:{required: true,min:1}
			},
			messages: {
				R_Name: {required: '请填写房型名称'},
				R_BedCategory: {required:'请选择房型'},
				R_RackRate: {required: '请填写门市价',min:'请填写门市价'},
				R_Price: {required: '请填写价格',min: '请填写价格'},
				R_Friday:{required: '请填写周末价',min:'请填写周末价'},
				R_Saturday:{required: '请填写周末价',min:'请填写周末价'},
				R_Weekend:{required: '请填写周末价',min:'请填写周末价'}
			}
		}); 
		jQuery.validator.addMethod("CheckSpecialPrice", function(value, element) {
        var IsSpecialPrice=true;
        value = $.trim(value);
        if(''!=value)
        {
            value = value + "\n";
            if(!value.match(new RegExp('^(((0?[1-9])|(1[0-2]))-((0?[1-9])|([0-2][0-9])|(3[01])):([1-9][0-9]*)([\r\n]{1,2}))+$','i')))
            {
                IsSpecialPrice=false;
            }
        }
	    return this.optional(element) || IsSpecialPrice;  
    }, $.validator.format("特殊价格式不合法"));
	});
	//-->
</script>
</body>
</html>
