Commit 1956e38441544c9adde7434fe6d4aa93d303ef82
1 parent
83d88e5798
Exists in
master
handle errors
Showing
7 changed files
with
92 additions
and
17 deletions
Show diff stats
app/views/fbo-admin/dashboard.controller.js
... | ... | @@ -37,7 +37,9 @@ |
37 | 37 | console.log($scope.user) |
38 | 38 | var formdata = "companyName=" + $scope.user.companyName + "&email=" + $scope.user.email + "&username=" + $scope.user.username + "&firstName=" + $scope.user.firstName + "&lastName=" + $scope.user.lastName + "&password=" + $scope.user.password + "&phone=" + $scope.user.phone + "&mobile=" + $scope.user.mobile + "&status=" + $scope.user.status + "&userType=" + $scope.user.userType + "&clientNote=" + $scope.user.clientNote; |
39 | 39 | FBOAdmin.registerUser(formdata).then(function(result) { |
40 | - | |
40 | + toastr.success('Created Successfully', { | |
41 | + closeButton: true | |
42 | + }) | |
41 | 43 | $scope.feature.accountId = result; |
42 | 44 | var featureControlData = "accountId=" + $scope.feature.accountId + "&level=" + $scope.feature.level + "&essintaPosSystem=" + $scope.feature.essintaPosSystem |
43 | 45 | + "&acuQuote=" + $scope.feature.acuQuote + "&acuTrack=" + $scope.feature.acuTrack + "&fuelProgram=" + $scope.feature.fuelProgram + "&amstatIntegration=" + $scope.feature.amstatIntegration+ "&posAccountingIntegration=" |
... | ... | @@ -48,7 +50,11 @@ |
48 | 50 | console.log(response) |
49 | 51 | |
50 | 52 | }) |
51 | - }) | |
53 | + }, function (err) { | |
54 | + toastr.error('Error in registering', { | |
55 | + closeButton: true | |
56 | + }) | |
57 | + }); | |
52 | 58 | } |
53 | 59 | |
54 | 60 | $scope.enableEssId = function(){ | ... | ... |
app/views/fbo-admin/dashboard.service.js
app/views/fbo-flight/flight.html
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | <div class="ibox-title"> |
81 | 81 | <h5>Aircraft List</h5> |
82 | 82 | <div class="pull-right"> |
83 | - <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal4">+ Add</button> | |
83 | + <button type="button" class="btn btn-primary btn-sm" ng-click="openModal()">+ Add</button> | |
84 | 84 | </div> |
85 | 85 | <div class="clearfix"></div> |
86 | 86 | <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true"> | ... | ... |
app/views/fbo-flight/flightDept.controller.js
... | ... | @@ -24,21 +24,32 @@ |
24 | 24 | toastr.success('Created Successfully', { |
25 | 25 | closeButton: true |
26 | 26 | }) |
27 | - }) | |
27 | + }, function (err) { | |
28 | + toastr.error('Error in registering', { | |
29 | + closeButton: true | |
30 | + }) | |
31 | + }); | |
28 | 32 | } |
29 | 33 | |
30 | 34 | $scope.data.cardType = 'creditCard'; |
31 | 35 | var cardData = {} |
32 | 36 | cardData.paymentMethodList = []; |
33 | 37 | $scope.addCard = function(){ |
34 | - cardData.paymentMethodList.push($scope.data); | |
35 | - console.log("cardData", cardData); | |
36 | - FBOFlight.addCardInformation(cardData).then(function(result) { | |
37 | - console.log(result) | |
38 | - toastr.success('Created Successfully', { | |
39 | - closeButton: true | |
40 | - }) | |
41 | - }) | |
38 | + if($scope.aircraft.accountId == undefined){ | |
39 | + toastr.error('Please Add Contact Information', { | |
40 | + closeButton: true | |
41 | + }) | |
42 | + }else{ | |
43 | + cardData.paymentMethodList.push($scope.data); | |
44 | + console.log("cardData", cardData); | |
45 | + FBOFlight.addCardInformation(cardData).then(function(result) { | |
46 | + console.log(result) | |
47 | + toastr.success('Created Successfully', { | |
48 | + closeButton: true | |
49 | + }) | |
50 | + }) | |
51 | + } | |
52 | + | |
42 | 53 | } |
43 | 54 | |
44 | 55 | getData(); |
... | ... | @@ -70,10 +81,23 @@ |
70 | 81 | |
71 | 82 | }) |
72 | 83 | } |
84 | + | |
85 | + $scope.openModal = function(){ | |
86 | + if($scope.aircraft.accountId == undefined){ | |
87 | + toastr.error('Please Add Contact Information', { | |
88 | + closeButton: true | |
89 | + }) | |
90 | + $('#myModal4').modal('hide'); | |
91 | + }else{ | |
92 | + $('#myModal4').modal('show'); | |
93 | + } | |
94 | + | |
95 | + } | |
73 | 96 | $scope.aircraftData = {}; |
74 | 97 | $scope.aircraftData.aircraftList = []; |
75 | 98 | $scope.getCraftList = []; |
76 | 99 | $scope.addAircraft = function(){ |
100 | + console.log($scope.aircraft.accountId) | |
77 | 101 | $scope.aircraftData.aircraftList.push($scope.aircraft); |
78 | 102 | console.log($scope.aircraftData.aircraftList) |
79 | 103 | if ($scope.getCraftList.indexOf($scope.aircraft) == -1) { |
... | ... | @@ -88,6 +112,7 @@ |
88 | 112 | closeButton: true |
89 | 113 | }) |
90 | 114 | }) |
115 | + | |
91 | 116 | } |
92 | 117 | |
93 | 118 | $scope.reset = function() { | ... | ... |
app/views/fbo-flight/flightDeptService.js
app/views/update-airports/updateAirportController.js
... | ... | @@ -73,7 +73,13 @@ angular.module('acuefuel') |
73 | 73 | toastr.success('Copied', { |
74 | 74 | closeButton: true |
75 | 75 | }) |
76 | - }) | |
76 | + }, function (err) { | |
77 | + localStorage.removeItem('airportLoader'); | |
78 | + $scope.showAirports = true; | |
79 | + toastr.error('Error in uploading', { | |
80 | + closeButton: true | |
81 | + }) | |
82 | + }); | |
77 | 83 | }else { |
78 | 84 | localStorage.removeItem('airportLoader'); |
79 | 85 | $scope.showAirports = true; |
... | ... | @@ -110,7 +116,13 @@ angular.module('acuefuel') |
110 | 116 | toastr.success('File Upload Successfully', { |
111 | 117 | closeButton: true |
112 | 118 | }) |
113 | - }) | |
119 | + }, function (err) { | |
120 | + localStorage.removeItem('suppDetailLoader'); | |
121 | + $scope.suppDetail = true; | |
122 | + toastr.error('Error in uploading', { | |
123 | + closeButton: true | |
124 | + }) | |
125 | + }); | |
114 | 126 | }else { |
115 | 127 | localStorage.removeItem('suppDetailLoader'); |
116 | 128 | $scope.suppDetail = true; |
... | ... | @@ -146,7 +158,13 @@ angular.module('acuefuel') |
146 | 158 | toastr.success('File Upload Successfully', { |
147 | 159 | closeButton: true |
148 | 160 | }) |
149 | - }) | |
161 | + }, function (err) { | |
162 | + localStorage.removeItem('countryLoader'); | |
163 | + $scope.showCountries = true; | |
164 | + toastr.error('Error in uploading', { | |
165 | + closeButton: true | |
166 | + }) | |
167 | + }); | |
150 | 168 | }else { |
151 | 169 | localStorage.removeItem('countryLoader'); |
152 | 170 | $scope.showCountries = true; |
... | ... | @@ -182,7 +200,13 @@ angular.module('acuefuel') |
182 | 200 | toastr.success('File Upload Successfully', { |
183 | 201 | closeButton: true |
184 | 202 | }) |
185 | - }) | |
203 | + }, function (err) { | |
204 | + localStorage.removeItem('subDivStateLoader'); | |
205 | + $scope.subDivState = true; | |
206 | + toastr.error('Error in uploading', { | |
207 | + closeButton: true | |
208 | + }) | |
209 | + }); | |
186 | 210 | }else { |
187 | 211 | localStorage.removeItem('subDivStateLoader'); |
188 | 212 | $scope.subDivState = true; |
... | ... | @@ -218,7 +242,13 @@ angular.module('acuefuel') |
218 | 242 | toastr.success('File Upload Successfully', { |
219 | 243 | closeButton: true |
220 | 244 | }) |
221 | - }) | |
245 | + }, function (err) { | |
246 | + localStorage.removeItem('fboHandleLoader'); | |
247 | + $scope.fboHandlerDetail = true; | |
248 | + toastr.error('Error in uploading', { | |
249 | + closeButton: true | |
250 | + }) | |
251 | + }); | |
222 | 252 | }else { |
223 | 253 | localStorage.removeItem('fboHandleLoader'); |
224 | 254 | $scope.fboHandlerDetail = true; | ... | ... |
app/views/update-airports/updateAirportService.js
... | ... | @@ -24,6 +24,8 @@ |
24 | 24 | }) |
25 | 25 | .success(function(result) { |
26 | 26 | deferred.resolve(result); |
27 | + }).error(function(error){ | |
28 | + deferred.reject(error); | |
27 | 29 | }) |
28 | 30 | return deferred.promise; |
29 | 31 | } |
... | ... | @@ -46,6 +48,8 @@ |
46 | 48 | }) |
47 | 49 | .success(function(result) { |
48 | 50 | deferred.resolve(result); |
51 | + }).error(function(error){ | |
52 | + deferred.reject(error); | |
49 | 53 | }) |
50 | 54 | return deferred.promise; |
51 | 55 | } |
... | ... | @@ -68,6 +72,8 @@ |
68 | 72 | }) |
69 | 73 | .success(function(result) { |
70 | 74 | deferred.resolve(result); |
75 | + }).error(function(error){ | |
76 | + deferred.reject(error); | |
71 | 77 | }) |
72 | 78 | return deferred.promise; |
73 | 79 | } |
... | ... | @@ -90,6 +96,8 @@ |
90 | 96 | }) |
91 | 97 | .success(function(result) { |
92 | 98 | deferred.resolve(result); |
99 | + }).error(function(error){ | |
100 | + deferred.reject(error); | |
93 | 101 | }) |
94 | 102 | return deferred.promise; |
95 | 103 | } |
... | ... | @@ -112,6 +120,8 @@ |
112 | 120 | }) |
113 | 121 | .success(function(result) { |
114 | 122 | deferred.resolve(result); |
123 | + }).error(function(error){ | |
124 | + deferred.reject(error); | |
115 | 125 | }) |
116 | 126 | return deferred.promise; |
117 | 127 | } | ... | ... |