Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
24317 govind 1
$(function() {
27754 amit.gupta 2
	$(document).on('click', ".create-service", function() {
24317 govind 3
		loadService("main-content");
4
	});
27754 amit.gupta 5
	$(document).on('click', ".add-brand", function() {
24317 govind 6
		loadaddBrandToService("main-content");
7
	});
8
 
27755 amit.gupta 9
	$(document).on('click', ".notApplicableService",
24317 govind 10
			function() {
11
				naCommentService = $(this).data('nacommentservice');
12
				console.log(naCommentService);
13
				var dialog = bootbox.dialog({
14
					message : "<h4 style='color:red'>NOTAPPLICABLE</h4><p>"
15
							+ naCommentService + "</p>",
16
					closeButton : true
17
				});
18
				dialog.modal('show');
19
 
20
			});
27755 amit.gupta 21
	$(document).on('click', ".notApplicableBrandService",
24317 govind 22
			function() {
23
				naCommentService = $(this).data('nacommentservice');
24
				console.log(naCommentService);
25
				var dialog = bootbox.dialog({
26
					message : "<h4 style='color:red'>NOTAPPLICABLE</h4><p>"
27
							+ naCommentService + "</p>",
28
					closeButton : true
29
				});
30
				dialog.modal('show');
31
 
32
			});
27754 amit.gupta 33
	$(document).on('click', ".add-brand", function() {
24317 govind 34
		loadaddBrandToService("main-content");
35
	});
28830 amit.gupta 36
 
37
	$(document).on('click', ".markNA", function() {
38
		let fofoId = $('#partnerName').val();
39
		let serviceId = $(this).data("serviceid");
40
		bootbox.dialog({
41
			title : "Mark Not Applicable!",
42
			message : "<div class=form-inline'>"
43
					+ "<label for='code'>Not Applicable Reason:</label>"
44
					+ "<input class='form-control' type='text' id='naText'/>"
45
					+ "</div>",
46
			buttons : {
47
				cancel : {
48
					label : "CANCEL",
49
					className : 'btn-danger',
50
					callback : function() {
51
						return;
52
					}
53
				},
54
				ok : {
55
					label : "OK",
56
					className : 'btn-info',
57
					callback : function() {
58
						naText = $('#naText').val();
59
						if(naText==""||naText==undefined||naText==null){
60
								alert("NA text can't be empty");
61
								return;
62
							}
63
						var params = {
64
								"serviceId" : serviceId,
65
								"fofoId" : fofoId,
66
								"naText":naText
67
							}
68
							doPostAjaxRequestWithJsonHandler(context + "/partnerservice/applicable",
69
									JSON.stringify(params), function(response) {
70
										alert("Successfully Marked NA");
71
										loadAdminPartnerService("main-content", fofoId);
72
									});
73
					}
74
				}
75
			}
76
		});
77
	});
78
	$(document).on('click', ".markApplicable", function() {
79
		let serviceId = $(this).data("serviceid");
80
		if(confirm("Confirm?")) {
81
		let fofoId = $('#partnerName').val();
82
			var params = {
83
				"serviceId" : serviceId,
84
				"fofoId" : fofoId,
85
				"naText":null
86
			}
87
			doPostAjaxRequestWithJsonHandler(context + "/partnerservice/applicable", JSON.stringify(params), function(response) {
88
				alert("successfully Marked Applicable");
89
				loadAdminPartnerService("main-content", fofoId);
90
			});
91
 
92
		}
93
	});
94
 
27755 amit.gupta 95
	$(document).on('click', ".add-service-details-for-partner",
24317 govind 96
			function() {
97
				fofoId = $("#partnerName").val();
98
				serviceId = $("#serviceName").val();
99
				applicableType = $("#applicableService").val();
100
				code = $("#code").val();
101
				partnerStatus = $("#partnerStatusTypeServices").val();
102
				na_comment = $("#na_comment_services").val();
103
				partnerCommentStatus = $("#partner_comment_status").val();
104
				 if (applicableType == "" || applicableType == null
105
							|| applicableType == undefined) {
106
						alert("select appropriate applicableType");
107
				 }
108
				 else if (applicableType == 'NO') {
109
					if (na_comment == "" || na_comment == undefined) {
110
						alert("Na_comment can't be empty");
111
						return;
112
					}
113
					if (fofoId == "" || fofoId == null || fofoId == undefined) {
114
						alert("select appropriate partnerName");
115
						return;
116
					}
117
					 if (serviceId == "" || serviceId == null
118
								|| serviceId == undefined) {
119
							alert("select appropriate serviceName");
120
							return;
121
					 }
122
				}
123
				 else
124
					 {
125
						if (fofoId == "" || fofoId == null || fofoId == undefined) {
126
							alert("select appropriate partnerName");
127
							return;
128
						}
129
						 if (serviceId == "" || serviceId == null
130
									|| serviceId == undefined) {
131
								alert("select appropriate serviceName");
132
								return;
133
						 }
134
				 if (code == "" || code == null
135
						|| code == undefined) {
136
					alert("enter appropriate code")
137
					return;
138
				} 
139
					 }
140
				 console.log(fofoId, serviceId, applicableType, code,
141
							partnerStatus);
142
					addPartnerServiceDetails(fofoId, serviceId, applicableType,
143
							code, partnerStatus, na_comment,
144
							partnerCommentStatus);
145
 
146
			});
27755 amit.gupta 147
	$(document).on('click', ".add-brand-service-details-for-partner",
24317 govind 148
			function() {
149
				fofoId = $("#partnerName").val();
150
				serviceId = $("#serviceName").val();
151
				serviceBrandId = $("#serviceBrandName").val();
152
				applicableType = $("#applicableService").val();
153
				active = $("#activeServiceBrand").val();
154
				partnerStatus = $("#partnerStatusTypeServices").val();
155
				na_comment = $("#na_comment_services").val();
156
				partnerCommentStatus = $("#partner_comment_status").val();
157
				if (applicableType == "NO") {
158
					if (na_comment == "" || na_comment == undefined) {
159
						alert("Na_comment can't be empty");
160
						return;
161
					}
162
				} 
163
				if (fofoId == "" || fofoId == null || fofoId == undefined) {
164
					alert("select appropriate partnerName");
165
					return;
166
				} else if (serviceBrandId == "" || serviceBrandId == null
167
						|| serviceBrandId == undefined) {
168
					alert("select appropriate serviceBrandId");
169
					return;
170
				} else if (applicableType == "" || applicableType == null
171
						|| applicableType == undefined) {
172
					alert("select appropriate applicableType");
173
				} else if (active == "" || active == null
174
						|| active == undefined) {
175
					alert("select appropriate active")
176
				} else if (partnerStatus == "" || partnerStatus == null
177
						|| partnerStatus == undefined) {
178
					alert("select appropriate partnerStatus");
179
				} else {
180
					console.log(fofoId, serviceBrandId, applicableType, active,
181
							partnerStatus);
182
					addPartnerServiceBrandDetails(fofoId, serviceId,
183
							serviceBrandId, applicableType, active,
184
							partnerStatus, na_comment, partnerCommentStatus);
185
				}
186
			});
27754 amit.gupta 187
	$(document).on('click', ".partner-service", function() {
24317 govind 188
		loadpartnerService("main-content");
189
	});
27754 amit.gupta 190
	$(document).on('click', ".admin-partner-service", function() {
24317 govind 191
		loadAdminPartnerService("main-content", 0);
192
	});
28757 amit.gupta 193
 
194
	$(document).on('click', ".partner-finance-services", function(){
195
	  showFinanceServices("main-content");
196
 
197
	});
198
 
27754 amit.gupta 199
	$(document).on('click', ".add-partner-service-details", function() {
24317 govind 200
		loadaddPartnerServiceDetails("main-content");
201
	});
27754 amit.gupta 202
	$(document).on('click', ".add-partner-brand-service-details", function() {
24317 govind 203
		loadaddPartnerBrandServiceDetails("main-content");
204
	});
27754 amit.gupta 205
	$(document).on('click', ".activate-service", function() {
24317 govind 206
		serviceId = $(this).data('serviceid');
207
		fofoId = $("#partnerName").val();
208
		console.log(fofoId);
209
		console.log(serviceId);
210
		activatePartnerService(fofoId, serviceId);
211
	});
27754 amit.gupta 212
	$(document).on('click', ".deactivate-service", function() {
24317 govind 213
		serviceId = $(this).data('serviceid');
214
		fofoId = $("#partnerName").val();
215
		console.log(fofoId);
216
		console.log(serviceId);
217
		deActivatePartnerService(fofoId, serviceId);
218
	});
27754 amit.gupta 219
	$(document).on('click', ".activate-brand-service", function() {
24317 govind 220
		console.log("activate-brand-service clicked");
221
		serviceId = $(this).data('serviceid');
222
		fofoId = $("#partnerName").val();
223
		serviceBrandId = $(this).data('servicebrandid');
224
		console.log(fofoId);
225
		console.log(serviceId);
226
		console.log(serviceBrandId);
227
		activatePartnerBrandService(fofoId, serviceId, serviceBrandId);
228
 
229
	});
27754 amit.gupta 230
	$(document).on('click', ".deactivate-brand-service", function() {
24317 govind 231
		console.log("activate-brand-service clicked");
232
		serviceId = $(this).data('serviceid');
233
		fofoId = $("#partnerName").val();
234
		serviceBrandId = $(this).data('servicebrandid');
235
		console.log(fofoId);
236
		console.log(serviceId);
237
		console.log(serviceBrandId);
238
		deActivatePartnerBrandService(fofoId, serviceId, serviceBrandId);
239
 
240
	});
241
 
27755 amit.gupta 242
	$(document).on('click', ".create-service-button",
24317 govind 243
					function() {
244
						console.log("create-service-button clicked");
245
						var serviceName = $('#createserviceName').val();
246
						if (serviceName === "" || serviceName === undefined
247
								|| serviceName == null) {
248
							alert("Input field can't be empty");
249
							return;
250
						}
251
						if (confirm("Are you sure you want to create Service!") == true) {
252
							createService("main-content", serviceName);
253
						}
254
					});
27755 amit.gupta 255
	$(document).on('click', ".partner-service-search-button",
24317 govind 256
			function() {
257
				var fofoId = $('#partnerName').val();
258
				if (fofoId === "" || fofoId === undefined || fofoId == null) {
259
					alert("select appropriate partner");
260
					return;
261
				}
262
				doGetAjaxRequestHandler(context + "/getPartnerServices?fofoId="
263
						+ fofoId, function(response) {
264
					$('#' + "partnerServicesByID").html(response);
265
				});
266
			});
27755 amit.gupta 267
	$(document).on('click', "#remove-added-brand-button",
24317 govind 268
					function() {
269
						var serviceId = $(this).data('id');
270
						var brand = $(this).data('brand');
271
						console.log(serviceId);
272
						console.log(brand)
273
						if (confirm("Are you sure you want to remove brand from Service!") == true) {
274
							removeBrandFromService("main-content", serviceId,
275
									brand);
276
						}
277
					});
27754 amit.gupta 278
	$(document).on('click', ".service-brand-button", function() {
24317 govind 279
		var brands = $('#tag-listing-brands').val();
280
		var serviceId = $('#serviceName').val();
281
		console.log(brands);
282
		console.log(serviceId);
283
		if (serviceId === "" || serviceId === undefined) {
284
			alert("service not selected");
285
			return;
286
		}
287
		if (!brands) {
288
			alert("select brand");
289
			return;
290
		}
291
		if (confirm("Are you sure you want to add brand!") == true) {
292
			addBrandToService("main-content", brands, serviceId);
293
		}
294
	});
27754 amit.gupta 295
	$(document).on('change', '#serviceName', function() {
24317 govind 296
		// $('#tag-listing-brand-value').text($(this).text());
297
		loadBrandsByServiceId("service-container", $(this).val());
298
		loadaddedBrandsbyserviceId("added-brand-to-service", $(this).val())
299
	});
300
});
301
 
