Subversion Repositories SmartDukaan

Rev

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