From 3e829fcadaf561775d022686a2bc0fa98de8e8cc Mon Sep 17 00:00:00 2001 From: Neckless Cage Date: Sun, 21 May 2017 13:13:53 +0630 Subject: [PATCH 1/4] Committing to dev branch --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index 50b518c..40e7024 100644 --- a/index.html +++ b/index.html @@ -39,8 +39,7 @@
- - +
From 70b1aecd2593a0333fe600988639dfd53eabe2bd Mon Sep 17 00:00:00 2001 From: Neckless Cage Date: Sun, 21 May 2017 22:38:41 +0630 Subject: [PATCH 2/4] Database connection tested! --- .../master/pointEntry/pointEntry.html | 21 ++++++++++++++++++- .../master/pointEntry/pointEntryController.js | 10 ++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/components/master/pointEntry/pointEntry.html b/app/components/master/pointEntry/pointEntry.html index 049518f..7311982 100644 --- a/app/components/master/pointEntry/pointEntry.html +++ b/app/components/master/pointEntry/pointEntry.html @@ -26,7 +26,26 @@

Point Entry

Add Add Add - Add + Get Data + +
+ + + + + + + + + + + + + + + + +
#PKName
{{$index + 1}}{{h.PrimaryKey}}{{h.Name}}
diff --git a/app/components/master/pointEntry/pointEntryController.js b/app/components/master/pointEntry/pointEntryController.js index dc6984a..367502b 100644 --- a/app/components/master/pointEntry/pointEntryController.js +++ b/app/components/master/pointEntry/pointEntryController.js @@ -1,5 +1,5 @@ -angular.module('hrApp').controller('pointEntryController', function ($scope) { +angular.module('hrApp').controller('pointEntryController', function ($scope, $http) { $scope.points = []; var pointKey = 0; @@ -23,4 +23,12 @@ angular.module('hrApp').controller('pointEntryController', function ($scope) { $scope.remove = function (index) { $scope.points.splice(index, 1); } + + $scope.getData = function () { + $http.post('http://localhost:61884/HolaWs.asmx/GetAllHolas') + .then(function (response) { + $scope.holas = response.data; + alert($scope.holas); + }) + }; }); From ad4092e1d48b02e90e80874aa5a932a5ed5d96b8 Mon Sep 17 00:00:00 2001 From: Htet Aung Date: Mon, 22 May 2017 14:45:18 +0630 Subject: [PATCH 3/4] Data finding by id --- .../master/pointEntry/pointEntry.html | 14 +++++------ .../master/pointEntry/pointEntryController.js | 25 +++++++++++++------ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/app/components/master/pointEntry/pointEntry.html b/app/components/master/pointEntry/pointEntry.html index 7311982..9ef82ab 100644 --- a/app/components/master/pointEntry/pointEntry.html +++ b/app/components/master/pointEntry/pointEntry.html @@ -14,7 +14,7 @@

Point Entry

- + @@ -22,7 +22,7 @@

Point Entry

Add - Add + Find Add Add Add @@ -34,15 +34,15 @@

Point Entry

# - PK - Name + ID + Description - + {{$index + 1}} - {{h.PrimaryKey}} - {{h.Name}} + {{h.pointId}} + {{h.desc}} diff --git a/app/components/master/pointEntry/pointEntryController.js b/app/components/master/pointEntry/pointEntryController.js index 367502b..3e02158 100644 --- a/app/components/master/pointEntry/pointEntryController.js +++ b/app/components/master/pointEntry/pointEntryController.js @@ -12,23 +12,32 @@ angular.module('hrApp').controller('pointEntryController', function ($scope, $ht $scope.add = function () { var l_point = angular.copy($scope.point); - l_point.pointId = ++pointKey; + l_point.key = ++pointKey; $scope.points.push(l_point); $scope.point.pointId = ""; $scope.point.desc = ""; alert($scope.points.length); - } + }; $scope.remove = function (index) { $scope.points.splice(index, 1); - } + }; + + $scope.find = function (id) { + $scope.chosen = $scope.points.filter(function (val) { + return val.pointId == id; + }); + if ($scope.chosen.length > 0) { + $scope.point.desc = $scope.chosen[0].desc; + } + }; $scope.getData = function () { - $http.post('http://localhost:61884/HolaWs.asmx/GetAllHolas') - .then(function (response) { - $scope.holas = response.data; - alert($scope.holas); - }) + // $http.post('http://localhost:61884/HolaWs.asmx/GetAllHolas') + // .then(function (response) { + // $scope.holas = response.data; + // alert($scope.holas); + // }) }; }); From cb5cdaf773340ea45ee177b35109b97096b8a3f3 Mon Sep 17 00:00:00 2001 From: Htet Aung Date: Mon, 22 May 2017 18:30:07 +0630 Subject: [PATCH 4/4] commit 7: --- .../master/pointEntry/pointEntry.html | 23 ++++---- .../master/pointEntry/pointEntryController.js | 33 ++++++++---- app/components/master/taxEntry/taxEntry.html | 53 +++++++++++++++++++ .../master/taxEntry/taxEntryController.js | 5 ++ app/shared/directives.js | 20 +++++++ assets/js/app.js | 12 ++++- index.html | 5 ++ 7 files changed, 131 insertions(+), 20 deletions(-) create mode 100644 app/components/master/taxEntry/taxEntry.html create mode 100644 app/components/master/taxEntry/taxEntryController.js create mode 100644 app/shared/directives.js diff --git a/app/components/master/pointEntry/pointEntry.html b/app/components/master/pointEntry/pointEntry.html index 9ef82ab..58901f0 100644 --- a/app/components/master/pointEntry/pointEntry.html +++ b/app/components/master/pointEntry/pointEntry.html @@ -1,7 +1,7 @@ -
+

- +

Point Entry

@@ -14,19 +14,24 @@

Point Entry

- + - Add - Find - Add - Add - Add - Get Data +
+ New + Save + Edit + Delete + Reset + List + + Get Data +

diff --git a/app/components/master/pointEntry/pointEntryController.js b/app/components/master/pointEntry/pointEntryController.js index 3e02158..dfd0a09 100644 --- a/app/components/master/pointEntry/pointEntryController.js +++ b/app/components/master/pointEntry/pointEntryController.js @@ -1,23 +1,37 @@ angular.module('hrApp').controller('pointEntryController', function ($scope, $http) { - $scope.points = []; + //$window.document.getElementById('inputPointId').focus(); + $scope.focuser = true; + $scope.points = []; var pointKey = 0; - $scope.point = { key: 0, pointId: "", desc: "" }; - $scope.add = function () { + $scope.clearAll = function () { + $scope.focuser = true; + }; + $scope.save = function () { var l_point = angular.copy($scope.point); l_point.key = ++pointKey; $scope.points.push(l_point); $scope.point.pointId = ""; $scope.point.desc = ""; + }; + $scope.edit = function () { + + }; + $scope.delete = function () { + + }; + $scope.reset = function () { + + }; + $scope.list = function () { - alert($scope.points.length); }; $scope.remove = function (index) { @@ -34,10 +48,11 @@ angular.module('hrApp').controller('pointEntryController', function ($scope, $ht }; $scope.getData = function () { - // $http.post('http://localhost:61884/HolaWs.asmx/GetAllHolas') - // .then(function (response) { - // $scope.holas = response.data; - // alert($scope.holas); - // }) + alert('b'); + $http.post('http://192.168.100.1/JSWebservice/MyWebservice.asmx/SelectData') + .then(function (response) { + $scope.holas = response.data; + alert($scope.holas); + }) }; }); diff --git a/app/components/master/taxEntry/taxEntry.html b/app/components/master/taxEntry/taxEntry.html new file mode 100644 index 0000000..f616339 --- /dev/null +++ b/app/components/master/taxEntry/taxEntry.html @@ -0,0 +1,53 @@ +
+
+ + +
+

Group Entry

+
+ + + + + + + + + + + + + +
+ New + Save + Edit + Delete + Reset + List +
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + +
Group IDDescription
+ X + {{g.groupid}}{{g.description}}
\ No newline at end of file diff --git a/app/components/master/taxEntry/taxEntryController.js b/app/components/master/taxEntry/taxEntryController.js new file mode 100644 index 0000000..54c58ed --- /dev/null +++ b/app/components/master/taxEntry/taxEntryController.js @@ -0,0 +1,5 @@ + +angular.module('hrApp').controller('taxEntryController', function ($scope, $http) { + $scope.clearAll = function () { + }; +}); diff --git a/app/shared/directives.js b/app/shared/directives.js new file mode 100644 index 0000000..5a48e39 --- /dev/null +++ b/app/shared/directives.js @@ -0,0 +1,20 @@ +angular.module('hrApp').directive('focus', function ($timeout, $parse) { + return { + restrict: 'A', + link: function (scope, element, attrs) { + scope.$watch(attrs.focus, function (newValue, oldValue) { + if (newValue) { element[0].focus(); } + }); + element.bind("blur", function (e) { + $timeout(function () { + scope.$apply(attrs.focus + "=false"); + }, 0); + }); + element.bind("focus", function (e) { + $timeout(function () { + scope.$apply(attrs.focus + "=true"); + }, 0); + }) + } + } +}); \ No newline at end of file diff --git a/assets/js/app.js b/assets/js/app.js index b2abd07..357a920 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -6,10 +6,14 @@ var hrApp = angular.module('hrApp', ['ngMaterial', 'ngRoute']); // configure our routes hrApp.config(function ($routeProvider) { $routeProvider - // route for the point entry .when('/masterPointEntry', { - templateUrl: 'app/components/master/pointEntry/pointEntry.html' + templateUrl: 'app/components/master/pointEntry/pointEntry.html', + controller: 'pointEntryController' + }) + .when('/masterTaxEntry', { + templateUrl: 'app/components/master/taxEntry/taxEntry.html', + controller: 'taxEntryController' }) }); @@ -79,3 +83,7 @@ hrApp.controller('aboutController', function ($scope) { hrApp.controller('contactController', function ($scope) { $scope.message = 'Contact us! JK. This is just a demo.'; }); + +hrApp.config(function ($httpProvider) { + delete $httpProvider.defaults.headers.common['X-Requested-With']; +}); \ No newline at end of file diff --git a/index.html b/index.html index 40e7024..782b40f 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,9 @@ Point Entry + + Tax Entry + @@ -50,5 +53,7 @@ + + \ No newline at end of file