function save() {
    var data = getJsonValue("");
    var error = checkValidation('');
    var code = getQuery("code");
    if (error === '') {
        ajax({
            loading: true,
            url: "GeneralApi/" + (code ? "UpdateCurrency" : "InsertCurrency"),
            data: { currency: data },
            success: function (result) {
                if (data.IsBaseCurrency) {
                    window.top.rial = data.Name;
                    window.top.$("#hfBaseCurrencyName").val(data.Name);
                }
                showMsgModal(2, window.top.savedSuccessfully);
                refreshParent('loadGrid();');
                closeTopModal();
            }
        });
    }
    else {
        showMsgModal(0, error);
    }
}

