Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
28071 tejbeer 1
$(function() {
2
 
28381 tejbeer 3
	$(document).on('click', '.retail-block-brand-submit', function() {
28723 amit.gupta 4
 
5
	if(brandSelect == 1)
6
		{
7
 
28381 tejbeer 8
		var brand = $('#block-brand').val();
9
		var fofoIds = $('#selected-block-ids').val();
28723 amit.gupta 10
		console.log("fofoIds"+fofoIds);
28381 tejbeer 11
		if (confirm("Are you sure you want to submit") == true) {
12
			doPostAjaxRequestHandler(context + "/getRetailerBlockBrandMappping?brand=" + brand + "&fofoIds=" + fofoIds,
13
				function(response) {
14
					if (response = true) {
15
 
16
						alert("Successfully Submitted");
17
						$("button.block-brand-submit").click();
18
					}
19
				});
20
		}
28723 amit.gupta 21
      }
22
 
23
	else 
24
		{
25
 
26
		alert("Please click submit button of selected brand");
27
		}
28381 tejbeer 28
	});
29
 
28723 amit.gupta 30
	var brandSelect;
31
 
32
	$(document).on('change', ".brand-select", function() {
33
		brandSelect=0;
34
		console.log(brandSelect);
35
 
36
 
37
		});
38
 
28381 tejbeer 39
 
40
	$(document).on('click', '.block-brand-submit', function() {
41
 
42
		var brand = $('#block-brand').val();
28723 amit.gupta 43
       brandSelect = 1;
44
console.log(brandSelect);
28381 tejbeer 45
		doGetAjaxRequestHandler(context + "/getBlockBrand?brand=" + brand,
28071 tejbeer 46
			function(response) {
28381 tejbeer 47
				$('.partnersbyblockbrands').html(response);
28071 tejbeer 48
			});
28381 tejbeer 49
 
50
 
51
	});
52
 
53
 
54
 
55
 
56
	$(document).on('click', '.brands-limit-submit', function() {
57
 
58
		var brand = $('#show-brands').val();
59
 
60
 
61
		doGetAjaxRequestHandler(context + "/getRetailerBrandslimitMapping?brand=" + brand,
62
			function(response) {
63
				$('.partnerByBrandsLimit').html(response);
28071 tejbeer 64
			});
28381 tejbeer 65
	})
66
 
67
 
68
 
69
 
70
	$(document).on('click', '.pincode-submit', function() {
71
 
72
		var fofoId = partnerId;
73
		var pincode = $('#partnerPincode').val();
74
 
75
		console.log("pin" + pincode);
76
 
77
 
78
		doPostAjaxRequestHandler(context + "/setPartnerPincode?pincode=" + pincode + "&fofoId=" + fofoId,
28071 tejbeer 79
			function(response) {
28381 tejbeer 80
			$('.partner-pincode-container').html(response);
81
 
28071 tejbeer 82
			});
83
 
28381 tejbeer 84
	});
85
 
86
$(document).on('click', '.pincode-serach-submit', function() {
87
 
88
		var pincode = $('#searchPincode').val();
89
 
90
		console.log("pin" + pincode);
91
		doGetAjaxRequestHandler(context + "/searchPincodePartner?pincode=" + pincode,
92
			function(response) {
93
			$('.pincode-container').html(response);
94
 
95
			});
96
 
97
	});
98
 
99
	$(document).on('click', '.remove-pincode', function() {
100
     var pin = $(this).data('pin');
101
		var id = $(this).data('id');
102
        var fofoId = $(this).data('fofoid');
103
		console.log(pin);
104
		console.log(fofoId);
105
		if (confirm("Are you sure you want to remove  this pincode") == true) {
106
			doPostAjaxRequestHandler(context + "/removeSearchPincode?id=" + id + "&fofoId=" + fofoId + "&pin=" + pin,
107
				function(response) {
108
 
109
				$('.pincode-container').html(response);
110
 
111
				});
112
		}
113
			});
114
 
115
 
116
 
117
 
118
$(document).on('click', ".pincode-delete", function() {
119
 
120
 
121
		var id = $(this).data('id');
122
		var fofoId = $(this).data('fofoid');
123
		console.log(fofoId);
124
		if (confirm("Are you sure you want to remove  this pincode") == true) {
125
			doPostAjaxRequestHandler(context + "/removePartnerPincode?id=" + id + "&fofoId=" + fofoId,
126
				function(response) {
127
 
128
						$('.partner-pincode-container').html(response);
129
 
130
				});
131
		}
132
 
133
	});
134
 
28071 tejbeer 135
});