<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RegionManage.aspx.cs" Inherits="M_Main.NewHouse.RegionManage" %>

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script type="text/javascript" src="../jscript/DateControl.js"></script>
    <script type="text/javascript" src="../jscript/JSClient.js"></script>
    <script type="text/javascript" src="../jscript/ajax.js"></script>
    <script type="text/javascript" src="../jscript/Keydown.js" event="onkeydown" for="document"></script>

    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.min.js"></script>
    <script src="../jscript/JSClient.js" type="text/javascript"></script>
    <script src="../jscript/jquery.tool.new.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/icon.css" />
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
    <link href="../css/framesearch.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../Jscript-Ui/JQForm/JQForm.js"></script>
    <script src="../jscript/Dialog.js" type="text/javascript"></script>

    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <link href="../css/framesearch_old.css" type="text/css" rel="stylesheet" />
    <link href="../css/button.css" rel="stylesheet" />
    <script src="../jscript/DateFormat.js" type="text/javascript"></script>
    <script src="../jscript/format.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Jscript-Ui/JQForm/JQForm.js"></script>

</head>
<body>
    <form id="frmForm" runat="server">
        <input id="hiOPType" type="hidden" name="hiOPType" runat="server" />
        <input id="RegionID" type="hidden" name="RegionID" runat="server" />

        <input id="hiUserName" type="hidden" name="hiUserName" runat="server" />
        <table class="DialogTable">
            <tr>
                <td class="TdTitle">序号</td>
                <td class="TdContent">
                    <input class="easyui-validatebox" data-options="prompt:'请输入数字',required:true,validType:'digital'" id="RegionSNum"
                        type="text" name="RegionSNum" runat="server">
                </td>
            </tr>
            <tr>
                <td class="TdTitle">组团区域</td>
                <td class="TdContent">
                    <input class="easyui-validatebox" data-options="required:true" id="RegionName" type="text" name="RegionName"
                        runat="server" />
                </td>
            </tr>

            <tr>
                <td class="TdTitle">管家姓名</td>
                <td class="TdContentSearch">
                    <input type="text" class="easyui-searchbox" style="width: 77%" data-options="editable:false" id="UserName" name="UserName" searcher="SelUserByRole" runat="server" />
                    <input style="width: 16px; height: 22px" id="UserCode" size="1" type="hidden" name="UserCode" runat="server">
                </td>
            </tr>
            <tr>
                <td class="TdTitle">管家电话</td>
                <td class="TdContent">
                    <input class="easyui-validatebox" id="Tel" type="text" name="Tel" runat="server" />
                </td>
            </tr>

            <tr>
                <td colspan="2" class="DialogTdSubmit">
                    <input type="button" class="button" value="保存" id="BtnSave" />
                    &nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="button" class="button" value="关闭" id="BtnReturn" />
                </td>
            </tr>
        </table>
        <script type="text/javascript">
            $("#BtnSave").click(function () {
                var cmd = $("#hiOPType").val();

                $.tool.DataPostChk('frmForm', 'Region', cmd, $('#frmForm').serialize(),
                    function Init() {
                    },
                    function callback(_Data) {
                        if (_Data == "true") {
                            parent.layer.alert('保存成功');
                            close();
                        }
                    },
                    function completeCallback() {
                    },
                    function errorCallback() {

                    });
            });
            $("#BtnReturn").click(function () {
                close();
            });

            function close() {
                HDialog.Close('');
            }

            function SelUserByRole() {

                HDialog.Open('640', '480', '../DialogNew/SelKeeper.aspx?IsCommID=1', '选择管家', false, function callback(_Data) {
                    var obj = JSON.parse(_Data);
                    var arrRet = _Data.split('\t');
                    $("#UserName").searchbox("setValue", obj.UserName);
                    $("#UserCode").val(obj.UserCode);
                    $("#Tel").val(obj.MobileTel);
                });
            }

        </script>
    </form>
</body>
</html>
