﻿function updateMiniCart(performAction, object, containername) {

    var pagePath = baseURL + "AjaxServices.asmx";

    $.ajax({
        type: "POST",
        url: pagePath + "/RenderMiniCart",
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify({ controlPath: "minicart", action: performAction,
            compnayId: object.getAttribute("companyid")
        }),
        dataType: "json",
        success: function(result) {
            if (result.d.Error) {
                $("#firstEnquirySessionInformation").ShowErrorPopup(
                    {
                        ErrorText: result.d.ErrorMessage,
                        ErrorTitle: result.d.ErrorTitle
                    }
                );
            } else {
                $('.' + containername).html(result.d.MiniCartRenderedHtml);
            }
        },
        error: function(msg) {
            debugger;
            alert("error:" + msg);
        }
    });
}
