Subversion Repositories SmartDukaan

Rev

Rev 34210 | Rev 35217 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34210 Rev 34216
Line 195... Line 195...
195
 
195
 
196
 
196
 
197
});
197
});
198
 
198
 
199
$(document).on('click', '.eligible_offer_imeis_panel', function () {
199
$(document).on('click', '.eligible_offer_imeis_panel', function () {
200
    doGetAjaxRequestHandler(`${context}/blockImeisForOffer/panel`, function (response) {
200
    doGetAjaxRequestHandler(`${context}/offerEligibleImeis/panel`, function (response) {
201
        $('#main-content').html(response);
201
        $('#main-content').html(response);
202
    });
202
    });
203
    $('div.modal-backdrop.fade').remove();
203
    $('div.modal-backdrop.fade').remove();
204
 
204
 
205
 
205
 
Line 226... Line 226...
226
        return;
226
        return;
227
    }
227
    }
228
 
228
 
229
});
229
});
230
$(document).on('click', '#submit_offer_eligible_imeis', function () {
230
$(document).on('click', '#submit_offer_eligible_imeis', function () {
231
    let blockImei = $('#offer_eligible_imeis').val();
231
    let eligibleImeis = $('#offer_eligible_imeis').val();
232
    let offerId = $('#offerId').val();
232
    let offerId = $('#offerId').val();
233
    console.log("blockImei - ", blockImei);
233
    console.log("Eligible Imeeis - ", eligibleImeis);
234
    console.log("offer id - ", offerId);
234
    console.log("offer id - ", offerId);
235
    if (!blockImei) {
-
 
236
        alert("Please enter Imei");
-
 
237
        return;
-
 
238
    }
-
 
239
    if (!offerId) {
235
    if (!offerId) {
240
        alert("Please enter Offer Id");
236
        alert("Please enter Offer Id");
241
        return;
237
        return;
242
    }
238
    }
-
 
239
    if (!eligibleImeis) {
-
 
240
        alert("Please enter Imei");
-
 
241
        return;
-
 
242
    }
-
 
243
 
243
    let url = `${context}/blockImeisForOffer/create?imeis=${blockImei}&offerId=${offerId}`;
244
    let url = `${context}/offerEligibleImeis/create?imeis=${eligibleImeis}&offerId=${offerId}`;
244
    if (confirm('Are you sure to block all enter Imei numbers')) {
245
    if (confirm('Are you sure to submit')) {
245
        doPostAjaxRequestHandler(url, function (response) {
246
        doPostAjaxRequestHandler(url, function (response) {
246
            if (response) {
247
            if (response) {
247
                reloadOfferEligibleImeisList();
248
                reloadOfferEligibleImeisList();
248
                alert("submited successfully");
249
                alert("submited successfully");
249
            }
250
            }
250
        });
251
        });
251
    } else {
252
    } else {
252
        return;
253
        return;
253
    }
254
    }
254
 
-
 
255
});
255
});
256
 
256
 
257
 
257
 
258
$(document).on('click', '.scheme_imei_block_unblock_button', function () {
258
$(document).on('click', '.scheme_imei_block_unblock_button', function () {
259
    let blockedImeiId = $(this).val();
259
    let blockedImeiId = $(this).val();
Line 267... Line 267...
267
});
267
});
268
 
268
 
269
$(document).on('click', '.offer_eligible_imeis_EligibilityChange_button', function () {
269
$(document).on('click', '.offer_eligible_imeis_EligibilityChange_button', function () {
270
    let blockedImeiId = $(this).val();
270
    let blockedImeiId = $(this).val();
271
    if (confirm("Are you sure to change status")) {
271
    if (confirm("Are you sure to change status")) {
272
        doPutAjaxRequestHandler(`${context}/blockImeisForOffer/changeStatus?id=${blockedImeiId}`, function (response) {
272
        doPutAjaxRequestHandler(`${context}/offerEligibleImeis/changeStatus?id=${blockedImeiId}`, function (response) {
273
            reloadOfferEligibleImeisList();
273
            reloadOfferEligibleImeisList();
274
            alert("Status changed successfully");
274
            alert("Status changed successfully");
275
        });
275
        });
276
    } else {
276
    } else {
277
        return;
277
        return;
Line 293... Line 293...
293
 
293
 
294
});
294
});
295
$(document).on('click', '.offer_eligible_imei_remove_button', function () {
295
$(document).on('click', '.offer_eligible_imei_remove_button', function () {
296
    let offerId = $(this).val();
296
    let offerId = $(this).val();
297
    if (confirm("Are you sure to remove")) {
297
    if (confirm("Are you sure to remove")) {
298
        doDeleteAjaxRequestHandler(`${context}/blockImeisForOffer/deleteByOfferId?offerId=${offerId}`, function (response) {
298
        doDeleteAjaxRequestHandler(`${context}/offerEligibleImeis/deleteByOfferId?offerId=${offerId}`, function (response) {
299
            if (response) {
299
            if (response) {
300
                reloadOfferEligibleImeisList();
300
                reloadOfferEligibleImeisList();
301
                alert("Removed successfully");
301
                alert("Removed successfully");
302
            }
302
            }
303
        });
303
        });
Line 325... Line 325...
325
        $('#scheme_blocked_imeis_div').html(response);
325
        $('#scheme_blocked_imeis_div').html(response);
326
    });
326
    });
327
}
327
}
328
 
328
 
329
function reloadOfferEligibleImeisList() {
329
function reloadOfferEligibleImeisList() {
330
    doGetAjaxRequestHandler(`${context}/blockImeisForOffer/allList`, function (response) {
330
    doGetAjaxRequestHandler(`${context}/offerEligibleImeis/allList`, function (response) {
331
        $('#offer_eligible_imeis_div').empty();
331
        $('#offer_eligible_imeis_div').empty();
332
        $('#offer_eligible_imeis_div').html(response);
332
        $('#offer_eligible_imeis_div').html(response);
333
 
333
 
334
    });
334
    });
335
}
335
}