1(function (app) { 2 'use strict'; 3 4 app.controller('TDLinxSearchModalCtrl', TDLinxSearchModalCtrl); 5 6 TDLinxSearchModalCtrl.$inject = ['$rootScope', '$scope', '$uibModalInstance', 'items', '$window', 'mhheatService', 'notificationService']; 7 8 function TDLinxSearchModalCtrl($rootScope, $scope, $uibModalInstance, items, $window, mhheatService, notificationService) { 9 10 $scope.heatinfo = items.heatinfo; 11 $scope.loadingAssets = false; 12 $scope.SelectedItem = null; 13 $scope.selectedindex = -1; 14 15 $scope.closeModal = function () { 16 $uibModalInstance.dismiss('cancel'); 17 } 18 19 $scope.updateSelection = function (position, entities) { 20 $scope.SelectedItem = entities; 21 $scope.selectedindex = position; 22 //angular.forEach(entities, function (subscription, index) { 23 // if (position != index) 24 // subscription.checked = false; 25 //}); 26 } 27 28 var loadHeatElements = function (sVal, searchText) { 29 try { 30 $scope.loadingAssets = true; 31 var params = { 32 id: sVal, LookupItemName: searchText 33 } 34 mhheatService.searchSimilarStore(params) 35 .then(function (response) { 36 if (response) { 37 $scope.ExactStoreDetails = response.ExactStore; 38 $scope.SimilarStoreDetails = response.SimilarStore; 39 $scope.loadingAssets = false; 40 } 41 42 }); 43 } catch (e) { 44 notificationService.displayError(e.message); 45 $scope.loadingAssets = false; 46 } 47 }; 48 49 var init = function () { 50 loadHeatElements($scope.heatinfo.HeatAccountID, $scope.heatinfo.StoreNameAddress); 51 }; 52 53 init(); 54 55 56 $scope.UpdateTDLinx = function () { 57 if ($scope.shareContentForm.$valid) { 58 59 if (!$scope.SelectedItem || $scope.SelectedItem == null) 60 { 61 notificationService.displayError("Please select Store to continue!"); 62 return; 63 } 64 65 if ($window.confirm("Do you want to convert this Exception with selected Heat Account?")) { 66 $scope.UpdateTDLINx($scope.heatinfo.HeatAccountID, $scope.SelectedItem.LookupItemID); 67 notificationService.displaySuccess("Convert from Exception to HEAT account done successfully."); 68 $scope.closeModal(); 69 } 70 } 71 } 72 } 73})(angular.module('distPortal'));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.