302
function addPartnerServiceDetails(fofoId, serviceId, applicableType, code,
303
		partnerStatus, na_comment, partnerCommentStatus) {
304
	if (confirm("Are you sure you want to add services details!") == true) {
305
		var params = {
306
			"serviceId" : serviceId,
307
			"fofoId" : fofoId,
308
			"applicableType" : applicableType,
309
			"partnerStatus" : partnerStatus,
310
			"na_comment" : na_comment,
311
			"partnerCommentStatus" : partnerCommentStatus,
312
			"code" : code
313
		}
314
		doPostAjaxRequestWithParamsHandler(context
315
				+ "/addPartnerServicesDetails", params, function(response) {
316
			if (response == "true") {
317
				alert("successfully added partner Service Details");
318
				loadaddPartnerServiceDetails("main-content");
319
			}
320
		});
321
	}
322
}
323
function addPartnerServiceBrandDetails(fofoId, serviceId, serviceBrandId,
324
		applicableType, active, partnerStatus, na_comment,
325
		partnerCommentStatus, code) {
326
	if (confirm("Are you sure you want to add service brand details!") == true) {
327
		var params = {
328
			"serviceId" : serviceId,
329
			"serviceBrandId" : serviceBrandId,
330
			"fofoId" : fofoId,
331
			"applicableType" : applicableType,
332
			"active" : active,
333
			"partnerStatus" : partnerStatus,
334
			"na_comment" : na_comment,
335
			"partnerCommentStatus" : partnerCommentStatus,
336
 
337
		}
338
		doPostAjaxRequestWithParamsHandler(context
339
				+ "/addPartnerServiceBrandDetails", params, function(response) {
340
			if (response == "true") {
341
				alert("successfully added partner Service Brand Details");
342
				loadaddPartnerBrandServiceDetails("main-content");
343
			}
344
		});
345
	}
346
}
347
function configureBrandsDropDown() {
348
	$(document).ready(function() {
349
		$('#tag-listing-brands').multiselect({
350
			includeSelectAllOption : true,
351
			multiple : true,
352
			maxHeight : 200,
353
			buttonWidth : '180px',
354
			numberDisplayed : 1,
355
			nonSelectedText : 'Brands',
356
			nSelectedText : ' - Brands Selected',
357
			allSelectedText : 'All Brands Selected',
358
			enableFiltering : true,
359
			enableCaseInsensitiveFiltering : true
360
		});
361
	});
362
}
363
 
