| 28300 |
tejbeer |
1 |
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
$(document).on('click', ".seller-index", function() {
|
|
|
5 |
seller("main-content")
|
|
|
6 |
|
|
|
7 |
});
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
$(document).on('click', "#newAddress", function() {
|
|
|
12 |
console.log("helo");
|
|
|
13 |
|
|
|
14 |
var newAddress = $("form#add-address-form input[name=inputnewAddAddress]").val();
|
|
|
15 |
if (newAddress == "") {
|
|
|
16 |
alert("Address is required");
|
|
|
17 |
return false;
|
|
|
18 |
}
|
|
|
19 |
var pin = $("form#add-address-form input[name=inputPin]").val();
|
|
|
20 |
if (pin == "") {
|
|
|
21 |
alert("pin is required");
|
|
|
22 |
return false;
|
|
|
23 |
}
|
|
|
24 |
var stateId = $("#stateId option:selected").val();
|
|
|
25 |
if (stateId == "") {
|
|
|
26 |
alert("pin is required");
|
|
|
27 |
return false;
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
doPostAjaxRequestHandler(context + "/createNewAddress?newAddress=" + newAddress + "&pin=" + pin + "&stateId=" + stateId, function(response) {
|
|
|
31 |
|
|
|
32 |
alert("hello");
|
|
|
33 |
seller("main-content")
|
|
|
34 |
});
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
});
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
$(document).on('click', "#newSeller", function() {
|
|
|
42 |
console.log("hello");
|
|
|
43 |
|
|
|
44 |
var label = $("form#add-seller-form input[name=inputLabel]").val();
|
|
|
45 |
if (label == "") {
|
|
|
46 |
alert("label is required");
|
|
|
47 |
return false;
|
|
|
48 |
}
|
|
|
49 |
var state = $("#state option:selected").val();
|
|
|
50 |
if (state == "") {
|
|
|
51 |
alert("label is required");
|
|
|
52 |
return false;
|
|
|
53 |
}
|
|
|
54 |
var gst = $("form#add-seller-form input[name=inputGst]").val();
|
|
|
55 |
if (gst == "") {
|
|
|
56 |
alert("label is required");
|
|
|
57 |
return false;
|
|
|
58 |
}
|
|
|
59 |
var address = $("#sellerAdddress option:selected").val();
|
|
|
60 |
if (address == "") {
|
|
|
61 |
alert("label is required");
|
|
|
62 |
return false;
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
doPostAjaxRequestHandler(context + "/createNewSeller?label=" + label + "&state=" + state + "&gst=" + gst + "&address=" + address, function(response) {
|
|
|
66 |
|
|
|
67 |
alert("hello");
|
|
|
68 |
seller("main-content")
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
});
|
|
|
72 |
|
|
|
73 |
});
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
$(document).on('click', ".seller-warehouse", function() {
|
|
|
77 |
|
|
|
78 |
var sellerId = $("#sellerWare option:selected").val();
|
|
|
79 |
|
|
|
80 |
console.log(sellerId);
|
|
|
81 |
doGetAjaxRequestHandler(context + "/getSellerWareHouse?sellerId=" + sellerId, function(response) {
|
|
|
82 |
|
|
|
83 |
$('.warehouse-container').html(response);
|
|
|
84 |
});
|
|
|
85 |
});
|
|
|
86 |
|
|
|
87 |
$(document).on('click', "#newWarehousebutton", function() {
|
|
|
88 |
|
|
|
89 |
var address = $("#addressWare option:selected").val();
|
|
|
90 |
var warehouseId = $("#warehouseId").val();
|
|
|
91 |
console.log(warehouseId);
|
|
|
92 |
var prefix = $("#prefix").val();
|
|
|
93 |
var sellerId = $("#sellerWare option:selected").val();
|
|
|
94 |
|
|
|
95 |
console.log(sellerId);
|
|
|
96 |
|
|
|
97 |
doPostAjaxRequestHandler(context + "/createNewWarehouse?address=" + address + "&prefix=" + prefix + "&warehouseId=" + warehouseId + "&sellerId=" + sellerId, function(response) {
|
|
|
98 |
seller("main-content")
|
|
|
99 |
});
|
|
|
100 |
});
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
function seller(domId) {
|
|
|
104 |
doGetAjaxRequestHandler(context + "/getAllSeller", function(response) {
|
|
|
105 |
$('#' + domId).html(response);
|
|
|
106 |
|
|
|
107 |
});
|
|
|
108 |
|
|
|
109 |
}
|