<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<style type="text/css">
    #appHotelForm table th
    {
        width: 75px;
        font-weight: normal;
        text-align: right;
    }
</style>
<div class="easyui-panel" data-options="fit:true,border:false">
    <div class="datagrid-toolbar">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
            onclick="loadAppHotel();">
            <%: Html.Language("Refresh")%></a> <a href="javascript:void(0)" class="easyui-linkbutton"
                data-options="iconCls:'icon-save',plain:true" onclick="saveAppHotel();">
                <%: Html.Language("Save")%></a>
    </div>
    <form id="appHotelForm" class="easyui-form" method="post" action="#">
    <table cellpadding="5px">
        <tr>
            <th>
                <label for="txtHotelName"><%: Html.Language("HotelName")%></label>
            </th>
            <td>
                <input id="txtHotelName" name="H01" class="easyui-validatebox textbox text" data-options="validType:'length[0,30]'" style="width: 350px;" />
            </td>
              <th><label for="txtHotelEnglishName"><%: Html.Language("HotelEnglishName")%></label></th>
            <td>
                <input id="txtHotelEnglishName" name="H03" class="easyui-validatebox textbox text" data-options="validType:'length[0,30]'" style="width: 350px;" />
            </td>
        </tr>
        <tr>
            <th style="vertical-align: top">
                <label for="txtHotelIntroduce">
                    <%: Html.Language("IntroductionContent")%>
                </label>
            </th>
            <td>
                <textarea id="txtHotelIntroduce" name="H02" class="easyui-validatebox textbox text" data-options="validType:'length[0,4000]'" rows="50" cols="25" maxlength="4000"  style="width:350px;height:300px;white-space:normal;overflow-y:auto;"></textarea>
            </td>
             <th style="vertical-align: top">

                <label for="txtHotelEnglishIntroduce"><%: Html.Language("HotelEnglishIntroduce")%></label>
            </th>
            <td>
                <textarea id="txtHotelEnglishIntroduce" name="H04" class="easyui-validatebox textbox text" data-options="validType:'length[0,4000]'" rows="50" cols="25" maxlength="4000"  style="width:350px;height:300px;white-space:normal;overflow-y:auto;"></textarea>
            </td>
        </tr>
		
    </table>
    </form>
</div>
<script type="text/javascript">
    $(function () { loadAppHotel() });
    function loadAppHotel() {
        $('#appHotelForm').form('load', '/MobileApp/LoadAppHotel/');
    }
    function saveAppHotel() {

    	var form = $('#appHotelForm');

    	if (form.form('enableValidation').form('validate')) {

    		var entry = $("#appHotelForm").serializeJson();

    		var params = { jsonData: JSON.stringify(entry) };

    		$.tools.post(params, '/MobileApp/SaveAppHotel/');
    	}
    }
</script>