364
function loadService(domId) {
365
	doGetAjaxRequestHandler(context + "/getcreateService", function(response) {
366
		$('#' + domId).html(response);
367
	});
368
}
369
function loadaddedBrandsbyserviceId(domId, serviceId) {
370
	doGetAjaxRequestHandler(context + "/getAddedbrands?serviceId=" + serviceId,
371
			function(response) {
372
				$('#' + domId).html(response);
373
			});
374
}
375
function loadBrandsByServiceId(domId, serviceId) {
376
	doGetAjaxRequestHandler(context + "/getbrands?serviceId=" + serviceId,
377
			function(response) {
378
				$('#' + domId).html(response);
379
				configureBrandsDropDown();
380
			});
381
 
382
}
383
function createService(domId, serviceName) {
384
	console.log(serviceName);
385
	doPostAjaxRequestHandler(context + "/createService?serviceName="
386
			+ serviceName, function(response) {
387
		alert("Service Successfully Created");
388
		$('#' + domId).html(response);
389
	});
390
}
391
function loadaddBrandToService(domId) {
392
	doGetAjaxRequestHandler(context + "/addBrandsToService",
393
			function(response) {
394
				$('#' + domId).html(response);
395
			});
396
}
397
function addBrandToService(domId, brands, serviceId) {
398
	doPostAjaxRequestWithJsonHandler(context + "/addBrandsService?serviceId="
399
			+ serviceId, JSON.stringify(brands), function(response) {
400
		alert("Brands added successfully");
401
		loadBrandsByServiceId("service-container", serviceId);
402
		loadaddedBrandsbyserviceId("added-brand-to-service", serviceId)
403
		$('#' + domId).html(response);
404
	});
405
}
406
function removeBrandFromService(domId, serviceId, brand) {
407
 
408
	doDeleteAjaxRequestHandler(context + "/removeBrandfromService?serviceId="
409
			+ serviceId + "&brand=" + brand, function(response) {
410
		alert("Brand removed from service successfully");
411
		loadBrandsByServiceId("service-container", serviceId);
412
		loadaddedBrandsbyserviceId("added-brand-to-service", serviceId)
413
		$('#' + domId).html(response);
414
	});
415
}
28757 amit.gupta 416
function showFinanceServices(domId) {
417
	doGetAjaxRequestHandler(context + "/getFinanceServicesAllPartner", function(response) {
418
 
419
		$('#' + domId).html(response);
420
	});
421
}
422
 
