master changes
This commit is contained in:
parent
02ad1e5864
commit
efd217807b
1
ng6-seed/dist/2.0708010cc12ecd58c58b.js
vendored
1
ng6-seed/dist/2.0708010cc12ecd58c58b.js
vendored
File diff suppressed because one or more lines are too long
1
ng6-seed/dist/2.7b6a1f12ea62e515d862.js
vendored
Normal file
1
ng6-seed/dist/2.7b6a1f12ea62e515d862.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
ng6-seed/dist/common.0f2433d4dd39b3480a89.js
vendored
Normal file
1
ng6-seed/dist/common.0f2433d4dd39b3480a89.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"hW/x":function(e,t,i){"use strict";i.d(t,"a",function(){return d});var s=i("Q1FS"),r=i("zylw"),n=i("CcnG"),a=i("t/Na"),o="http://ssa.sineedge.com/sparqapi/api/",p=(new Date).toJSON().slice(0,19).replace("T"," "),d=function(){function e(e,t){this.http=e,this.aws=t}return e.prototype.getuserdata=function(){return this.http.get(o+"getListOfUsers")},e.prototype.adminupendis=function(e){var t=new FormData;return t.append("records",JSON.stringify(e)),this.http.post(o+"updateExistUser",t)},e.prototype.entityType=function(){return this.http.post(o+"getListOfMaster",{master_name:"ENTITYTYPE"})},e.prototype.City=function(){return this.http.post(o+"getListOfMaster",{master_name:"CITY"})},e.prototype.State=function(){return this.http.post(o+"getListOfMaster",{master_name:"STATE"})},e.prototype.designation=function(){return this.http.post(o+"getListOfMaster",{master_name:"DESIGNATION"})},e.prototype.lenderHierarchy=function(){return this.http.post(o+"getListOfMaster",{master_name:"LENDERHIERARCHY"})},e.prototype.saveRecords=function(e,t){if(""!=e&&void 0!==e){var i=void 0,s=void 0,r=void 0,n=void 0,a=void 0;null!=t.userid?(i=t.aws_name,s=this.aws.getlocale()||"",a=p):(i=e.User.Username,r=this.aws.getlocale()||"",n=p);var d=void 0;null!=t.userpic&&""!=t.userpic&&void 0!==t.userpic&&(d=t.userpic.name),console.log(d);var c=new FormData;console.log(t);for(var l=[],u=0,f=t.role;u<f.length;u++)l.push({user_role:f[u].value});var h=void 0;if(2==t.type.entity_type_id){var y=[];y.push(t.lenderHierarchy),c.append("lender_hierarchy",JSON.stringify(y)),h=""}else 1==t.type.entity_type_id&&(h=t.designation.designation_id);return c.append("records",JSON.stringify({userid:t.userid,aws_name:i,first_name:t.firstName,last_name:t.lastName,mobile_no:t.phone,email:t.email,alt_email:t.alt_email,alt_mobile_no:t.alt_mobile_no,addressline1:t.address1,addressline2:t.address2,addressline3:t.address3,isactive:t.isactive,fk_entity_id:t.type.entity_type_id,fk_designation:h,fk_city:t.city.city_id,fk_state:t.state.state_id,pincode:t.pincode,profilepic:d,fk_createdby:r,fk_updatedby:s,createdon:n,updatedon:a})),c.append("roles",JSON.stringify(l)),c.append("profilepic",t.userpic),""!=t.userid&&null!=t.userid&&void 0!==t.userid?(delete this.localUserId,this.http.post(o+"updateExistUser",c)):this.http.post(o+"saveNewUser",c)}},e.prototype.adminGetUsers=function(e){var t=this;return console.log(e),this.localUserId=e,s.Observable.create(function(e){console.log(t.localUserId),e.next(t.localUserId)})},e.ngInjectableDef=n.defineInjectable({factory:function(){return new e(n.inject(a.c),n.inject(r.a))},token:e,providedIn:"root"}),e}()}}]);
|
||||
1
ng6-seed/dist/common.36f68c8ddc6e7b50f02c.js
vendored
1
ng6-seed/dist/common.36f68c8ddc6e7b50f02c.js
vendored
@ -1 +0,0 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"hW/x":function(e,t,i){"use strict";i.d(t,"a",function(){return d});var s=i("Q1FS"),r=i("zylw"),n=i("CcnG"),a=i("t/Na"),o="http://localhost/sparqapi/api/",p=(new Date).toJSON().slice(0,19).replace("T"," "),d=function(){function e(e,t){this.http=e,this.aws=t}return e.prototype.getuserdata=function(){return this.http.get(o+"getListOfUsers")},e.prototype.adminupendis=function(e){var t=new FormData;return t.append("records",JSON.stringify(e)),this.http.post(o+"updateExistUser",t)},e.prototype.entityType=function(){return this.http.post(o+"getListOfMaster",{master_name:"ENTITYTYPE"})},e.prototype.City=function(){return this.http.post(o+"getListOfMaster",{master_name:"CITY"})},e.prototype.State=function(){return this.http.post(o+"getListOfMaster",{master_name:"STATE"})},e.prototype.designation=function(){return this.http.post(o+"getListOfMaster",{master_name:"DESIGNATION"})},e.prototype.lenderHierarchy=function(){return this.http.post(o+"getListOfMaster",{master_name:"LENDERHIERARCHY"})},e.prototype.saveRecords=function(e,t){if(""!=e&&void 0!==e){var i=void 0,s=void 0,r=void 0,n=void 0,a=void 0;null!=t.userid?(i=t.aws_name,s=this.aws.getlocale()||"",a=p):(i=e.User.Username,r=this.aws.getlocale()||"",n=p);var d=void 0;null!=t.userpic&&""!=t.userpic&&void 0!==t.userpic&&(d=t.userpic.name),console.log(d);var l=new FormData;console.log(t);for(var c=[],u=0,f=t.role;u<f.length;u++)c.push({user_role:f[u].value});var h=void 0;if(2==t.type.entity_type_id){var y=[];y.push(t.lenderHierarchy),l.append("lender_hierarchy",JSON.stringify(y)),h=""}else 1==t.type.entity_type_id&&(h=t.designation.designation_id);return l.append("records",JSON.stringify({userid:t.userid,aws_name:i,first_name:t.firstName,last_name:t.lastName,mobile_no:t.phone,email:t.email,alt_email:t.alt_email,alt_mobile_no:t.alt_mobile_no,addressline1:t.address1,addressline2:t.address2,addressline3:t.address3,isactive:t.isactive,fk_entity_id:t.type.entity_type_id,fk_designation:h,fk_city:t.city.city_id,fk_state:t.state.state_id,pincode:t.pincode,profilepic:d,fk_createdby:r,fk_updatedby:s,createdon:n,updatedon:a})),l.append("roles",JSON.stringify(c)),l.append("profilepic",t.userpic),""!=t.userid&&null!=t.userid&&void 0!==t.userid?(delete this.localUserId,this.http.post(o+"updateExistUser",l)):this.http.post(o+"saveNewUser",l)}},e.prototype.adminGetUsers=function(e){var t=this;return console.log(e),this.localUserId=e,s.Observable.create(function(e){console.log(t.localUserId),e.next(t.localUserId)})},e.ngInjectableDef=n.defineInjectable({factory:function(){return new e(n.inject(a.c),n.inject(r.a))},token:e,providedIn:"root"}),e}()}}]);
|
||||
2
ng6-seed/dist/index.html
vendored
2
ng6-seed/dist/index.html
vendored
@ -144,7 +144,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</app-root>
|
||||
<script type="text/javascript" src="runtime.1b62575310531dd808c4.js"></script><script type="text/javascript" src="polyfills.adff927a96157915e5e4.js"></script><script type="text/javascript" src="scripts.32f334142d7dacb1b821.js"></script><script type="text/javascript" src="main.0f8c94a69978afe1386d.js"></script></body>
|
||||
<script type="text/javascript" src="runtime.0dabbb356a28d80f5fa4.js"></script><script type="text/javascript" src="polyfills.adff927a96157915e5e4.js"></script><script type="text/javascript" src="scripts.32f334142d7dacb1b821.js"></script><script type="text/javascript" src="main.bdc4d7ee6b3915f44a33.js"></script></body>
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script> -->
|
||||
|
||||
</html>
|
||||
1
ng6-seed/dist/main.0f8c94a69978afe1386d.js
vendored
1
ng6-seed/dist/main.0f8c94a69978afe1386d.js
vendored
File diff suppressed because one or more lines are too long
1
ng6-seed/dist/main.bdc4d7ee6b3915f44a33.js
vendored
Normal file
1
ng6-seed/dist/main.bdc4d7ee6b3915f44a33.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ng6-seed/dist/runtime.0dabbb356a28d80f5fa4.js
vendored
Normal file
1
ng6-seed/dist/runtime.0dabbb356a28d80f5fa4.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(e){function r(r){for(var n,c,u=r[0],i=r[1],f=r[2],s=0,p=[];s<u.length;s++)o[c=u[s]]&&p.push(o[c][0]),o[c]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(r);p.length;)p.shift()();return a.push.apply(a,f||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],n=!0,u=1;u<t.length;u++)0!==o[t[u]]&&(n=!1);n&&(a.splice(r--,1),e=c(c.s=t[0]))}return e}var n={},o={9:0},a=[];function c(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,c),t.l=!0,t.exports}c.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var a=document.getElementsByTagName("head")[0],u=document.createElement("script");u.charset="utf-8",u.timeout=120,c.nc&&u.setAttribute("nonce",c.nc),u.src=function(e){return c.p+""+({0:"common"}[e]||e)+"."+{0:"0f2433d4dd39b3480a89",1:"531f65ed0091539f9477",2:"7b6a1f12ea62e515d862",3:"5da3edc9285cdf641314",4:"87df24c894aad68f5453",5:"17637973ae00907d09e3",6:"777a2a1219ea290a8734",7:"02f2c59303cdab8ea504",8:"7cb82988cb09969bc347"}[e]+".js"}(e);var i=setTimeout(function(){f({type:"timeout",target:u})},12e4);function f(r){u.onerror=u.onload=null,clearTimeout(i);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src,c=new Error("Loading chunk "+e+" failed.\n("+n+": "+a+")");c.type=n,c.request=a,t[1](c)}o[e]=void 0}}u.onerror=u.onload=f,a.appendChild(u)}return Promise.all(r)},c.m=e,c.c=n,c.d=function(e,r,t){c.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},c.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},c.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(r,"a",r),r},c.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},c.p="",c.oe=function(e){throw console.error(e),e};var u=window.webpackJsonp=window.webpackJsonp||[],i=u.push.bind(u);u.push=r,u=u.slice();for(var f=0;f<u.length;f++)r(u[f]);var l=i;t()}([]);
|
||||
@ -1 +0,0 @@
|
||||
!function(e){function r(r){for(var n,a,u=r[0],i=r[1],f=r[2],s=0,p=[];s<u.length;s++)o[a=u[s]]&&p.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(r);p.length;)p.shift()();return c.push.apply(c,f||[]),t()}function t(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,u=1;u<t.length;u++)0!==o[t[u]]&&(n=!1);n&&(c.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={9:0},c=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var c=document.getElementsByTagName("head")[0],u=document.createElement("script");u.charset="utf-8",u.timeout=120,a.nc&&u.setAttribute("nonce",a.nc),u.src=function(e){return a.p+""+({0:"common"}[e]||e)+"."+{0:"36f68c8ddc6e7b50f02c",1:"531f65ed0091539f9477",2:"0708010cc12ecd58c58b",3:"2b92c94e13c490007184",4:"87df24c894aad68f5453",5:"17637973ae00907d09e3",6:"4f6480e47d07b07836c5",7:"93c38f0936a3e37444e0",8:"a1c985c26e33355976b7"}[e]+".js"}(e);var i=setTimeout(function(){f({type:"timeout",target:u})},12e4);function f(r){u.onerror=u.onload=null,clearTimeout(i);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src,a=new Error("Loading chunk "+e+" failed.\n("+n+": "+c+")");a.type=n,a.request=c,t[1](a)}o[e]=void 0}}u.onerror=u.onload=f,c.appendChild(u)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},a.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var u=window.webpackJsonp=window.webpackJsonp||[],i=u.push.bind(u);u.push=r,u=u.slice();for(var f=0;f<u.length;f++)r(u[f]);var l=i;t()}([]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
{"code":"!function(e){function r(r){for(var n,c,u=r[0],i=r[1],f=r[2],s=0,p=[];s<u.length;s++)o[c=u[s]]&&p.push(o[c][0]),o[c]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(r);p.length;)p.shift()();return a.push.apply(a,f||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],n=!0,u=1;u<t.length;u++)0!==o[t[u]]&&(n=!1);n&&(a.splice(r--,1),e=c(c.s=t[0]))}return e}var n={},o={9:0},a=[];function c(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,c),t.l=!0,t.exports}c.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var a=document.getElementsByTagName(\"head\")[0],u=document.createElement(\"script\");u.charset=\"utf-8\",u.timeout=120,c.nc&&u.setAttribute(\"nonce\",c.nc),u.src=function(e){return c.p+\"\"+({0:\"common\"}[e]||e)+\".\"+{0:\"0f2433d4dd39b3480a89\",1:\"531f65ed0091539f9477\",2:\"7b6a1f12ea62e515d862\",3:\"5da3edc9285cdf641314\",4:\"87df24c894aad68f5453\",5:\"17637973ae00907d09e3\",6:\"777a2a1219ea290a8734\",7:\"02f2c59303cdab8ea504\",8:\"7cb82988cb09969bc347\"}[e]+\".js\"}(e);var i=setTimeout(function(){f({type:\"timeout\",target:u})},12e4);function f(r){u.onerror=u.onload=null,clearTimeout(i);var t=o[e];if(0!==t){if(t){var n=r&&(\"load\"===r.type?\"missing\":r.type),a=r&&r.target&&r.target.src,c=new Error(\"Loading chunk \"+e+\" failed.\\n(\"+n+\": \"+a+\")\");c.type=n,c.request=a,t[1](c)}o[e]=void 0}}u.onerror=u.onload=f,a.appendChild(u)}return Promise.all(r)},c.m=e,c.c=n,c.d=function(e,r,t){c.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},c.r=function(e){Object.defineProperty(e,\"__esModule\",{value:!0})},c.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(r,\"a\",r),r},c.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},c.p=\"\",c.oe=function(e){throw console.error(e),e};var u=window.webpackJsonp=window.webpackJsonp||[],i=u.push.bind(u);u.push=r,u=u.slice();for(var f=0;f<u.length;f++)r(u[f]);var l=i;t()}([]);","extractedComments":[]}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{\"hW/x\":function(e,t,i){\"use strict\";i.d(t,\"a\",function(){return d});var s=i(\"Q1FS\"),r=i(\"zylw\"),n=i(\"CcnG\"),a=i(\"t/Na\"),o=\"http://ssa.sineedge.com/sparqapi/api/\",p=(new Date).toJSON().slice(0,19).replace(\"T\",\" \"),d=function(){function e(e,t){this.http=e,this.aws=t}return e.prototype.getuserdata=function(){return this.http.get(o+\"getListOfUsers\")},e.prototype.adminupendis=function(e){var t=new FormData;return t.append(\"records\",JSON.stringify(e)),this.http.post(o+\"updateExistUser\",t)},e.prototype.entityType=function(){return this.http.post(o+\"getListOfMaster\",{master_name:\"ENTITYTYPE\"})},e.prototype.City=function(){return this.http.post(o+\"getListOfMaster\",{master_name:\"CITY\"})},e.prototype.State=function(){return this.http.post(o+\"getListOfMaster\",{master_name:\"STATE\"})},e.prototype.designation=function(){return this.http.post(o+\"getListOfMaster\",{master_name:\"DESIGNATION\"})},e.prototype.lenderHierarchy=function(){return this.http.post(o+\"getListOfMaster\",{master_name:\"LENDERHIERARCHY\"})},e.prototype.saveRecords=function(e,t){if(\"\"!=e&&void 0!==e){var i=void 0,s=void 0,r=void 0,n=void 0,a=void 0;null!=t.userid?(i=t.aws_name,s=this.aws.getlocale()||\"\",a=p):(i=e.User.Username,r=this.aws.getlocale()||\"\",n=p);var d=void 0;null!=t.userpic&&\"\"!=t.userpic&&void 0!==t.userpic&&(d=t.userpic.name),console.log(d);var c=new FormData;console.log(t);for(var l=[],u=0,f=t.role;u<f.length;u++)l.push({user_role:f[u].value});var h=void 0;if(2==t.type.entity_type_id){var y=[];y.push(t.lenderHierarchy),c.append(\"lender_hierarchy\",JSON.stringify(y)),h=\"\"}else 1==t.type.entity_type_id&&(h=t.designation.designation_id);return c.append(\"records\",JSON.stringify({userid:t.userid,aws_name:i,first_name:t.firstName,last_name:t.lastName,mobile_no:t.phone,email:t.email,alt_email:t.alt_email,alt_mobile_no:t.alt_mobile_no,addressline1:t.address1,addressline2:t.address2,addressline3:t.address3,isactive:t.isactive,fk_entity_id:t.type.entity_type_id,fk_designation:h,fk_city:t.city.city_id,fk_state:t.state.state_id,pincode:t.pincode,profilepic:d,fk_createdby:r,fk_updatedby:s,createdon:n,updatedon:a})),c.append(\"roles\",JSON.stringify(l)),c.append(\"profilepic\",t.userpic),\"\"!=t.userid&&null!=t.userid&&void 0!==t.userid?(delete this.localUserId,this.http.post(o+\"updateExistUser\",c)):this.http.post(o+\"saveNewUser\",c)}},e.prototype.adminGetUsers=function(e){var t=this;return console.log(e),this.localUserId=e,s.Observable.create(function(e){console.log(t.localUserId),e.next(t.localUserId)})},e.ngInjectableDef=n.defineInjectable({factory:function(){return new e(n.inject(a.c),n.inject(r.a))},token:e,providedIn:\"root\"}),e}()}}]);","extractedComments":[]}
|
||||
@ -0,0 +1 @@
|
||||
{"code":"!function(e){function r(r){for(var n,a,u=r[0],i=r[1],f=r[2],s=0,p=[];s<u.length;s++)o[a=u[s]]&&p.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(r);p.length;)p.shift()();return c.push.apply(c,f||[]),t()}function t(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,u=1;u<t.length;u++)0!==o[t[u]]&&(n=!1);n&&(c.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={9:0},c=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var c=document.getElementsByTagName(\"head\")[0],u=document.createElement(\"script\");u.charset=\"utf-8\",u.timeout=120,a.nc&&u.setAttribute(\"nonce\",a.nc),u.src=function(e){return a.p+\"\"+({0:\"common\"}[e]||e)+\".\"+{0:\"0f2433d4dd39b3480a89\",1:\"531f65ed0091539f9477\",2:\"feea1c073149e560587c\",3:\"2b92c94e13c490007184\",4:\"87df24c894aad68f5453\",5:\"17637973ae00907d09e3\",6:\"4f6480e47d07b07836c5\",7:\"93c38f0936a3e37444e0\",8:\"a1c985c26e33355976b7\"}[e]+\".js\"}(e);var i=setTimeout(function(){f({type:\"timeout\",target:u})},12e4);function f(r){u.onerror=u.onload=null,clearTimeout(i);var t=o[e];if(0!==t){if(t){var n=r&&(\"load\"===r.type?\"missing\":r.type),c=r&&r.target&&r.target.src,a=new Error(\"Loading chunk \"+e+\" failed.\\n(\"+n+\": \"+c+\")\");a.type=n,a.request=c,t[1](a)}o[e]=void 0}}u.onerror=u.onload=f,c.appendChild(u)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},a.r=function(e){Object.defineProperty(e,\"__esModule\",{value:!0})},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,\"a\",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p=\"\",a.oe=function(e){throw console.error(e),e};var u=window.webpackJsonp=window.webpackJsonp||[],i=u.push.bind(u);u.push=r,u=u.slice();for(var f=0;f<u.length;f++)r(u[f]);var l=i;t()}([]);","extractedComments":[]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/02/4f/0721f09fe340d74b6fa80d67ed96506b105650f37d9b481ff4377f9f70d1
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/02/4f/0721f09fe340d74b6fa80d67ed96506b105650f37d9b481ff4377f9f70d1
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
988de0c82c24dd63320181e30a5db2c789d73696 {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002F3.5da3edc9285cdf641314.js\",\"hash\":\"0ac010ddd86b033e99bfcb876d4893a9\"}","integrity":"sha512-Vm/nK+tPQ29VXmKJVPjI+bvuYFnD3T7MnJH17IkVMsXmZcwZ9NnpGEtPaW0BLgJZ30KeEp87xu8oKeUCj3i/Yw==","time":1537725979318,"size":4645}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/02/e0/39ca6c50f61a8c57a52c8392840a14ab730af479fddee1514286d8a51972
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/02/e0/39ca6c50f61a8c57a52c8392840a14ab730af479fddee1514286d8a51972
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
4213df78682b5ef8954408a151e5f1084029e61e {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002Fcommon.0f2433d4dd39b3480a89.js\",\"hash\":\"2749dad7ec342562d01d85fab4686c64\"}","integrity":"sha512-XxDBslFkZP9X145r7669qUj4x4rXgCXKYzt6+AI56/RNIohHhw7hj4YuzacT1oRB8E8AKj9XNqdAVJYfzf0TFw==","time":1537623774192,"size":2792}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/03/58/aa4c3ff2ba40dbec0a8723229aebd8a7c509dea15d4f1956ecbaeb66b987
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/03/58/aa4c3ff2ba40dbec0a8723229aebd8a7c509dea15d4f1956ecbaeb66b987
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
2f8fbdbe3b73d1a7b00eb29243956b34a32c2a52 {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002F2.7b6a1f12ea62e515d862.js\",\"hash\":\"96da5a7ba9fcff17ec66657e08f7caed\"}","integrity":"sha512-TOWlMzjjcrEfxozW8Xs4azhFisaMVSBRY2B6mEjC2RHcsaZwKA2Y0dVr9oSlKcaV1WN7VQ1tcviKrJDQvXdOhw==","time":1537726019708,"size":1051100}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/09/87/ec3bb04efafa484c4f6de191589d6111a43e8831e29bc47ed82ba3d89300
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/09/87/ec3bb04efafa484c4f6de191589d6111a43e8831e29bc47ed82ba3d89300
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
57922964c1e0b0becfde758a24e0c13f0466bc31 {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002F7.02f2c59303cdab8ea504.js\",\"hash\":\"5a1ded922e9de8bbd51a82a4ca0fe64b\"}","integrity":"sha512-tO9pbbgl9x6WQWDelcgeeWrYhZyuhS/Q8yiQm7KU8l2y1jluxfoirWXiWkUIaI5ltjcZRVjPGLBh+6M1Ie1pmg==","time":1537726019211,"size":4948}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/1b/93/dc0fc250ac7349d219fb0efdf789439ac46394e89a7d97c9c716c7f3fc2d
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/1b/93/dc0fc250ac7349d219fb0efdf789439ac46394e89a7d97c9c716c7f3fc2d
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
6b68dbfb8675275060c49c123ca84f4345345eca {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002Fruntime.5a81adaaad09b14cbffe.js\",\"hash\":\"17f6475a12520f9ab475d47e95f6bc7e\"}","integrity":"sha512-tYIM4/jRqrJBDyNoH0GXeGoTH8leL0uJC21G4UF4qhqy1DcuRK74Psyr9z2GxtMBou4lh2kSkk9SNQBYjlp5Xg==","time":1537623773983,"size":2136}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/6b/b9/9d5d946e945d001a5d7d22d0bfe3b05b1fa26ba37ea70cf2b995cf92ba0a
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/6b/b9/9d5d946e945d001a5d7d22d0bfe3b05b1fa26ba37ea70cf2b995cf92ba0a
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
5a8a4735607386daaa249d39a3e546b35437fef5 {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002Fmain.4a1ef9b3556bb5dc0b2c.js\",\"hash\":\"7aba95f3b170f9ddd3b87dfcdb4db4fa\"}","integrity":"sha512-HR8HrqlkwGfcKY7bY6dR7znuKfir5QMsejGJ+86cppwWYL7pr+VpUSWLfj+VOxv/+5Xz66qpX+XUDXiCVgxatw==","time":1537623830381,"size":3476174}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/7a/9e/5527bc990b36ceadf59c3e1f81ef9790980d9a53bb3f7ab343ace8d696d4
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/7a/9e/5527bc990b36ceadf59c3e1f81ef9790980d9a53bb3f7ab343ace8d696d4
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
027ae2de8a3782038cecbefa87c957a5458d347b {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002Fruntime.0dabbb356a28d80f5fa4.js\",\"hash\":\"838da61977cd90c5d7590d4443e0b134\"}","integrity":"sha512-Mq8iqyobis7qT4BEkf9juYD4iXpGYQLUuKR7JXZVDVw7JKGB2O1jfkaHgeq2+vMui23tHMXquK+O4qU8KnmhBw==","time":1537725980989,"size":2136}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/89/c5/06709e92c9822027c8058e028937d82f9ad8fce51032addf098731bb4d15
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/89/c5/06709e92c9822027c8058e028937d82f9ad8fce51032addf098731bb4d15
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
044113ec9d65a1f1667ecad700526d42068c7bcb {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002F2.feea1c073149e560587c.js\",\"hash\":\"a36074aace2f955a878fa43709601ca2\"}","integrity":"sha512-AFUtJgOejyHQL850qQadrqe7QEnSuiWV58v1UTpOHW1cASNXeI0ZowExGd5mVkuYefiZj3BMZJ7CbuwkFFarIQ==","time":1537623810162,"size":1021291}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/97/50/57e60bdc854cae26d73cec4e659f60350ecd613c9009e1449863dfe97053
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/97/50/57e60bdc854cae26d73cec4e659f60350ecd613c9009e1449863dfe97053
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
1d7fbe6d3cfe59b0c359b66fb7d14a02e99eca08 {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002Fmain.bdc4d7ee6b3915f44a33.js\",\"hash\":\"853da1470e7ebe512a39452e07d04857\"}","integrity":"sha512-1Ob+QCvMe9lr0d9fFc1aHz/z2rEgSfqdWHIQ2LpSFjWhsJijIFAv4FLTJXn4GFTZflcjXSaiytOpyzLU67uE8g==","time":1537726077886,"size":3468931}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/9a/9b/635134f63f52da46527185b2a25d8a443e6c849133870a1593a710b9e42b
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/9a/9b/635134f63f52da46527185b2a25d8a443e6c849133870a1593a710b9e42b
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
cc7b8e6e114e3721f7cf284b2e7b575dca9781c2 {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002F6.777a2a1219ea290a8734.js\",\"hash\":\"25ce9c49130141f5a20fcc54547eb6ba\"}","integrity":"sha512-xnVIt3fiTLg4db+j6Fx/a1ZSJ6g7hKLB26YFzNZksWU6YEFSvm4iHaURokERhGgp5CNKMeQX11+iExCyv5TAcQ==","time":1537725980680,"size":42620}
|
||||
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/f2/ff/8116b433223945c7eaa0837cf01411f0e8362fe8548cf6b2dca04249eb66
generated
vendored
Normal file
2
ng6-seed/node_modules/.cache/uglifyjs-webpack-plugin/index-v5/f2/ff/8116b433223945c7eaa0837cf01411f0e8362fe8548cf6b2dca04249eb66
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
c7151490345ced287f9d3b2f13c0357ff8d4372e {"key":"{\"uglify-es\":\"3.3.9\",\"uglifyjs-webpack-plugin\":\"1.3.0\",\"uglifyjs-webpack-plugin-options\":{\"test\":/\\.js(\\?.*)?$/i,\"warningsFilter\":function () {\n return true;\n },\"extractComments\":false,\"sourceMap\":false,\"cache\":true,\"cacheKeys\":function (defaultCacheKeys) {\n return defaultCacheKeys;\n },\"parallel\":true,\"uglifyOptions\":{\"compress\":{\"pure_getters\":true,\"passes\":3,\"inline\":3},\"output\":{\"ascii_only\":true,\"comments\":false,\"webkit\":true},\"ecma\":5,\"warnings\":false,\"safari10\":true}},\"path\":\"\\u002Fopt\\u002Flampp\\u002Fhtdocs\\u002Fsparqsineedge\\u002Fng6-seed\\u002Fdist\\u002F8.7cb82988cb09969bc347.js\",\"hash\":\"709b673b81be1292c1873631cccea367\"}","integrity":"sha512-XYIQ7Yv4YDcvVYEzmKWg7hYgmDkSgjkuR0Go/QasqhlEbQXuqFaNMw3yRA6Dsqj8jQdqBASvqFj7sPmx/Jw7Wg==","time":1537726019211,"size":1232440}
|
||||
@ -51,7 +51,7 @@ const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap
|
||||
const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
|
||||
const vendorIdenttiy = "";
|
||||
// serviceProvider
|
||||
const apiurl = "http://localhost/sparqapi/api/";
|
||||
const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
|
||||
@Injectable({
|
||||
providedIn: "root"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import * as AWS from "aws-sdk";
|
||||
import { CanActivateChild, Router } from '@angular/router';
|
||||
import {
|
||||
AuthenticationDetails,
|
||||
CognitoUserPool,
|
||||
@ -37,7 +38,7 @@ const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap
|
||||
const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
|
||||
const vendorIdenttiy = "";
|
||||
// serviceProvider
|
||||
const apiurl = "http://localhost/sparqapi/api/";
|
||||
const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
export interface Callback {
|
||||
callback(): void;
|
||||
|
||||
@ -47,7 +48,7 @@ export interface Callback {
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CognitoService {
|
||||
export class CognitoService implements CanActivateChild {
|
||||
// public static _REGION = environment.region;
|
||||
|
||||
// public static _IDENTITY_POOL_ID = environment.identityPoolId;
|
||||
@ -58,6 +59,16 @@ export class CognitoService {
|
||||
// UserPoolId: CognitoService._USER_POOL_ID,
|
||||
// ClientId: CognitoService._CLIENT_ID
|
||||
// };
|
||||
canActivateChild(){
|
||||
if(this.getToken()){
|
||||
//alert('session valid')
|
||||
return true;
|
||||
}else{
|
||||
this.route.navigate(['/authentication/login']);
|
||||
//alert('session valid timeout');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public cognitoCreds: AWS.CognitoIdentityCredentials;
|
||||
isloggin:boolean = false;
|
||||
@ -73,7 +84,7 @@ isloggin:boolean = false;
|
||||
getCurrentUser() {
|
||||
return sineedgedevUserpool.getCurrentUser();
|
||||
}
|
||||
constructor() { }
|
||||
constructor(public route:Router) { }
|
||||
|
||||
// getAccessToken(callback: Callback): void {
|
||||
// if (callback == null) {
|
||||
|
||||
@ -2,7 +2,7 @@ import { Routes } from '@angular/router';
|
||||
|
||||
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
|
||||
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
|
||||
|
||||
import { CognitoService} from './AwsService/cognito.service';
|
||||
export const AppRoutes: Routes = [{
|
||||
path: '',
|
||||
redirectTo: 'home',
|
||||
@ -10,6 +10,7 @@ export const AppRoutes: Routes = [{
|
||||
}, {
|
||||
path: '',
|
||||
component: AdminLayoutComponent,
|
||||
canActivateChild:[CognitoService],
|
||||
children: [{
|
||||
path: 'home',
|
||||
loadChildren: './dashboard/dashboard.module#DashboardModule'
|
||||
|
||||
@ -1,9 +1,19 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators } from '@angular/forms';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { Branch,States,City } from '../../../model/branch';
|
||||
import { Observable } from 'rxjs/Observable';//for Datatables
|
||||
/** Model */
|
||||
import { Branch,City } from '../../../model/branch';
|
||||
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
@ -13,7 +23,6 @@ import { Observable } from 'rxjs/Observable';//for Datatables
|
||||
|
||||
export class BranchDialogComponent implements OnInit {
|
||||
|
||||
|
||||
public _branchForm: FormGroup;
|
||||
|
||||
citydatas: City[];
|
||||
@ -27,23 +36,24 @@ export class BranchDialogComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._branchForm = this._formBuilder.group({
|
||||
branch_id: [this.data.branch_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
fk_city_id: [this.data.fk_city_id, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._branchForm);
|
||||
/** Branch Form Datas*/
|
||||
this._branchForm = this._formBuilder.group({
|
||||
branch_id: [this.data.branch_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
fk_city_id: [this.data.fk_city_id, Validators.compose([Validators.required])]
|
||||
});
|
||||
|
||||
this._mastersService.getAllMasterData('CITY')
|
||||
.subscribe(
|
||||
data => {
|
||||
|
||||
if (data.status == 200) {
|
||||
this.citydatas = data.records;
|
||||
this.citydatas = this.citydatas.filter(city=>city.isactive == 1 );
|
||||
}
|
||||
|
||||
}, error => this.errorMessage = <any> error);
|
||||
/** For SelectDrop Datas*/
|
||||
this._mastersService.getAllMasterData('CITY')
|
||||
.subscribe(
|
||||
data => {
|
||||
|
||||
if (data.status == 200) {
|
||||
this.citydatas = data.records;
|
||||
this.citydatas = this.citydatas.filter(city=>city.isactive == 1 );
|
||||
}
|
||||
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
}
|
||||
|
||||
@ -56,25 +66,46 @@ export class BranchDialogComponent implements OnInit {
|
||||
onSubmit() {
|
||||
|
||||
var BranchFormValues = this._branchForm.value;
|
||||
|
||||
|
||||
if(isNaN(this.data.branch_id)) {
|
||||
|
||||
Object.keys(BranchFormValues)
|
||||
.forEach((key) => ( BranchFormValues[key] == null) && delete BranchFormValues[key]);
|
||||
//console.log(BranchFormValues);
|
||||
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(data=>{
|
||||
// alert(1);
|
||||
// console.log(data);
|
||||
this._mastersService.getAllBranch();
|
||||
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(BranchFormValues).forEach((key) => (BranchFormValues[key] == null) && delete BranchFormValues[key]);
|
||||
|
||||
//Add BRANCH data with help Service File
|
||||
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(
|
||||
dataresult=>{ if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
alert("sample alert for Saving");
|
||||
}
|
||||
else{
|
||||
alert("Some Thing Wents Wrong Try Again !");
|
||||
}
|
||||
|
||||
this.dialogRef.close();
|
||||
});
|
||||
// this.dialogRef.close();
|
||||
//alert("saved");
|
||||
} else {
|
||||
this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe();
|
||||
|
||||
//After Saving the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//alert("edited");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe(
|
||||
dataresult=>{ if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
alert("sample alert for edited");
|
||||
}
|
||||
else{
|
||||
console.log("");
|
||||
alert("Some Thing Wents Wrong Try Again !");
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
//After Editing the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,12 +2,9 @@
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addBranch()"> + Add Branch</button>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div *ngIf="!noRecordFound" class="example-container mat-elevation-z8">
|
||||
<div class="example-header">
|
||||
<mat-form-field>
|
||||
@ -17,22 +14,28 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="BranchName">
|
||||
<!-- <ng-container matColumnDef="branch_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Branch ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.branch_id}} </mat-cell>
|
||||
</ng-container> -->
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Branch Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
<!-- <mat-cell *matCellDef="let row">{{row.branch_id.toString() + ' ' + row.name.toString()}} </mat-cell> -->
|
||||
<mat-cell *matCellDef="let row">{{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="CityName">
|
||||
<ng-container matColumnDef="cityname">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> City Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.cityname}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<!--{{row.isactive}}-->
|
||||
@ -43,7 +46,7 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editBranch(row)"><mat-icon>edit</mat-icon></button>
|
||||
@ -62,7 +65,9 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
<!-- <p *ngIf="dataSource.length === 0">No records found</p> -->
|
||||
@ -115,4 +115,14 @@ padding-left: 6px;
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
//display:flex;
|
||||
//justify-content:center;
|
||||
// min-height: 56px;
|
||||
// max-height: 56px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,91 +1,68 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import 'rxjs/add/operator/map';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { DataSource } from '@angular/cdk/table';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { BranchDialogComponent } from '../branch-dialog/branch-dialog.component';
|
||||
import { Branch,States,City } from '../../../model/branch';
|
||||
/** Model */
|
||||
import { Branch } from '../../../model/branch';
|
||||
|
||||
@Component({
|
||||
selector: 'app-branch-list',
|
||||
templateUrl: './branch-list.component.html',
|
||||
styleUrls: ['./branch-list.component.scss']
|
||||
})
|
||||
export class BranchListComponent implements OnInit {
|
||||
|
||||
export class BranchListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
noRecordFound: boolean = false;
|
||||
BranchList: any = [];
|
||||
userData = null;
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
|
||||
//displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name','cityname','isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _mastersService: MastersService) {
|
||||
this.getBranch();
|
||||
// this._mastersService.getAllBranch().subscribe(
|
||||
// data => {
|
||||
// this.userData = data.records;
|
||||
// // alert(this.userData);
|
||||
// if(data.records === ''){
|
||||
// this.dataLength = data.records.length;
|
||||
// }else{
|
||||
// this.dataLength = 0}
|
||||
// this.dataSource.data = this.userData;
|
||||
// }
|
||||
// )
|
||||
|
||||
|
||||
// this._mastersService.getAllBranch().subscribe(dataresult =>{
|
||||
// this.dataLength = dataresult.records.length;
|
||||
// alert(this.dataLength);
|
||||
|
||||
// this.dataSource = dataresult.records;
|
||||
|
||||
// })
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.getBranch();
|
||||
}
|
||||
noRecordFound: boolean = false;
|
||||
ngOnInit() {}
|
||||
|
||||
/**To List for Branch Datas */
|
||||
getBranch(){
|
||||
this._mastersService.getAllBranch().subscribe(
|
||||
data => {
|
||||
// alert(this.userData);
|
||||
if(data.status === 200){
|
||||
this._mastersService.getAllBranch()
|
||||
.subscribe(dataresult => {
|
||||
if(dataresult.status === 200){
|
||||
this.noRecordFound = false;
|
||||
this.userData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.userData = dataresult.records;
|
||||
this.dataLength = dataresult.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
this.dataLength = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**Popup for ADD Branch */
|
||||
addBranch() {
|
||||
this.isPopupOpened = true;
|
||||
@ -93,9 +70,10 @@ export class BranchListComponent implements OnInit {
|
||||
data: {}
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getBranch();
|
||||
this.isPopupOpened = false;
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getBranch();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
@ -107,9 +85,10 @@ export class BranchListComponent implements OnInit {
|
||||
data: arr
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getBranch();
|
||||
this.isPopupOpened = false;
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getBranch();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
@ -117,23 +96,25 @@ export class BranchListComponent implements OnInit {
|
||||
/** To delete Branch Datas */
|
||||
deleteBranch(id: number) {
|
||||
var PrimaryKeyWithValue ={'branch_id':id};
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH').subscribe(data=>{
|
||||
this.getBranch();
|
||||
});
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH')
|
||||
.subscribe(dataresult=>{});
|
||||
alert('Deleted');
|
||||
this.getBranch();
|
||||
|
||||
}
|
||||
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/** To set the All Branch value as Data sources with help of connect() */
|
||||
/** End of BranchListComponent */
|
||||
@ -1,9 +1,17 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { States } from '../../../model/states';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Model */
|
||||
import { States } from '../../../model/states';
|
||||
@Component({
|
||||
selector: 'app-jazz-dialog',
|
||||
templateUrl: './city-dialog.component.html',
|
||||
@ -19,29 +27,24 @@ export class CityDialogComponent implements OnInit {
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CityDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
private _mastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._cityForm = this._formBuilder.group({
|
||||
//City_id: any; fk_city_id: any;
|
||||
|
||||
/** City Form Datas*/
|
||||
this._cityForm = this._formBuilder.group({
|
||||
city_id: [this.data.city_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
fk_state_id: [this.data.fk_state_id, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._cityForm);
|
||||
|
||||
this._MastersService.getAllMasterData('STATE')
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.stateDatas = data.records;
|
||||
this._mastersService.getAllMasterData('STATE')
|
||||
.subscribe(
|
||||
dataresult => {
|
||||
if (dataresult.status == 200) {
|
||||
this.stateDatas = dataresult.records;
|
||||
this.stateDatas = this.stateDatas.filter(city=>city.isactive == 1 );
|
||||
}
|
||||
|
||||
@ -49,6 +52,12 @@ export class CityDialogComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
|
||||
// onSubmit() {
|
||||
// if (isNaN(this.data.ID)) {
|
||||
// this._MastersService.addCity(this._cityForm.value);
|
||||
@ -59,25 +68,32 @@ export class CityDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var CityFormValues = this._cityForm.value;
|
||||
if(isNaN(this.data.city_id)) {
|
||||
var my_array = this._cityForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'CITY').subscribe();
|
||||
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(CityFormValues).forEach((key) => ( CityFormValues[key] == null) && delete CityFormValues[key]);
|
||||
|
||||
this._mastersService.addMasterDetails(CityFormValues,'CITY').subscribe();
|
||||
|
||||
//After Saving the CITY data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Display saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._cityForm.value,'CITY').subscribe();
|
||||
this._mastersService.editMasterDetails(CityFormValues,'CITY').subscribe();
|
||||
//After Editing the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Edited Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._cityForm.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,7 @@
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
</div>
|
||||
<!-- displayedColumns = ['city_id','name', 'fk_state_id','state_name' , 'isactive','actions'];
|
||||
<div *ngIf="!noRecordFound" class="example-container mat-elevation-z8">
|
||||
<table>
|
||||
@ -82,22 +82,22 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="CityName">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> City Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="StateName">
|
||||
<ng-container matColumnDef="state_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> State Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.state_name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -105,7 +105,7 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCity(row)"><mat-icon>edit</mat-icon></button>
|
||||
@ -121,5 +121,6 @@
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
</mat-card-content>
|
||||
@ -87,4 +87,10 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,17 +1,21 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { CityDialogComponent } from '../city-dialog/city-dialog.component';
|
||||
/** Model */
|
||||
import { City } from '../../../model/city';
|
||||
|
||||
@Component({
|
||||
@ -21,32 +25,46 @@ import { City } from '../../../model/city';
|
||||
})
|
||||
export class CityListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
CityList: any = [];
|
||||
|
||||
|
||||
|
||||
userData = null;
|
||||
noRecordFound: boolean = false;
|
||||
CityList: any = [];
|
||||
userData = null;
|
||||
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','CityName','StateName', 'IsActive','Actions'];
|
||||
|
||||
//displayedColumns = ['SerialNo','CityName','StateName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name','state_name','isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) {
|
||||
this.getCity();
|
||||
private _mastersService: MastersService) {
|
||||
this.getCity();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//this.getCity();
|
||||
ngOnInit() {}
|
||||
|
||||
/**To List for City Datas */
|
||||
getCity() {
|
||||
this._mastersService.getAllCity().subscribe(
|
||||
dataresult => {
|
||||
if(dataresult.status === 200){
|
||||
this.noRecordFound = false;
|
||||
this.userData = dataresult.records;
|
||||
this.dataLength = dataresult.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**Popup for ADD City */
|
||||
addCity() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CityDialogComponent, {
|
||||
@ -54,12 +72,14 @@ export class CityListComponent implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getCity();
|
||||
this.isPopupOpened = false;
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getCity();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** Popup for EDIT City */
|
||||
editCity(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCity().find(c => c.ID === id);
|
||||
@ -68,48 +88,35 @@ export class CityListComponent implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getCity();
|
||||
this.isPopupOpened = false;
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getCity();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCity() {
|
||||
this._MastersService.getAllCity().subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
this.noRecordFound = false;
|
||||
this.userData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/** To delete City Datas */
|
||||
deleteCity(id: number) {
|
||||
var PrimaryKeyWithValue ={'city_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CITY').subscribe(data=>{
|
||||
this.getCity();
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'CITY')
|
||||
.subscribe(dataresult=>{
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
this.getCity();
|
||||
}
|
||||
|
||||
connect(): Observable<City[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCity();
|
||||
return this._bs.getAllMasterData('CITY');
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,6 +1,16 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators } from '@angular/forms';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@ -16,43 +26,46 @@ export class CommentsOnLocalityDialogComponent implements OnInit {
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CommentsOnLocalityDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
private _mastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** Comment On Locality Form Datas*/
|
||||
this._CommentOnLocalityForm = this._formBuilder.group({
|
||||
//branch_id: any; fk_city_id: any;
|
||||
comments_on_locality_id: [this.data.comments_on_locality_id],
|
||||
rating: [this.data.rating, Validators.compose([Validators.required])],
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var CommentOnLocalityForm = this._CommentOnLocalityForm.value;
|
||||
if(isNaN(this.data.comments_on_locality_id)) {
|
||||
var my_array = this._CommentOnLocalityForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'COMMENTSONLOCALITY').subscribe();
|
||||
|
||||
Object.keys(CommentOnLocalityForm).forEach((key) => ( CommentOnLocalityForm[key] == null) && delete CommentOnLocalityForm[key]);
|
||||
//After Saving the Comment On Locality data then popup close
|
||||
this._mastersService.addMasterDetails(CommentOnLocalityForm,'COMMENTSONLOCALITY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe();
|
||||
this._mastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe();
|
||||
//After Editing the Comment On Locality data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Edited Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._CommentOnLocalityForm.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,17 +72,17 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="CommentsOnLocalityName">
|
||||
<ng-container matColumnDef="rating">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Comments On Locality Rating </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.rating}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -90,11 +90,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCommentsOnLocality(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCommentsOnLocality(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCommentsOnLocality(row.comments_on_locality_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div><div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card-content>
|
||||
@ -111,3 +111,8 @@
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,20 +1,21 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { CommentsOnLocalityDialogComponent } from '../comments-on-locality-dialog/comments-on-locality-dialog.component';
|
||||
/** Model */
|
||||
import { CommentsOnLocality } from '../../../model/comments-on-locality';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-comments-on-locality-list',
|
||||
templateUrl: './comments-on-locality-list.component.html',
|
||||
@ -22,69 +23,33 @@ import { CommentsOnLocality } from '../../../model/comments-on-locality';
|
||||
})
|
||||
export class CommentsOnLocalityListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
CommentsOnLocalityList: any = [];
|
||||
noRecordFound: boolean = false;
|
||||
|
||||
|
||||
|
||||
CommentsOnLocalityList: any = [];
|
||||
userData = null;
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','CommentsOnLocalityName', 'IsActive','Actions'];
|
||||
//displayedColumns = ['SerialNo','CommentsOnLocalityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','rating','isactive','actions'];
|
||||
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) {
|
||||
this.getCommentsOnLocality();
|
||||
}
|
||||
private _mastersService: MastersService) {
|
||||
this.getCommentsOnLocality();
|
||||
}
|
||||
|
||||
// get CommentsOnLocalityList() {
|
||||
// return this._MastersService.getAllCommentsOnLocality();
|
||||
// }
|
||||
|
||||
// dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
//this.getCommentsOnLocality();
|
||||
}
|
||||
|
||||
|
||||
addCommentsOnLocality() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getCommentsOnLocality();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCommentsOnLocality(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCommentsOnLocality().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getCommentsOnLocality();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
//To get data for listing
|
||||
getCommentsOnLocality() {
|
||||
this._MastersService.getAllMasterData('COMMENTSONLOCALITY').subscribe(
|
||||
getCommentsOnLocality() {
|
||||
this._mastersService.getAllMasterData('COMMENTSONLOCALITY').subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
this.noRecordFound = false;
|
||||
@ -98,27 +63,57 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
addCommentsOnLocality() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(dataresult => {
|
||||
this.getCommentsOnLocality();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCommentsOnLocality(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCommentsOnLocality().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(dataresult => {
|
||||
this.getCommentsOnLocality();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
deleteCommentsOnLocality(id: number) {
|
||||
var PrimaryKeyWithValue ={'comments_on_locality_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMMENTSONLOCALITY').subscribe(data=>{
|
||||
this.getCommentsOnLocality();
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMMENTSONLOCALITY').subscribe(dataresult=>{
|
||||
|
||||
});
|
||||
this.getCommentsOnLocality();
|
||||
//this._MastersService.deleteMasterDetails('',id,'');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<CommentsOnLocality []> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCommentsOnLocality();
|
||||
return this._bs.getAllMasterData('COMMENTSONLOCALITY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
/** End of CommentsOnLocalityListComponent */
|
||||
@ -26,7 +26,7 @@ fxLayoutAlign="center">
|
||||
|
||||
|
||||
|
||||
<form [formGroup]="_companyForm" (ngsubmit)="onSubmit()">
|
||||
<form [formGroup]="_companyForm" (submit)="onSubmit()">
|
||||
|
||||
<div class="form-group">
|
||||
<mat-dialog-content>
|
||||
@ -66,7 +66,7 @@ fxLayoutAlign="center">
|
||||
|
||||
</div> -->
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<!-- <ngx-select-dropdown [multiple]="false" [value]="citydatas.city_id" [options]="citydatas" ></ngx-select-dropdown> -->
|
||||
<mat-select placeholder="Pick Up City name" required [formControl]="_companyForm.controls['city']">
|
||||
<!-- <mat-option (click)="onChangedData()" *ngFor="let masters of masterArray" [value]="masters.value" [disabled]="masters.disabled"> -->
|
||||
@ -88,7 +88,7 @@ fxLayoutAlign="center">
|
||||
|
||||
</div>
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Pick Up State Name" required [formControl]="_companyForm.controls['state']">
|
||||
<mat-option *ngFor="let sd of stateDatas" [value]="sd.state_id">{{ sd.name }}</mat-option>
|
||||
</mat-select>
|
||||
|
||||
@ -1,10 +1,18 @@
|
||||
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { FileUploader } from 'ng2-file-upload/ng2-file-upload';
|
||||
//import { CompanyService } from '../../../service/company.service';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
import { FileUploader } from 'ng2-file-upload/ng2-file-upload';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -24,19 +32,16 @@ export class CompanyDialogComponent implements OnInit {
|
||||
|
||||
constructor(private _formBuilder: FormBuilder,
|
||||
private dialogRef: MatDialogRef<CompanyDialogComponent>,
|
||||
private _masterService: MastersService,
|
||||
private _mastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._companyForm = this._formBuilder.group({
|
||||
//Company_id: any; fk_city_id: any;
|
||||
// <!-- displayedColumns = ['company_id', 'name', 'addressline1', 'addressline2','addressline3', 'city', 'state', 'pincode', 'logo']; -->
|
||||
company_id: [this.data.company_id],
|
||||
company_id: [this.data.company_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
addressline1: [this.data.addressline1, Validators.compose([Validators.required])],
|
||||
addressline2: [this.data.addressline2, Validators.compose([Validators.required])],
|
||||
@ -47,7 +52,7 @@ export class CompanyDialogComponent implements OnInit {
|
||||
// logo : [this.data.logo]
|
||||
});
|
||||
|
||||
this._masterService.getAllMasterData('STATE')
|
||||
this._mastersService.getAllMasterData('STATE')
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
@ -57,7 +62,7 @@ export class CompanyDialogComponent implements OnInit {
|
||||
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
this._masterService.getAllMasterData('CITY')
|
||||
this._mastersService.getAllMasterData('CITY')
|
||||
.subscribe(
|
||||
data => {
|
||||
|
||||
@ -68,6 +73,11 @@ export class CompanyDialogComponent implements OnInit {
|
||||
|
||||
|
||||
}
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
// onFileChange($event) {
|
||||
// //console.log($event.target.files[0]);
|
||||
|
||||
@ -86,26 +96,34 @@ export class CompanyDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
if (this.files) {
|
||||
this.data.logo = this.files;
|
||||
}
|
||||
if(isNaN(this.data.company_id)) {
|
||||
var my_array = this._companyForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._masterService.addMasterDetails(my_array,'COMPANY').subscribe();
|
||||
var CompanyFormValue = this._companyForm.value;
|
||||
console.log(CompanyFormValue);
|
||||
// if (this.files) {
|
||||
// this.data.logo = this.files;
|
||||
// }
|
||||
if(isNaN(this.data .company_id)) {
|
||||
console.log(CompanyFormValue);
|
||||
Object.keys(CompanyFormValue).forEach((key) => ( CompanyFormValue[key] == null) && delete CompanyFormValue[key]);
|
||||
console.log(CompanyFormValue);
|
||||
//After Saving the Company data then popup close
|
||||
this._mastersService.addMasterDetails(CompanyFormValue,'COMPANY').subscribe();
|
||||
//this._mastersService.addCompanyDetails(CompanyFormValue,'COMPANY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._masterService.editMasterDetails(this._companyForm.value,'COMPANY').subscribe();
|
||||
this._mastersService.editMasterDetails(CompanyFormValue,'COMPANY').subscribe();
|
||||
//After Editing the Company data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Display saving Datas
|
||||
alert("Edited Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
|
||||
onReset(){
|
||||
this._companyForm.reset();
|
||||
|
||||
@ -104,27 +104,27 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Name">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Company Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="City">
|
||||
<ng-container matColumnDef="city_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> City Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.city_name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="State">
|
||||
<ng-container matColumnDef="state_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> State Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.state_name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Action">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCompany(row)"><mat-icon>edit</mat-icon></button>
|
||||
@ -137,6 +137,8 @@
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div><div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
</div>
|
||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
</mat-card-content>
|
||||
@ -110,4 +110,9 @@
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,14 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
@ -21,15 +30,16 @@ import { MastersService } from '../../../../service/masters/masters.service';
|
||||
styleUrls: ['./company-list.component.scss']
|
||||
})
|
||||
export class CompanyListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
noRecordFound: boolean = false;
|
||||
CompanyList: any = [];
|
||||
userData = null;
|
||||
noRecordFound: boolean = false;
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo', 'Name', 'City', 'State' , 'Action'];
|
||||
displayedColumns = ['serialno', 'name', 'city_name', 'state_name' , 'actions'];
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
@ -46,11 +56,27 @@ export class CompanyListComponent implements OnInit {
|
||||
|
||||
//dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
//this.getCompany();
|
||||
ngOnInit() {}
|
||||
|
||||
//To get data for listing
|
||||
getCompany() {
|
||||
this._MastersService.getAllCompany().subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
this.noRecordFound = false;
|
||||
this.userData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**Popup for ADD company */
|
||||
addCompany() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CompanyDialogComponent, {
|
||||
@ -78,43 +104,24 @@ export class CompanyListComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCompany() {
|
||||
this._MastersService.getAllCompany().subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
this.noRecordFound = false;
|
||||
this.userData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
deleteCompany(id: number) {
|
||||
var PrimaryKeyWithValue ={'company_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMPANY').subscribe(result => {
|
||||
this.getCompany();
|
||||
});
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMPANY').subscribe(result => {});
|
||||
this.getCompany();
|
||||
//this._MastersService.deleteMasterDetails('company_id',id,'COMPANY');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
connect(): Observable<Company[]> {
|
||||
//return this.userService.getUser();
|
||||
return this._bs.getAllCompany();
|
||||
//return this._bs.getAllMasterData('COMPANY');
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@ -18,20 +26,18 @@ export class CustomerBehaviourDialogComponent implements OnInit {
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** Customer Behaviour Form Datas*/
|
||||
this._customerBehaviourForm = this._formBuilder.group({
|
||||
//branch_id: any; fk_city_id: any;
|
||||
customer_behaviour_id: [this.data.customer_behaviour_id],
|
||||
description: [this.data.description, Validators.compose([Validators.required])]
|
||||
|
||||
description: [this.data.description, Validators.compose([Validators.required])]
|
||||
});
|
||||
//customer_behaviour_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
//console.log(this._customerBehaviourForm);
|
||||
//console.log(this._customerBehaviourForm);
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
@ -43,25 +49,35 @@ export class CustomerBehaviourDialogComponent implements OnInit {
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var CustomerBehaviourFormValues = this._customerBehaviourForm.value;
|
||||
|
||||
if(isNaN(this.data.customer_behaviour_id)) {
|
||||
var my_array = this._customerBehaviourForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'CUSTOMERBEHAVIOUR').subscribe();
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(CustomerBehaviourFormValues).forEach((key) => ( CustomerBehaviourFormValues[key] == null) && delete CustomerBehaviourFormValues[key]);
|
||||
//console.log(CustomerBehaviourFormValues);
|
||||
this._MastersService.addMasterDetails(CustomerBehaviourFormValues,'CUSTOMERBEHAVIOUR').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._customerBehaviourForm.reset();
|
||||
}
|
||||
|
||||
@ -71,17 +71,17 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Description">
|
||||
<ng-container matColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Description </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -89,7 +89,7 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerBehaviour(row)"><mat-icon>edit</mat-icon></button>
|
||||
@ -104,7 +104,8 @@
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
@ -110,4 +110,10 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,17 +1,19 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { CustomerBehaviourDialogComponent } from '../customer-behaviour-dialog/customer-behaviour-dialog.component';
|
||||
/** Model */
|
||||
import { CustomerBehaviour } from '../../../model/customer-behaviour';
|
||||
|
||||
|
||||
@ -22,7 +24,7 @@ import { CustomerBehaviour } from '../../../model/customer-behaviour';
|
||||
})
|
||||
export class CustomerBehaviourListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
CustomerBehaviourList: any = [];
|
||||
noRecordFound: boolean = false;
|
||||
@ -31,7 +33,7 @@ export class CustomerBehaviourListComponent implements OnInit {
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
|
||||
displayedColumns = ['SerialNo','Description', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','description', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -44,38 +46,10 @@ export class CustomerBehaviourListComponent implements OnInit {
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
//this.getCustomerBehaviour();
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
|
||||
addCustomerBehaviour() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
editCustomerBehaviour(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCustomerBehaviour().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getCustomerBehaviour() {
|
||||
/** To get data for listing */
|
||||
getCustomerBehaviour() {
|
||||
this._MastersService.getAllMasterData('CUSTOMERBEHAVIOUR').subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
@ -90,27 +64,57 @@ export class CustomerBehaviourListComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
/**Popup for ADD */
|
||||
addCustomerBehaviour() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, {
|
||||
data: {}
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getCustomerBehaviour();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**Popup for Edit */
|
||||
editCustomerBehaviour(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllCustomerBehaviour().find(c => c.ID === id);
|
||||
const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, {
|
||||
data: arr
|
||||
});
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getCustomerBehaviour();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
deleteCustomerBehaviour(id: number) {
|
||||
var PrimaryKeyWithValue ={'customer_behaviour_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CUSTOMERBEHAVIOUR').subscribe(result => {
|
||||
this.getCustomerBehaviour();
|
||||
|
||||
});
|
||||
this.getCustomerBehaviour();
|
||||
//this._MastersService.deleteMasterDetails('customer_behaviour_id',id,'CUSTOMERBEHAVIOUR');
|
||||
}
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<CustomerBehaviour[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCustomerBehaviour();
|
||||
return this._bs.getAllMasterData('CUSTOMERBEHAVIOUR');
|
||||
}
|
||||
disconnect() {}
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
}
|
||||
/** End of ListComponent */
|
||||
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@ -18,15 +26,13 @@ export class CustomerSegmentDialogComponent implements OnInit {
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** Customer Segment Datas */
|
||||
this._customerSegmentForm = this._formBuilder.group({
|
||||
//CustomerSegment_id: any; fk_city_id: any;
|
||||
customer_segment_id: [this.data.customer_segment_id],
|
||||
|
||||
customer_segment_id: [this.data.customer_segment_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
abbr: [this.data.abbr, Validators.compose([Validators.required])]
|
||||
});
|
||||
@ -44,31 +50,36 @@ export class CustomerSegmentDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var CustomerSegmentFormValues = this._customerSegmentForm.value;
|
||||
if(isNaN(this.data.customer_segment_id)) {
|
||||
var my_array = this._customerSegmentForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'CUSTOMERSEGMENT').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(CustomerSegmentFormValues).forEach((key) => ( CustomerSegmentFormValues[key] == null) && delete CustomerSegmentFormValues[key]);
|
||||
//console.log(CustomerSegmentFormValues);
|
||||
this._MastersService.addMasterDetails(CustomerSegmentFormValues,'CUSTOMERSEGMENT').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._customerSegmentForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -76,17 +76,17 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="CustomerSegmentName">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Customer Segment</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -94,7 +94,7 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerSegment(row)"><mat-icon>edit</mat-icon></button>
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
@ -111,4 +111,9 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,17 +1,19 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { CustomerSegmentDialogComponent } from '../customer-segment-dialog/customer-segment-dialog.component';
|
||||
/** Model */
|
||||
import { CustomerSegment } from '../../../model/customer-segment';
|
||||
|
||||
|
||||
@ -21,7 +23,7 @@ import { CustomerSegment } from '../../../model/customer-segment';
|
||||
styleUrls: ['./customer-segment-list.component.scss']
|
||||
})
|
||||
export class CustomerSegmentListComponent implements OnInit {
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
CustomerSegmentList: any = [];
|
||||
noRecordFound: boolean = false;
|
||||
@ -32,7 +34,7 @@ export class CustomerSegmentListComponent implements OnInit {
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['SerialNo','CustomerSegmentName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -44,16 +46,10 @@ displayedColumns = ['SerialNo','CustomerSegmentName', 'IsActive','Actions'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
// get CustomerSegmentList() {
|
||||
// return this._MastersService.getAllCustomerSegment();
|
||||
// }
|
||||
|
||||
//dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit() {}
|
||||
// this.getCustomerSegment();
|
||||
}
|
||||
|
||||
|
||||
|
||||
addCustomerSegment() {
|
||||
@ -98,27 +94,27 @@ displayedColumns = ['SerialNo','CustomerSegmentName', 'IsActive','Actions'];
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** To delete CustomerSegment Datas */
|
||||
deleteCustomerSegment(id: number) {
|
||||
var PrimaryKeyWithValue ={'customer_segment_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CUSTOMERSEGMENT').subscribe(result => {
|
||||
this.getCustomerSegment();
|
||||
|
||||
});
|
||||
this.getCustomerSegment();
|
||||
//this._MastersService.deleteMasterDetails('customer_segment_id',id,'CUSTOMERSEGMENT');
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
connect(): Observable<CustomerSegment[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllCustomerSegment();
|
||||
return this._bs.getAllMasterData('CUSTOMERSEGMENT');
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
disconnect() {}
|
||||
|
||||
}
|
||||
/** End of ListComponent */
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@ -18,14 +26,12 @@ export class DesignationDialogComponent implements OnInit {
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** Designation Form Datas */
|
||||
this._designationForm = this._formBuilder.group({
|
||||
//Designation_id: any; fk_city_id: any;
|
||||
|
||||
designation_id: [this.data.designation_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
short_name: [this.data.short_name, Validators.compose([Validators.required])]
|
||||
@ -43,31 +49,35 @@ export class DesignationDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var DesignationFormValues = this._designationForm.value;
|
||||
if(isNaN(this.data.designation_id)) {
|
||||
var my_array = this._designationForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'DESIGNATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
|
||||
Object.keys(DesignationFormValues).forEach((key) => ( DesignationFormValues[key] == null) && delete DesignationFormValues[key]);
|
||||
console.log(DesignationFormValues);
|
||||
this._MastersService.addMasterDetails(DesignationFormValues,'DESIGNATION').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._designationForm.value,'DESIGNATION').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._designationForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -76,17 +76,17 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="DesignationName">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Designation Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -94,11 +94,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editDesignation(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteDesignation(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteDesignation(row.designation_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -110,6 +110,6 @@
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
@ -113,3 +113,8 @@
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,17 +1,19 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { DesignationDialogComponent } from '../designation-dialog/designation-dialog.component';
|
||||
/** Model */
|
||||
import { Designation } from '../../../model/designation';
|
||||
|
||||
|
||||
@ -22,16 +24,16 @@ import { Designation } from '../../../model/designation';
|
||||
})
|
||||
export class DesignationListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
noRecordFound: boolean = false;
|
||||
DesignationList: any = [];
|
||||
|
||||
userData = null;
|
||||
noRecordFound: boolean = false;
|
||||
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','DesignationName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -44,11 +46,9 @@ export class DesignationListComponent implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
//this.getDesignation();
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
/**Popup for ADD Designation */
|
||||
addDesignation() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(DesignationDialogComponent, {
|
||||
@ -62,6 +62,7 @@ export class DesignationListComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
/** Popup for EDIT Designation */
|
||||
editDesignation(arr: any[]) {
|
||||
this.isPopupOpened = true;
|
||||
//const contact = this._MastersService.getAllDesignation().find(c => c.ID === id);
|
||||
@ -95,21 +96,21 @@ export class DesignationListComponent implements OnInit {
|
||||
deleteDesignation(id: number) {
|
||||
var PrimaryKeyWithValue ={'designation_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'DESIGNATION')
|
||||
.subscribe( data => { this.getDesignation();})
|
||||
.subscribe( data => { });
|
||||
this.getDesignation();
|
||||
}
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<Designation[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllDesignation();
|
||||
return this._bs.getAllMasterData('DESIGNATION');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
/** End of ListComponent */
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
@ -19,12 +26,9 @@ export class FrequencyDialogComponent implements OnInit {
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/**FrequencyForm Datas*/
|
||||
this._frequencyForm = this._formBuilder.group({
|
||||
frequency_id: [this.data.frequency_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])]
|
||||
@ -32,18 +36,30 @@ export class FrequencyDialogComponent implements OnInit {
|
||||
//console.log(this._frequencyForm);
|
||||
}
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var FrequencyFormValues = this._frequencyForm.value;
|
||||
if(isNaN(this.data.frequency_id)) {
|
||||
var my_array = this._frequencyForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'FREQUENCY').subscribe();
|
||||
|
||||
Object.keys(FrequencyFormValues).forEach((key) => ( FrequencyFormValues[key] == null) && delete FrequencyFormValues[key]);
|
||||
//console.log(FrequencyFormValues);
|
||||
this._MastersService.addMasterDetails(FrequencyFormValues,'FREQUENCY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//After Saving the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,6 +73,7 @@ export class FrequencyDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._frequencyForm.reset();
|
||||
}
|
||||
|
||||
@ -85,17 +85,17 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="FrequencyName">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Frequency Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -103,11 +103,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editFrequency(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteFrequency(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteFrequency(row.frequency_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -142,4 +142,8 @@ th {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@ -1,17 +1,20 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { FrequencyDialogComponent }from '../frequency-dialog/frequency-dialog.component';
|
||||
/** Model */
|
||||
import { Frequency } from '../../../model/frequency';
|
||||
|
||||
|
||||
@ -22,7 +25,7 @@ import { Frequency } from '../../../model/frequency';
|
||||
})
|
||||
export class FrequencyListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
FrequencyList: any = [];
|
||||
noRecordFound: boolean = false;
|
||||
@ -33,7 +36,7 @@ export class FrequencyListComponent implements OnInit {
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['SerialNo','FrequencyName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -102,24 +105,24 @@ export class FrequencyListComponent implements OnInit {
|
||||
deleteFrequency(id: number) {
|
||||
var PrimaryKeyWithValue ={'frequency_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'FREQUENCY')
|
||||
.subscribe( data => { this.getFrequency();})
|
||||
.subscribe( data => { });
|
||||
this.getFrequency();
|
||||
// this._MastersService.deleteMasterDetails('designation_id',id,'DESIGNATION');
|
||||
|
||||
//this._MastersService.deleteMasterDetails('frequency_id',id,'FREQUENCY');
|
||||
}
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
constructor(private _fs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<Frequency[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._fs.getAllFrequency();
|
||||
return this._fs.getAllMasterData('FREQUENCY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
}
|
||||
/** End of BranchListComponent */
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@ -18,12 +26,9 @@ export class IndustryClassificationDialogComponent implements OnInit {
|
||||
private _contactService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** Industry Classification Form Data */
|
||||
this._IndustryClassificationForm = this._formBuilder.group({
|
||||
industry_classification_id: [this.data.industry_classification_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])]
|
||||
@ -42,22 +47,31 @@ export class IndustryClassificationDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var IndustryClassificationFormValues = this._IndustryClassificationForm.value;
|
||||
|
||||
if(isNaN(this.data.industry_classification_id)) {
|
||||
var my_array = this._IndustryClassificationForm.value;
|
||||
Object.keys(my_array).forEach((key) => (my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._contactService.addMasterDetails(my_array,'INDUSTRYCLASSIFICATION').subscribe();
|
||||
|
||||
Object.keys(IndustryClassificationFormValues).forEach((key) => (IndustryClassificationFormValues[key] == null) && delete IndustryClassificationFormValues[key]);
|
||||
// console.log(IndustryClassificationFormValues);
|
||||
this._contactService.addMasterDetails(IndustryClassificationFormValues,'INDUSTRYCLASSIFICATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._IndustryClassificationForm.reset();
|
||||
}
|
||||
|
||||
@ -5,98 +5,28 @@
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div>
|
||||
<!--<div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
<th style="text-align: center;">#</th>
|
||||
|
||||
<th style="text-align: center;">Classification Name</th>
|
||||
<th style="text-align: center;">IsActive</th>
|
||||
<th style="text-align: center;">Action</th>
|
||||
</thead>
|
||||
|
||||
|
||||
<tr *ngIf="IndustryClassificationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||
<tr *ngFor="let IM of IndustryClassificationList ; let i=index">
|
||||
<td style="text-align: center;">{{i+1}}</td>
|
||||
<td style="text-align: center;">{{IM.name}}</td>
|
||||
<td style="text-align: center;">{{IM.isactive}}</td>
|
||||
<td style="text-align: center;">
|
||||
<a (click)="editIndustryClassification(IM)"><mat-icon>edit</mat-icon></a>
|
||||
<a (click)="deleteIndustryClassification(IM.industry_classification_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<div>
|
||||
<!- <mat-table [dataSource]="dataSource"> ->
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="industry_classification_id">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.industry_classification_id}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="createdon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdon </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.createdon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_createdby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> createdby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_createdby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="updatedon">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updated on </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.updatedon}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="fk_updatedby">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> updatedby </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.fk_updatedby}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
|
||||
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||
<mat-cell *matCellDef="let user">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editIndustryClassification(user)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteIndustryClassification(user.industry_classification_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>-->
|
||||
<div *ngIf="!noRecordFound" class="example-container mat-elevation-z8">
|
||||
</div>
|
||||
<div *ngIf="!noRecordFound" class="example-container mat-elevation-z8">
|
||||
|
||||
<div class="example-header">
|
||||
<mat-form-field>
|
||||
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Industry Classification">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Industry Classification Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -104,14 +34,14 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editIndustryClassification(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteIndustryClassification(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteIndustryClassification(row.industry_classification_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
@ -120,5 +50,8 @@
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<!-- <div *ngIf="noRecordFound" class="example-container mat-elevation-z8">
|
||||
<div class="nocontent">No records found</div>
|
||||
</div> -->
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
</mat-card-content>
|
||||
@ -138,3 +138,8 @@ th {
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@ -1,17 +1,20 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { IndustryClassificationDialogComponent } from '../industry_classification-dialog/industry_classification-dialog.component';
|
||||
/** Model */
|
||||
import { IndustryClassification } from '../../../model/industry_classification';
|
||||
|
||||
@Component({
|
||||
@ -28,7 +31,7 @@ import { IndustryClassification } from '../../../model/industry_classification'
|
||||
export class IndustryClassificationListComponent implements OnInit {
|
||||
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
IndustryClassificationList: any = [];
|
||||
|
||||
@ -38,7 +41,7 @@ export class IndustryClassificationListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','Industry Classification', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -58,11 +61,9 @@ export class IndustryClassificationListComponent implements OnInit {
|
||||
//dataSource = new UserDataSource(this._IMService);
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
// this.getIndustryClassification();
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
/**Popup for ADD */
|
||||
addIndustryClassification() {
|
||||
this.isPopupOpened = true;
|
||||
const dialogRef = this.dialog.open(IndustryClassificationDialogComponent, {
|
||||
@ -101,7 +102,7 @@ export class IndustryClassificationListComponent implements OnInit {
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
this.dataLength = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -114,24 +115,23 @@ export class IndustryClassificationListComponent implements OnInit {
|
||||
// console.log('PrimaryKeyWithValue',PrimaryKeyWithValue);
|
||||
//console.log('id',id);
|
||||
this._IMService.deleteMasterDetails(PrimaryKeyWithValue,'INDUSTRYCLASSIFICATION')
|
||||
.subscribe( data => { this.getIndustryClassification();})
|
||||
.subscribe( data => { });
|
||||
this.getIndustryClassification();
|
||||
//this._IMService.deleteMasterDetails('industry_classification_id',id,'INDUSTRYCLASSIFICATION');
|
||||
}
|
||||
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
constructor(private _ims: MastersService ) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<IndustryClassification[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._ims.getAllIndustryClassification();
|
||||
return this._ims.getAllMasterData('INDUSTRYCLASSIFICATION');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
}
|
||||
/** End of ListComponent */
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
@ -17,12 +25,10 @@ export class LenderHierarchyDialogComponent implements OnInit {
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** lender Hierarchy Form Data */
|
||||
this._lenderHierarchyForm = this._formBuilder.group({
|
||||
//Designation_id: any; fk_city_id: any;
|
||||
|
||||
@ -43,31 +49,35 @@ export class LenderHierarchyDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var LenderHierarchyFormValues = this._lenderHierarchyForm.value;
|
||||
if(isNaN(this.data.lender_hierarchy_id)) {
|
||||
var my_array = this._lenderHierarchyForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'LENDERHIERARCHY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
|
||||
Object.keys(LenderHierarchyFormValues).forEach((key) => ( LenderHierarchyFormValues[key] == null) && delete LenderHierarchyFormValues[key]);
|
||||
console.log(LenderHierarchyFormValues);
|
||||
this._MastersService.addMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._lenderHierarchyForm.value,'LENDERHIERARCHY').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
this._MastersService.editMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
|
||||
onReset(){
|
||||
this._lenderHierarchyForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -70,22 +70,22 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="LenderHierarchy">
|
||||
<ng-container matColumnDef="lender_hierarchy">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Lender Hierarchy </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.lender_hierarchy}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="StateName">
|
||||
<ng-container matColumnDef="cityname">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> State Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.cityname}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -93,11 +93,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editLenderHierarchy(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteLenderHierarchy(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteLenderHierarchy(row.lender_hierarchy_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -109,6 +109,6 @@
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
</mat-card-content>
|
||||
@ -113,3 +113,9 @@
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
@ -1,17 +1,23 @@
|
||||
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { LenderHierarchyDialogComponent }from '../lender-hierarchy-dialog/lender-hierarchy-dialog.component';
|
||||
/**Model */
|
||||
import { LenderHierarchy } from '../../../model/lender-hierarchy';
|
||||
|
||||
|
||||
@ -22,8 +28,8 @@ import { LenderHierarchy } from '../../../model/lender-hierarchy';
|
||||
})
|
||||
export class LenderHierarchyListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
loader: boolean = false;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
LenderHierarchyList: any = [];
|
||||
|
||||
//displayedColumns = ['lender_hierarchy_id', 'lender_hierarchy','isactive','actions'];
|
||||
@ -33,7 +39,7 @@ export class LenderHierarchyListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','LenderHierarchy', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','lender_hierarchy','isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -112,22 +118,20 @@ export class LenderHierarchyListComponent implements OnInit {
|
||||
deleteLenderHierarchy(id: number) {
|
||||
var PrimaryKeyWithValue ={'lender_hierarchy_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'LENDERHIERARCHY')
|
||||
.subscribe( data => { this.getLenderHierarchy();})
|
||||
.subscribe( data => { });
|
||||
this.getLenderHierarchy();
|
||||
//this._MastersService.deleteMasterDetails('lender_hierarchy_id',id,'LENDERHIERARCHY');
|
||||
}
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _fs: MastersService ) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<LenderHierarchy[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._fs.getAllLenderHierarchy();
|
||||
return this._fs.getAllMasterData('LENDERHIERARCHY');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
/** End Of List Component */
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
@ -18,9 +26,6 @@ export class MembersOccupationDialogComponent implements OnInit {
|
||||
private _memberService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -31,18 +36,29 @@ export class MembersOccupationDialogComponent implements OnInit {
|
||||
//console.log(this._occupationForm);
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var OccupationFormValues = this._occupationForm.value;
|
||||
if(isNaN(this.data.occupation_non_earning_member_id)) {
|
||||
var my_array = this._occupationForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._memberService.addMasterDetails(my_array,'OCCUPATIONMEMBERS').subscribe();
|
||||
|
||||
Object.keys(OccupationFormValues).forEach((key) => ( OccupationFormValues[key] == null) && delete OccupationFormValues[key]);
|
||||
console.log(OccupationFormValues);
|
||||
this._memberService.addMasterDetails(OccupationFormValues,'OCCUPATIONMEMBERS').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,6 +72,7 @@ export class MembersOccupationDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._occupationForm.reset();
|
||||
}
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
<button mat-raised-button color="primary" (click)="addMemberOccupation()" > + Add Member's Occupation</button>
|
||||
</div>
|
||||
<br>
|
||||
<!-- <div *ngIf="loader">
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- <div datatable>
|
||||
<table style="border-collapse: collapse">
|
||||
<thead>
|
||||
@ -90,19 +90,19 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="OccupationMember">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Occupation Non Earning Member </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -110,11 +110,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editMemberOccupation(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteMemberOccupation(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteMemberOccupation(row.occupation_non_earning_member_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
@ -78,4 +78,10 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,17 +1,22 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { MembersOccupationDialogComponent } from '../members-occupation-dialog/members-occupation-dialog.component';
|
||||
/** Model */
|
||||
import { MembersOccupation } from '../../../model/members-occupation';
|
||||
|
||||
|
||||
@ -22,7 +27,7 @@ import { MembersOccupation } from '../../../model/members-occupation';
|
||||
})
|
||||
export class MembersOccupationListComponent implements OnInit {
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
MemberOccupationList: any = [];
|
||||
|
||||
@ -31,7 +36,7 @@ export class MembersOccupationListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','OccupationMember', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -113,23 +118,25 @@ export class MembersOccupationListComponent implements OnInit {
|
||||
|
||||
deleteMemberOccupation(id: number) {
|
||||
var PrimaryKeyWithValue ={'occupation_non_earning_member_id':id};
|
||||
this._memberService.deleteMasterDetails(PrimaryKeyWithValue,'OCCUPATIONMEMBERS').subscribe( data => { this.getMemberOccupation();})
|
||||
|
||||
this._memberService.deleteMasterDetails(PrimaryKeyWithValue,'OCCUPATIONMEMBERS').subscribe(
|
||||
data => {})
|
||||
|
||||
this.getMemberOccupation();
|
||||
//this._memberService.deleteMasterDetails('occupation_non_earning_member_id',id,'OCCUPATIONMEMBERS');
|
||||
}
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
constructor(private _mos:MastersService ) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<MembersOccupation[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._mos.getAllMembersOccupation();
|
||||
return this._mos.getAllMasterData('OCCUPATIONMEMBERS');
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
}
|
||||
/** End of ListComponent */
|
||||
@ -1,20 +1,5 @@
|
||||
<!-- <div class="mb-1">
|
||||
<h2 mat-dialog-title>PD Allocation Type
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="container"
|
||||
fxLayout
|
||||
fxLayout.xs="column"
|
||||
fxLayoutAlign="center"
|
||||
fxLayoutGap="35px"
|
||||
fxLayoutGap.xs="0">
|
||||
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">PD Allocation Type</div>
|
||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||
<div fxFlex="2px" fxFlexOrder="2"></div>
|
||||
</div>-->
|
||||
<div class="ml-xs mr-xs" style="width: 100%;"
|
||||
|
||||
<div class="ml-xs mr-xs" style="width: 100%;"
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="center">
|
||||
<h2 mat-dialog-title style="width: 30%;"> PD Allocation Type </h2>
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/**Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
@ -19,9 +27,6 @@ export class PdAllocationTypeDialogComponent implements OnInit {
|
||||
private _pds: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -33,6 +38,12 @@ export class PdAllocationTypeDialogComponent implements OnInit {
|
||||
//console.log(this._PDAllocationTypeForm);
|
||||
}
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
if(isNaN(this.data.pd_allocation_type_id)) {
|
||||
var my_array = this._PDAllocationTypeForm.value;
|
||||
@ -58,6 +69,7 @@ export class PdAllocationTypeDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._PDAllocationTypeForm.reset();
|
||||
}
|
||||
|
||||
@ -68,23 +68,32 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="PDALLOCATIONTYPE">
|
||||
<ng-container matColumnDef="pd_allocation_type_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> PD Allocation Type </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.pd_allocation_type_name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="pdallocationlogic">
|
||||
<ng-container matColumnDef="pd_allocation_logic">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> PD Allocation Logic </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.pd_allocation_logic}} </mat-cell>
|
||||
<!-- <mat-slide-toggle>Slide me!</mat-slide-toggle> -->
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<ng-container matColumnDef="default">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Default </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||
@ -106,7 +115,8 @@
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
@ -112,4 +112,9 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -32,7 +32,8 @@ export class PdAllocationTypeListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','PDALLOCATIONTYPE','pdallocationlogic','IsActive'];
|
||||
//displayedColumns = ['SerialNo','PDALLOCATIONTYPE','pdallocationlogic','IsActive'];
|
||||
displayedColumns = ['serialno','pd_allocation_type_name','isactive','pd_allocation_logic','default'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -105,6 +106,19 @@ export class PdAllocationTypeListComponent implements OnInit {
|
||||
.subscribe( data => { this.getPDAllocationType();})
|
||||
//this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDALLOCATIONTYPE');
|
||||
}
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
@ -17,9 +25,7 @@ export class PdLocationApproachDialogComponent implements OnInit {
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
//pd_location_approach_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||
ngOnInit() {
|
||||
|
||||
@ -41,19 +47,30 @@ export class PdLocationApproachDialogComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var pdLocationApproachFormValue = this._pdLocationApproachForm.value;
|
||||
if(isNaN(this.data.pd_location_approach_id)) {
|
||||
var my_array = this._pdLocationApproachForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._MastersService.addMasterDetails(my_array,'PDLOCATIONAPPROACH').subscribe();
|
||||
|
||||
Object.keys(pdLocationApproachFormValue).forEach((key) => ( pdLocationApproachFormValue[key] == null) && delete pdLocationApproachFormValue[key]);
|
||||
|
||||
this._MastersService.addMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._pdLocationApproachForm.value,'PDLOCATIONAPPROACH').subscribe();
|
||||
this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Edited Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<mat-card-content>
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button color="primary" (click)="addPdLocationApproach()" > + Add Branch</button>
|
||||
<button mat-raised-button color="primary" (click)="addPdLocationApproach()" > + Add Pd Location Approach</button>
|
||||
</div>
|
||||
<br>
|
||||
<div *ngIf="loader">
|
||||
@ -69,21 +69,19 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="PDLocationName">
|
||||
<ng-container matColumnDef="description">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> PD Location </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -91,11 +89,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCity(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteBranch(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPdLocationApproach(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePdLocationApproach(row.pd_location_approach_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -107,6 +105,5 @@
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
</mat-card-content>
|
||||
|
||||
@ -112,4 +112,9 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,5 +1,13 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
@ -9,9 +17,11 @@ import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { PdLocationApproachDialogComponent } from '../pd-location-approach-dialog/pd-location-approach-dialog.component';
|
||||
/** Model */
|
||||
import { PdLocationApproach } from '../../../model/pd';
|
||||
|
||||
|
||||
@ -31,7 +41,7 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
noRecordFound: boolean = false;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','PDLocationName','IsActive','Actions'];
|
||||
displayedColumns = ['serialno','description','isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -39,7 +49,7 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _MastersService: MastersService) {
|
||||
|
||||
this.getPdLocationApproach();
|
||||
}
|
||||
|
||||
// get PdLocationApproachList() {
|
||||
@ -49,7 +59,7 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
//dataSource = new UserDataSource(this._MastersService);
|
||||
|
||||
ngOnInit() {
|
||||
// this.getPdLocationApproach();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -61,6 +71,7 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getPdLocationApproach();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
@ -74,6 +85,7 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
this.getPdLocationApproach();
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
@ -91,29 +103,28 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
}
|
||||
})}
|
||||
})
|
||||
}
|
||||
|
||||
deletePdLocationApproach(id: number) {
|
||||
var PrimaryKeyWithValue ={'pd_allocation_type_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDLOCATIONAPPROACH').subscribe( data => { this.getPdLocationApproach();})
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDLOCATIONAPPROACH').subscribe( data => { });
|
||||
this.getPdLocationApproach();
|
||||
//this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDLOCATIONAPPROACH');
|
||||
}
|
||||
//sdffsadfasf
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<PdLocationApproach[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllPDLocationApproach();
|
||||
return this._bs.getAllMasterData('PDLOCATIONAPPROACH');
|
||||
}
|
||||
disconnect() {}
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/** End of ListComponent */
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
@ -17,9 +25,6 @@ export class PdTypeDialogComponent implements OnInit {
|
||||
private _pdTypeService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -40,25 +45,35 @@ export class PdTypeDialogComponent implements OnInit {
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var PdTypeFormValues = this._pdTypeForm.value;
|
||||
if(isNaN(this.data.pd_type_id)) {
|
||||
var my_array = this._pdTypeForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._pdTypeService.addMasterDetails(my_array,'PDTYPE').subscribe();
|
||||
|
||||
Object.keys(PdTypeFormValues).forEach((key) => ( PdTypeFormValues[key] == null) && delete PdTypeFormValues[key]);
|
||||
//console.log(PdTypeFormValues);
|
||||
this._pdTypeService.addMasterDetails(PdTypeFormValues,'PDTYPE').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._pdTypeService.editMasterDetails(this._pdTypeForm.value,'PDTYPE').subscribe();
|
||||
this._pdTypeService.editMasterDetails(PdTypeFormValues,'PDTYPE').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._pdTypeForm.reset();
|
||||
}
|
||||
|
||||
@ -70,17 +70,17 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="PDType">
|
||||
<ng-container matColumnDef="type_name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>PD Type</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.type_name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -88,11 +88,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPDType(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePDType(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePDType(row.pd_type_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -104,5 +104,5 @@
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
</mat-card-content>
|
||||
|
||||
@ -112,4 +112,10 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,17 +1,19 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { PdTypeDialogComponent } from '../pd-type-dialog/pd-type-dialog.component';
|
||||
/**Model */
|
||||
import { PdType } from '../../../model/pd';
|
||||
|
||||
|
||||
@ -23,7 +25,7 @@ import { PdType } from '../../../model/pd';
|
||||
export class PdTypeListComponent implements OnInit {
|
||||
|
||||
|
||||
isPopupOpened = true;
|
||||
isPopupOpened: boolean = true;
|
||||
loader: boolean = false;
|
||||
PDTypeList: any = [];
|
||||
noRecordFound: boolean = false;
|
||||
@ -32,7 +34,7 @@ export class PdTypeListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','PDType', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','type_name', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -100,24 +102,22 @@ export class PdTypeListComponent implements OnInit {
|
||||
|
||||
deletePDType(id: number) {
|
||||
var PrimaryKeyWithValue ={'pd_type_id':id};
|
||||
this._PDTypeService.deleteMasterDetails(PrimaryKeyWithValue,'PDTYPE').subscribe( data => { this.getPDType();})
|
||||
this._PDTypeService.deleteMasterDetails(PrimaryKeyWithValue,'PDTYPE').subscribe( data => { });
|
||||
this.getPDType();
|
||||
//this._PDTypeService.deleteMasterDetails('pd_type_id',id,'PDTYPE');
|
||||
}
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
export class UserDataSource extends DataSource<any> {
|
||||
|
||||
|
||||
constructor(private _bs: MastersService) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<PdType[]> {
|
||||
//return this.userService.getUser();
|
||||
//return this._bs.getAllPDType();
|
||||
return this._bs.getAllMasterData('PDTYPE');
|
||||
}
|
||||
disconnect() {}
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/** End of ListComponent */
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
@Component({
|
||||
@ -17,10 +25,6 @@ export class ProductDialogComponent implements OnInit {
|
||||
private dialogRef: MatDialogRef<ProductDialogComponent>,
|
||||
private _MastersService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -30,26 +34,41 @@ export class ProductDialogComponent implements OnInit {
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
abbr: [this.data.abbr, Validators.compose([Validators.required])]
|
||||
});
|
||||
console.log(this._productMasterForm);
|
||||
//console.log(this._productMasterForm);
|
||||
}
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var ProductFormValues = this._productMasterForm.value;
|
||||
if(isNaN(this.data.product_id)) {
|
||||
|
||||
var my_array = this._productMasterForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
|
||||
Object.keys(ProductFormValues).forEach((key) => ( ProductFormValues[key] == null) && delete ProductFormValues[key]);
|
||||
//console.log(ProductFormValues);
|
||||
//this._MastersService.addProductMaster(this._productMasterForm.value);
|
||||
//this._MastersService.addProd(this._productMasterForm.value).subscribe(data=>this.array=data);
|
||||
this._MastersService.addMasterDetails(my_array,'PRODUCTS').subscribe();
|
||||
this._MastersService.addMasterDetails(ProductFormValues,'PRODUCTS').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
//this._MastersService.editProductMaster(this._productMasterForm.value);
|
||||
this._MastersService.editMasterDetails(this._productMasterForm.value,'PRODUCTS').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
|
||||
alert("Edited Successfully");
|
||||
}
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._productMasterForm.reset();
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,22 +14,22 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="ProductName">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Product Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Abbr">
|
||||
<ng-container matColumnDef="abbr">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Abbrevation </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.abbr}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -37,11 +37,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editProductMaster(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteProductMaster(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteProductMaster(row.product_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
<!-- Copyright 2018 Google Inc. All Rights Reserved.
|
||||
Use of this source code is governed by an MIT-style license that
|
||||
|
||||
@ -111,4 +111,10 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@ -1,17 +1,21 @@
|
||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
ViewChild } from '@angular/core';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
/** Dialog Component */
|
||||
import { ProductDialogComponent } from '../product-dialog/product-dialog.component';
|
||||
/** Model */
|
||||
import { ProductMaster } from '../../../model/product-master';
|
||||
//import { DataSource } from '@angular/cdk/table';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
//import { DataSource } from '@angular/cdk/collections';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-product-list',
|
||||
@ -29,20 +33,13 @@ export class ProductListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','ProductName','Abbr', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name','abbr', 'isactive','actions'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
applyFilter(filterValue: string) {
|
||||
this.dataSource.filter = filterValue.trim().toLowerCase();
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
constructor(private dialog: MatDialog,
|
||||
private _ProductService: MastersService) {
|
||||
@ -112,9 +109,24 @@ export class ProductListComponent implements OnInit {
|
||||
deleteProductMaster(id: number) {
|
||||
var PrimaryKeyWithValue ={'product_id':id};
|
||||
this._ProductService.deleteMasterDetails(PrimaryKeyWithValue,'PRODUCTS')
|
||||
.subscribe( data => { this.getProductMaster();})
|
||||
.subscribe( data => { });
|
||||
this.getProductMaster();
|
||||
|
||||
}
|
||||
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
/** For Display Tables Filtering */
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
}
|
||||
/** End of ListComponent */
|
||||
|
||||
@ -1,6 +1,14 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
import { FormBuilder,
|
||||
FormGroup,
|
||||
Validators,
|
||||
FormControl } from '@angular/forms';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MAT_DIALOG_DATA } from '@angular/material';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
|
||||
|
||||
@ -18,9 +26,6 @@ export class RegionsDialogComponent implements OnInit {
|
||||
private _regionsService: MastersService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -41,20 +46,28 @@ export class RegionsDialogComponent implements OnInit {
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var RegionFormValues = this._regionsForm.value;
|
||||
if(isNaN(this.data.region_id)) {
|
||||
var my_array = this._regionsForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
console.log(my_array);
|
||||
this._regionsService.addMasterDetails(my_array,'REGIONS').subscribe();
|
||||
|
||||
Object.keys(RegionFormValues).forEach((key) => ( RegionFormValues[key] == null) && delete RegionFormValues[key]);
|
||||
// console.log(RegionFormValues);
|
||||
this._regionsService.addMasterDetails(RegionFormValues,'REGIONS').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("saved");
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._regionsService.editMasterDetails(this._regionsForm.value,'REGIONS').subscribe();
|
||||
this._regionsService.editMasterDetails(RegionFormValues,'REGIONS').subscribe();
|
||||
this.dialogRef.close();
|
||||
alert("edited");
|
||||
//Need To Display saving Datas
|
||||
alert("Edited Successfully");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -72,18 +72,18 @@
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
|
||||
<ng-container matColumnDef="SerialNo">
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index;"> {{i+1}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="RegionName">
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Region Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||
@ -91,11 +91,11 @@
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editregions(row)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteregions(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteregions(row.regions_id)"><mat-icon>delete_outline</mat-icon></button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -108,5 +108,5 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
</mat-card-content>
|
||||
@ -112,4 +112,10 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user