<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Domain.Host>" %>
<style type="text/css">
    #editHostForm table th
    {
        font-weight: normal;
        text-align: right;
    }
</style>
<input type="hidden" id="txtAccount" value="<%: ViewData["Account"] %>" />
<form id="editHostForm" class="easyui-form" method="post" data-options="novalidate:true">
<input type="hidden" name="ID" value="<%: Model.ID %>" />
<input type="hidden" name="HostNumber" value="<%: Model.HostNumber %>" />
<table style="margin: 1px auto;" cellpadding="3">
    <tr>
        <th>
            <label for="txtRoomNumber">
                <%: Html.Language("RoomNumber") %>：</label>
        </th>
        <td>
            <input id="txtRoomNumber" name="RoomNumber" class="easyui-validatebox textbox text"
                data-options="required:true,validType:'blwtext'" value="<%: Model.RoomNumber %>" />
        </td>
        <th>
        </th>
        <td>
            <input type="checkbox" name="IsSyncRoomNumber" style="vertical-align: top;" value="true" <%: Model.IsSyncRoomNumber ? "checked='checked'" : "" %> /><%: Html.Language("IsSyncRoomNumber")%>&nbsp;
            <input type="checkbox" name="IsAutoUpdate" style="vertical-align: top;" value="true" <%: Model.IsAutoUpdate ? "checked='checked'" : "" %> /><%: Html.Language("IsAutoUpdate")%>
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtMAC">
                MAC：</label>
        </th>
        <td>
            <input id="txtMAC" name="MAC" class="easyui-validatebox textbox text" data-options="validType:'length[17,17]'" value="<%: Model.MAC %>" />
        </td>
        <th>
            <label for="cbxHotels">
                <%: Html.Language("Hotel")%>：</label>
        </th>
        <td>
            <select id="cbxHotels" name="HotelID" class="easyui-combobox" style="width: 180px;"
                data-options="
						valueField: 'ID',
						textField: 'Name',
						required: true,
						panelHeight: '180px',
						editable: false,
						onSelect: cbxHotelsOnSelect,
						url: '/SysHotel/LoadAll',
						value: <%: Model.SysHotel != null ? Model.SysHotel.ID.ToString() : "''" %>
					">
            </select>
        </td>
    </tr>
    <tr>
        <th>
            <label for="cbxGroup1">
                <%: Html.Language("Group") %>：</label>
        </th>
        <td>
            <select id="cbxGroup1" name="GroupID" class="easyui-combotree" style="width: 180px;"
                data-options="
                        required:true,
                        editable:false,
						panelHeight: '180px',
                        lines:true,
                        url:'/Group/LoadGroupTree2/',
                        value:<%: Model.Group != null ? Model.Group.ID.ToString() : "''" %>
                ">
            </select>
        </td>
        <th>
            <label for="cbxRoomType1">
                <%: Html.Language("RoomType") %>：</label>
        </th>
        <td>
            <select id="cbxRoomType1" name="RoomTypeID" class="easyui-combobox" style="width: 180px;"
                data-options="
						valueField: 'ID',
						textField: 'Name',
						required: true,
						panelHeight: '180px',
						editable: false,
						url: '/RoomType/LoadRoomType',
						value: <%: Model.RoomType != null ? Model.RoomType.ID.ToString() : "''" %>
					">
            </select>
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtServerIP">
                <%: Html.Language("ServerIP") %>：</label>
        </th>
        <td>
            <input id="txtServerIP" name="ServerIP" class="easyui-validatebox textbox text" data-options="required:true" validType="ip" readonly="readonly" value="<%: string.IsNullOrEmpty(Model.ServerIP)?"106.75.37.225":Model.ServerIP %>" />
        </td>
        <th>
            <label for="txtServerPort">
                <%: Html.Language("ServerPort") %>：</label>
        </th>
        <td>
            <input id="txtServerPort" name="ServerPort" class="easyui-numberbox" data-options="required:true" readonly="readonly" value="<%: Model.ServerPort==0?3339:Model.ServerPort %>" />
        </td>
    </tr>
    <tr>
        <th>
            <label for="cbxIPType">
                <%: Html.Language("IPType") %>：</label>
        </th>
        <td colspan="3">
            <select id="cbxIPType" name="IPType" class="easyui-combobox" style="width: 60px;" 
                data-options="panelHeight: 'auto',editable: false,onSelect:cbxIPTypeSelect,value:<%: Model.IPType != 0 ? Model.IPType : 2 %>">
                <option value='1'><%: Html.Language("Auto")%></option>
                <option value='2'><%: Html.Language("Manual")%></option>
            </select>        
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtLanIP">
                <%: Html.Language("LanIP") %>：</label>
        </th>
        <td>
            <input id="txtLanIP" name="LanIP" class="easyui-validatebox textbox text" validType="ip" disabled="disabled" value="<%: Model.LanIP %>" />
        </td>
        <th>
            <label for="txtLanPort">
                <%: Html.Language("LanPort") %>：</label>
        </th>
        <td>
            <input id="txtLanPort" name="LanPort" class="easyui-numberbox" disabled="disabled" value="<%: Model.LanPort %>" />
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtSubnetMask">
                <%: Html.Language("SubnetMask")%>：</label>
        </th>
        <td>
            <input id="txtSubnetMask" name="SubnetMask" class="easyui-validatebox textbox text" validType="ip" disabled="disabled" value="<%: Model.SubnetMask %>" />
        </td>
        <th>
            <label for="txtGateway">
                <%: Html.Language("Gateway")%>：</label>
        </th>
        <td>
            <input id="txtGateway" name="Gateway" class="easyui-validatebox textbox text" validType="ip" disabled="disabled" value="<%: Model.Gateway %>" />
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtDNS">
                DNS：</label>
        </th>
        <td>
            <input id="txtDNS" name="DNS" class="easyui-validatebox textbox text" validType="ip" disabled="disabled" value="<%: Model.DNS %>" />
        </td>
        <th>
            <label for="txtRemark">
                <%: Html.Language("Remark") %>：</label>
        </th>
        <td>
            <input id="txtRemark" name="Remark" class="easyui-validatebox textbox text" data-options="validType:length[0,200]" value="<%: Model.Remark %>" />
        </td>
    </tr>

    <tr>
        <th>
            <label for="txtDNS">
                FCS_location_uuid：</label>
        </th>
        <td>
            <input id="txtlocationuuid" name="FCS_locationUUID" class="textbox text" value="<%: Model.FCS_locationUUID %>" />
        </td>
    </tr>
    <%--<tr>
        <th>
            <label for="txtXiaoDuCUID">
                XiaoDu CUID：</label>
        </th>
        <td colspan="3">
            <input id="txtXiaoDuCUID" name="XiaoDuCUID" class="easyui-validatebox textbox text"
                data-options="validType:length[0,200]" value="<%: Model.XiaoDuCUID %>" placeholder="<%: Html.Language("Flag1")%>" style="width:416px;" />
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtTCLCUID">
                TCL CUID：</label>
        </th>
        <td colspan="3">
            <input id="txtTCLCUID" name="TCLCUID" class="easyui-validatebox textbox text"
                data-options="validType:length[0,200]" value="<%: Model.TCLCUID %>" placeholder="<%: Html.Language("Flag1")%>" style="width:416px;" />
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtTCLCUID">
                HuaWei CUID：</label>
        </th>
        <td colspan="3">
            <input id="txtHuaWeiCUID" name="HuaWeiCUID" class="easyui-validatebox textbox text"
                data-options="validType:length[0,200]" value="<%: Model.HuaWeiCUID %>" placeholder="<%: Html.Language("Flag1")%>" style="width:416px;" />
        </td>
    </tr>
    <tr>
        <th>
            <label for="txtRokidWebhookUrl">
                Rokid Webhook：</label>
        </th>
        <td colspan="3">
            <input id="txtRokidWebhookUrl" name="RokidWebhookUrl" class="easyui-validatebox textbox text"
                data-options="validType:length[0,200]" value="<%: Model.RokidWebhookUrl %>" style="width:416px;" />
        </td>
    </tr>--%>
</table>
</form>
<script type="">
    $(function () {
        if ($("#txtAccount").val() == "admin" || $("#txtAccount").val() == "blw") {
            $("#cbxHotels").attr("readonly", false);
        }
        else {
            $("#cbxHotels").attr("readonly", true);
        }
    });
</script>