423
 
424
 
425
 
24317 govind 426
function changeServices(partnerServiceId) {
427
	var serviceId = partnerServiceId.value;
428
	var fofoId = $("#partnerName").val();
429
	console.log(fofoId);
430
	console.log(serviceId);
431
	if (fofoId == "" || fofoId == 0 || fofoId == undefined) {
432
		var dialog = bootbox
433
				.dialog({
434
					title : "Are you sure want to change state of service!",
435
					message : "<div class=form-inline'>"
436
							+ "<label for='reason'>Reason:</label>"
437
							+ "<textarea class='form-control' rows='1' id='reason'></textarea>"
438
							+ "</div>",
439
					buttons : {
440
						cancel : {
441
							label : "cancel",
442
							className : 'btn-danger',
443
							callback : function() {
444
								loadpartnerService("main-content");
445
							}
446
						},
447
						ok : {
448
							label : "ok",
449
							className : 'btn-info',
450
							callback : function() {
451
								partnerStatusComment = $('#reason').val();
452
								console.log(partnerStatusComment);
453
								var params = {
454
									"serviceId" : serviceId,
455
									"partnerStatusComment" : partnerStatusComment
456
								}
457
								doPostAjaxRequestWithParamsHandler(
458
										context + "/changeStatePartnerService",
459
										params,
460
										function(response) {
461
											if (response == "true") {
462
												alert("successfully changed");
463
												loadpartnerService("main-content");
464
											}
465
										});
466
 
467
							}
468
						}
469
					}
470
				});
471
 
472
	} else {
473
		if (confirm("Are you sure you want to change!") == true) {
474
			var params = {
475
				"serviceId" : serviceId,
476
				"fofoId" : fofoId
477
 
478
			}
479
			doPostAjaxRequestWithParamsHandler(context
480
					+ "/changeStatePartnerService", params, function(response) {
481
				if (response == "true") {
482
					alert("successfully changed");
483
					loadAdminPartnerService("main-content", fofoId);
484
				}
485
			});
486
		}
487
		else
488
			{
489
			loadAdminPartnerService("main-content", fofoId);			
490
			}
491
	}
492
}
493
function changeServiceNameForServiceBrand() {
494
 
495
	serviceId = $("#serviceName").val();
496
	console.log(serviceId);
497
	doGetAjaxRequestHandler(context + "/selectAddedbrands?serviceId="
498
			+ serviceId, function(response) {
499
		$('#' + "serviceBrandNameContainer").html(response);
500
	});
501
}
502
function configureAllPartnerName() {
503
	$(document).ready(function() {
504
		$('#partnerName').multiselect({
505
			includeSelectAllOption : true,
506
			maxHeight : 200,
507
			buttonWidth : '200px',
508
			numberDisplayed : 1,
509
			nonSelectedText : 'Partners',
510
			nSelectedText : ' - Partners Selected',
511
			allSelectedText : 'All Partners Selected',
512
			enableFiltering : true,
513
			enableCaseInsensitiveFiltering : true
514
 
515
		});
516
	});
517
}
28757 amit.gupta 518
 
