﻿function MountChange() {
    $("input[id$='tt_price']").val(0);
    $("input[id$='tt_time']").val(0);
    AjaxMethodPL.GetMarkPriceInfo
    (
        parseInt($("input[id$='hdServiceConfigID']").val()),
        parseInt($("select[id$='DDL_Mount'] option:selected").val()),
        function (result) {
            if (null == result.error) {
                if (result.value != null) {
                    var princeInfo = eval(result.value);
                    $("span[mark='currencyMark']").text(princeInfo.CurrencyMark);
                    $("input[id$='tt_price']").val(princeInfo.Amount);
                    $("input[id$='tt_time']").val(princeInfo.Days);
                }
            }
        }
    )
}

function MarkChange() {
    AjaxMethodPL.GetMountInfo
    (
        parseInt($("input[id$='hdServiceConfigID']").val()),
        parseInt($("select[id$='DDL_TypeOfMark'] option:selected").val()),
        function (result) {
            if (null == result.error) {
                if (result.value != null) {
                    var dt = result.value;
                    var sel_Mount = $("select[id$='DDL_Mount']")[0];
                    sel_Mount.options.length = 0;
                    for (i = 0; i < dt.Rows.length; i++) {
                        sel_Mount.options.add(new Option(dt.Rows[i].GearsName, dt.Rows[i].GearsID));
                    }
                }
            }
            MountChange();
        }
    )
}

function Add() {
    AjaxMethodPL.AddMarkOrder
    (
        parseInt($("input[id$='hdServiceConfigID']").val()),
        parseInt($("select[id$='DDL_TypeOfMark'] option:selected").val()),
        parseInt($("select[id$='DDL_Mount'] option:selected").val()),
        function (result) {
            //函数在common文件里
            AddTemp_CallBack(result);
        }
    )
}
