﻿/// Require jQuery.js、Library.js

/// 名称: 网上预约管理
function Bespoke() {
    var prototype = this.constructor.prototype;
    if (!prototype.hasOwnProperty("_init_")) {
        prototype._init_ = true;

        // 设置预约状态
        prototype.Buy = function(author, photo, mobile, fax, email, postalcode, company, address, content, callback) {

            $.getJSON("/Bespoke/DoBuy",
			    {
			        author: author,
			        photo: photo,
			        mobile: mobile,
			        fax: fax,
			        email: email,
			        postalcode: postalcode,
			        company: company,
			        address: address,
			        content: content
			    },
			        function(data) {
			            if (data.Result == "Success") {
			                alert("创建成功!");
			            }
			            else {
			                alert("创建失败!");
			            }
			            if (!isUndefinedOrNull(callback)) callback(data.Result);
			        });
        };
    }
}