Subversion Repositories SmartDukaan

Rev

Rev 33047 | Rev 33886 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
33045 amit.gupta 1
$(function () {
29811 tejbeer 2
 
33045 amit.gupta 3
    $(document).on('click', ".partner-credit-detail", function () {
29811 tejbeer 4
 
33045 amit.gupta 5
        loadCreditDetail("main-content");
6
    });
29811 tejbeer 7
 
8
 
33045 amit.gupta 9
    $(document).on('click', '.activate-partner-kred', function () {
10
        var row = $(this).closest("tr");
11
        var id = $(this).data('id');
12
        let gateway = $(row).find('select').val();
33047 amit.gupta 13
        if(typeof gateway==="undefined"){
14
            gateway="SDDIRECT";
15
        }
33045 amit.gupta 16
        console.log(id)
17
        if (confirm(`Are you sure you want to activate ${gateway}?`)) {
18
            doPostAjaxRequestHandler(`${context}/activateKred?id=${id}&gateway=${gateway}`,
19
                function (response) {
20
                    row.html(response);
21
                    alert(`${gateway} successfully activated`);
29811 tejbeer 22
 
23
 
33045 amit.gupta 24
                });
25
        }
26
    });
29811 tejbeer 27
 
33045 amit.gupta 28
    $(document).on('click', '.deactivate-partner-kred', function () {
29
        var row = $(this).closest("tr");
30
        var id = $(this).data('id');
33190 amit.gupta 31
        let gateway = $(row).find('select').val();
32
        if(typeof gateway==="undefined"){
33
            gateway="SDDIRECT";
34
        }
33045 amit.gupta 35
        if (confirm('Are you sure you want to deactivate?')) {
36
            doPostAjaxRequestHandler(context + "/deactivateKred?id=" + id,
37
                function (response) {
38
                    row.html(response);
39
                    alert(`${gateway} successfully deactivated`);
40
                });
41
        }
42
    });
30877 tejbeer 43
 
29811 tejbeer 44
});
45
 
46
function loadCreditDetail(domId) {
33045 amit.gupta 47
    doGetAjaxRequestHandler(context + "/getCreditDetail",
48
        function (response) {
49
            $('#' + domId).html(response);
50
        });
29811 tejbeer 51
 
30877 tejbeer 52
 
29811 tejbeer 53
}