<%@ page language="C#" autoeventwireup="true" inherits="User_RestAddCollect, DoodiiShop" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<!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 runat="server">
    <title>推荐熟悉的餐馆</title>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript">
        var saveForm = function() {
            var Name = $("#tbName").val();
            var Phone = $("#tbPhone").val();
            var Principal = $("#tbPrincipal").val();
            var Address = $("#tbAddress").val();
            var DeliverInfoId = ($("#rdoDeliverInfo0").attr("checked"))?0:1;
            var LinkInfoId = ($("#rdoLinkInfo0").attr("checked"))?0:1;
            if ( $.trim(Name) == "" || $.trim(Address) == "" ) {
                alert("请填写餐馆名称及地址！");
                return;
            }
            var ret = User_RestAddCollect.AddRestCollect( Name, Phone, Principal
                , Address, DeliverInfoId, LinkInfoId ).value;
            if ( ret == "0" ) {
                alert("信息提交已成功，请等待豆丁验证！");
                window.close();
            } else {
                alert("发生错误:" + ret);
            }
        }
    </script>
    <style type="text/css">
        body {
            font-size:12px;
        }
        input {
            font-size:12px;
        }
        select {
            font-size:12px;
            width:260px;
        }
        .MyTable {
            background-color:#ccc;
        }
        .MyTable td {
            padding:5px;
            background-color:#fff;
        }
        .tr{text-align:right; }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <span>推荐您熟悉的餐馆，（<span style="color:#F00;">*</span>）为必填项。</span>
        <table class="MyTable" cellpadding="1" cellspacing="1" width="400px">
            <tr>
                <td class="tr"><span style="color:#F00;">*</span>餐馆名称：</td>
                <td>
                    <input id="tbName" type="text" style="width:250px" maxlength="40" />
                </td>
            </tr>
            <tr>
                <td class="tr">餐馆电话：</td>
                <td><input id="tbPhone" type="text" style="width:250px" maxlength="20" /></td>
            </tr>
            <tr>
                <td class="tr">餐馆负责人：</td>
                <td><input id="tbPrincipal" type="text" style="width:250px" maxlength="20" /></td>
            </tr>
            <tr>
                <td class="tr"><span style="color:#F00;">*</span>餐馆地址：</td>
                <td>
                    <input id="tbAddress" type="text" style="width:250px" maxlength="50" />
                </td>
            </tr>
            <tr>
                <td class="tr">外卖方式：</td>
                <td>
                    <input id="rdoDeliverInfo0" name="rdoDeliverInfo" type="radio" checked="checked" />
                    <span>外卖</span>
                    <input id="rdoDeliverInfo1" name="rdoDeliverInfo" type="radio" />
                    <span>不外卖</span>
                </td>
            </tr>
            <tr>
                <td class="tr">连锁信息：</td>
                <td>
                    <input id="rdoLinkInfo0" name="rdoLinkInfo" type="radio" checked="checked" />
                    <span>连锁</span>
                    <input id="rdoLinkInfo1" name="rdoLinkInfo" type="radio" />
                    <span>不连锁</span>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align:center;">
                    <input id="btnSubmit" type="button"  value="提交" onclick="saveForm()" />
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