519
 
520
 
521
 
522
 
523
 
524
function onChangeStateServiceBrand(partnerServiceBrandId, partnerServiceId,brand) {
525
 
526
 
527
	console.log(brand);
528
 
24317 govind 529
	var brandServiceId = partnerServiceBrandId.value;
530
	var fofoId = $("#partnerName").val();
531
	console.log(brandServiceId, partnerServiceId);
532
	if (fofoId == "" || fofoId == 0 || fofoId == undefined) {
533
		var dialog = bootbox
534
				.dialog({
535
					title : "Are you sure want to change state of service!",
536
					message : "<div class=form-inline'>"
537
							+ "<label for='reason'>Reason:</label>"
538
							+ "<textarea class='form-control' rows='1' id='reason'></textarea>"
539
							+ "</div>",
540
					buttons : {
541
						cancel : {
542
							label : "cancel",
543
							className : 'btn-danger',
544
							callback : function() {
545
								loadpartnerService("main-content");
546
							}
547
						},
548
						ok : {
549
							label : "ok",
550
							className : 'btn-info',
551
							callback : function() {
552
								partnerStatusComment = $('#reason').val();
553
								console.log(partnerStatusComment);
554
								var params = {
28757 amit.gupta 555
									"brand":brand,
24317 govind 556
									"brandServiceId" : brandServiceId,
557
									"serviceId" : partnerServiceId,
558
									"partnerStatusComment" : partnerStatusComment
559
								}
560
								doPostAjaxRequestWithParamsHandler(
561
										context
562
												+ "/changeStatePartnerServiceBrand",
563
										params,
564
										function(response) {
565
											if (response == "true") {
566
												alert("successfully changed");
567
												loadpartnerService("main-content");
568
											}
569
 
570
										});
571
 
572
							}
573
						}
574
					}
575
				});
576
	} else {
577
		if (confirm("Are you sure you want to change!") == true) {
578
 
579
			var params = {
580
				"brandServiceId" : brandServiceId,
28757 amit.gupta 581
				"brand":brand,
24317 govind 582
				"serviceId" : partnerServiceId,
583
				"fofoId" : fofoId
28757 amit.gupta 584
 
585
					}
24317 govind 586
			doPostAjaxRequestWithParamsHandler(context
587
					+ "/changeStatePartnerServiceBrand", params, function(
588
					response) {
589
				if (response == "true") {
590
					alert("successfully changed");
591
					loadAdminPartnerService("main-content", fofoId);
592
				}
593
			});
594
 
595
		} else {
28757 amit.gupta 596
 
24317 govind 597
			loadAdminPartnerService("main-content", fofoId);
598
		}
599
	}
600
}
601
function loadpartnerService(domId) {
602
	doGetAjaxRequestHandler(context + "/getPartnerServices",
603
			function(response) {
604
				$('#' + domId).html(response);
605
			});
606
 
607
}
608
function loadAdminPartnerService(domId, fofoId) {
609
	doGetAjaxRequestHandler(context
610
			+ "/getAdminPanelForPartnerServices?fofoId=" + fofoId, function(
611
			response) {
612
		$('#' + domId).html(response);
613
		if (fofoId != 0 || fofoId) {
614
			doGetAjaxRequestHandler(context + "/getPartnerServices?fofoId="
615
					+ fofoId, function(response) {
616
				$('#' + "partnerServicesByID").html(response);
617
			});
618
		}
619
 
620
	});
621
}
622
function activatePartnerService(fofoId, serviceId) {
623
	console.log(fofoId);
28830 amit.gupta 624
	bootbox.dialog({
24317 govind 625
		title : "Are you sure you want to activate services!",
626
		message : "<div class=form-inline'>"
627
				+ "<label for='code'>Code:</label>"
628
				+ "<input class='form-control' type='text' id='code'/>"
629
				+ "</div>",
630
		buttons : {
631
			cancel : {
632
				label : "cancel",
633
				className : 'btn-danger',
634
				callback : function() {
28830 amit.gupta 635
					return;
24317 govind 636
				}
637
			},
638
			ok : {
639
				label : "ok",
640
				className : 'btn-info',
641
				callback : function() {
642
					code = $('#code').val();
643
					//console.log(partnerStatusComment);
644
					if(code==""||code==undefined||code==null)
645
						{
646
							alert("code can't be empty");
647
							activatePartnerService(fofoId, serviceId);
648
							return;
649
						}
650
					var params = {
651
							"serviceId" : serviceId,
652
							"fofoId" : fofoId,
653
							"code":code
654
						}
655
						doPostAjaxRequestWithParamsHandler(context + "/activatePartnerService",
656
								params, function(response) {
657
									if (response == "true") {
658
										alert("successfully activate");
659
										loadAdminPartnerService("main-content", fofoId);
660
									}
661
								});
662
				}
663
			}
664
		}
665
	});
666
}
667
function deActivatePartnerService(fofoId, serviceId) {
668
	if (confirm("Are you sure you want to deactivate services!") == true) {
669
		var params = {
670
			"serviceId" : serviceId,
671
			"fofoId" : fofoId
672
 
673
		}
674
		doPostAjaxRequestWithParamsHandler(context
675
				+ "/deActivatePartnerService", params, function(response) {
676
			if (response == "true") {
677
				alert("successfully deactivate");
678
				loadAdminPartnerService("main-content", fofoId);
679
			}
680
		});
681
	}
682
}
683
function activatePartnerBrandService(fofoId, serviceId, serviceBrandId) {
684
	if (confirm("Are you sure you want to activate brand service!") == true) {
685
		var params = {
686
			"serviceId" : serviceId,
687
			"fofoId" : fofoId,
688
			"serviceBrandId" : serviceBrandId
689
 
690
		}
691
		doPostAjaxRequestWithParamsHandler(context
692
				+ "/activatePartnerbrandService", params, function(response) {
693
			if (response == "true") {
694
				alert("successfully activate");
695
				loadAdminPartnerService("main-content", fofoId);
696
			}
697
		});
698
	}
699
}
700
function deActivatePartnerBrandService(fofoId, serviceId, serviceBrandId) {
701
	if (confirm("Are you sure you want to deactivate brand service!") == true) {
702
		var params = {
703
			"serviceId" : serviceId,
704
			"fofoId" : fofoId,
705
			"serviceBrandId" : serviceBrandId
706
 
707
		}
708
		doPostAjaxRequestWithParamsHandler(context
709
				+ "/deActivatePartnerbrandService", params, function(response) {
710
			if (response == "true") {
711
				alert("successfully deactivate");
712
				loadAdminPartnerService("main-content", fofoId);
713
			}
714
		});
715
	}
716
}
717
 
718
function loadaddPartnerServiceDetails(domId) {
719
	doGetAjaxRequestHandler(context + "/getAddPartnerServicesDetails",
720
			function(response) {
721
				$('#' + domId).html(response);
722
			});
723
}
724
function loadaddPartnerBrandServiceDetails(domId) {
725
	doGetAjaxRequestHandler(context + "/getAddPartnerBrandServiceDetails",
726
			function(response) {
727
				$('#' + domId).html(response);
728
			});
729
}