function save() {
    var error = checkValidation("");
    if (error === "") {
        var data = getJsonValue("");
        var code = getQuery("code");
        ajax({
            url: "SaleApi/" + (code === "" ? "InsertUnit" : "UpdateUnit"),
            data: data,
            success: function (result) {
                refreshParent("loadGrid()");
                showMsgModal(2, result.FinalMessage);
                closeTopModal();
            }
        });
    }
    else {
        showMsgModal(0, error);
    }
}




